Subject Re: [firebird-support] NewBie : How to rewrite a select Into query in firebird
Author niegil.thomas
Thanks Helen,

but the problem is that i dont now the table structure before hand. What should i do then. Pls Help


----- Original Message -----
From: Helen Borrie
Sent: Saturday, December 02, 2006 11:31 AM
Subject: Re: [firebird-support] NewBie : How to rewrite a select Into query in firebird

At 03:59 PM 2/12/2006, you wrote:
>Hi All
>I have a query that is as follows
>select * into TempEmployeeMaster From EmployeeMaster
>Here TempEmployeeMaster is new table which should be created with this
>statement execution . Can anyone tell me how this query can be
>rewritten in firebird . Ofcourse i know that Fb dont support Select +
>and INTO statement for creating new tables.


You need to create the new table and then use the syntax

insert into TheNewTable (Field1, Field 2.....)
select aCompatible1, aCompatible2, ... from TheOldTable

Warning: if you have been used to using your original syntax in some
other dbms for the purpose of creating temporary tables, this is not
a healthy thing to do in Firebird. Rather, architect this concept as
"temporary sets" inserted into/retrieved from a persistent
table. You wd need to add a unique "Session ID" of some kind to
capture/identify/isolate the set for a specific context of user and connection.


[Non-text portions of this message have been removed]