Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Prateek Jain wanted to insert multiple rows from a SELECT into a table without using an unload/load file, since his INSERT ... VALUES (SELECT ...) form only worked for a single row. Jonathan Leffler gave the answer: INSERT INTO TableA SELECT * FROM Temp_A WHERE a_condition = 1. Another poster pointed to the IDS 10 manual, which drew a sarcastic exchange.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Hi Everybody,
I have to write a Database Script, In which values from one tables are
inserted into another table.
Now the query format something like this
Insert into table a values (select * from temp_a where a_condition = 1)
Now if the query *select * from temp_a where a_condition = 1 *returns
single row then its fine.
But here query is returning multiple row, is there any way to insert into
table multiple row .
one way is
Unload to "fileName" Select * from table
Load from "fileName" Insert into table.I could have used above unload approach but it would create one file, which
i am not supposed to do.
--
Regards,
Prateek Jain
Prateek Jain wrote:
> I have to write a Database Script, In which values from one tables are
> inserted into another table.
> Now the query format something like this
>
> Insert into table a values (select * from temp_a where a_condition = 1)
That works? If it returns one row - well, I can see how it works, but
I'm surprised it is allowed.
> Now if the query *select * from temp_a where a_condition = 1 *returns
> single row then its fine.
> But here query is returning multiple row, is there any way to insert
> into table multiple row .
INSERT INTO TableA SELECT * FROM Temp_A WHERE a_condition = 1
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
bozon wrote:
> very nice way to say RTFM.
I have every confidence that now the user knows where to find TFM he
will be sure to R it ;-)
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.