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 -> Re: Dynamic SQL using INSERT with a predefined query and an id.

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

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 26 Jun 2001 20:49:45 -0700
Message-ID: <3B3957D9.13A173AD@exesolutions.com>

Brian Tkatch wrote:

> 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

I am a bit confused about what you id constraints are with respect to the table. But what is the purpose of creating this unusual arrangement. Is it possible that another solution would meet your requirement?

Daniel A. Morgan Received on Tue Jun 26 2001 - 22:49:45 CDT

Original text of this message

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