Subject Re: [firebird-support] Export as insert statement
Author Helen Borrie
At 03:35 PM 19/02/2004 +0000, you wrote:
>Hi,
>
>ther's a metod to export a query as insert statement?

It's not clear quite what you mean by this.

Do you mean "use an insert query to export data"?

If so, look at
create table extTable EXTERNAL FILE '/path/to/your/file.txt'
as
field1 char(10),
field2 char(20),
...
);

This creates an external file that you can insert fixed-length text records
to. You can use CAST() to convert non-character types to strings of
appropriate size.

insert into extTable(field1, field2....)
select
cast(f1 as char(10)),
cast(f2 as char(20)),
cast(......
from AnotherTable
where...
order by...

/heLen