Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamic SQL using INSERT with a predefined query and an id.
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