Subject | Re: [firebird-support] Export as insert statement |
---|---|
Author | Milan Babuskov |
Post date | 2004-02-20T13:53:31Z |
Martijn Tonies wrote:
You can write:
SELECT 'insert into table (column_list) values (' ||
column1 || ',' || column2 ...etc || ');';
And then just use isql to put results of that select into a file.
Of course, be careful with non-numeric types. You have to enclode them
in ' like this:
SELECT 'insert into tab values (' '''|| char_column || ''', etc.
'' are needed to escape ' which you need in result.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net
>>ther's a metod to export a query as insert statement?Sorry I haven't followed thread from the start.
>
> Only via third-party tools or components. Or write your
> own code for it.
You can write:
SELECT 'insert into table (column_list) values (' ||
column1 || ',' || column2 ...etc || ');';
And then just use isql to put results of that select into a file.
Of course, be careful with non-numeric types. You have to enclode them
in ' like this:
SELECT 'insert into tab values (' '''|| char_column || ''', etc.
'' are needed to escape ' which you need in result.
HTH
--
Milan Babuskov
http://fbexport.sourceforge.net