Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL using INSERT with a predefined query and an id.

Dynamic SQL using INSERT with a predefined query and an id.

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Tue, 26 Jun 2001 22:03:32 GMT
Message-ID: <3b390147.347233437@news.alt.net>

We're thinking about using a table to store queries. These queries will then be run and will populate another table. However, each population needs a unique id, but has to be the same for every row in the population.

So, the query can be gotten in a procedure via "SELECT Query INTO The_Query FROM Query_Table WHERE Id = The_Id".

If no id were needed, the following statement could be issued. "EXECUTE IMMEDIATE 'INSERT INTO The_Table(Object_Id) ' || The_Query;. Alas, I need to add a unique id. The query itself cannot pop a value off a sequence because every one of its rows needs the same value.

Any ideas?

Brian Received on Tue Jun 26 2001 - 17:03:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US