Thursday, December 17, 2009

generating all flags for skype with #flamerobin and #firebird sql

Here is how to get the original script
wget http://27.org/isocountrylist/iso_country_list.sql

create a new table with this syntax (I have just deleted the "IF NOT EXISTS" from the original table creation script)

http://paste.ubuntu.com/343619/

populate the table with load script from flamerobin
http://paste.ubuntu.com/343617/

the only issue was quoting in firebird , you just need to replace \' type of quoting with "

If you need to use an apostrophe inside a Firebird string, you can “escape” the apostrophe character by preceding it with another apostrophe.

For example, this string will give an error:

'Joe's Emporium'

because the parser encounters the apostrophe and interprets the string as 'Joe' followed by some unknown keywords.

To make this a legal string, double the apostrophe character:

'Joe''s Emporium'

Notice that this is TWO single quotes, not one double-quote.

Run this query in flamerobin to get the iso from table

SELECT a.ISO
FROM COUNTRY a

We need to add (flag:ISO) to the query with the concatenation

SELECT '(Flag:'||a.ISO||')'
FROM COUNTRY a

and do the copy paste in skype :P





Create a procedure that concatenates thouse values

and do a select

SELECT p.SKYPE_COUNTRIES
FROM RETURN_COUNTRIES10 p

and copy paste

result should be like this


No comments: