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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Insert with parameterized table name?

Re: Insert with parameterized table name?

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Sat, 01 May 1999 02:10:49 GMT
Message-ID: <37325719.8711660@netnews.worldnet.att.net>


On Fri, 30 Apr 1999 21:26:57 GMT, bconver_at_uswest.com wrote:

>I'm using 7.3.4 and need to perform an insert into a table using a parameter
>for the table name. However, the catch is that I'm trying it through PRO-C.
> INSERT INTO :tablename (x, y, z) VALUES(:x, :y, :z);

PRO-C won't like that. You can't do it the way you are trying to do it.

>
>something like this anyway. The proc compiler doesn't like me using the
>variable reference for the table name. I'm looking for an alternative.

Oracle has a built-in package named DBMS_SQL that allows you to build and execute SQL statements dynamically. If I recall correctly, in release 7.3.x that package is documented in the Application Developer's Guide.

regards,

Jonathan Received on Fri Apr 30 1999 - 21:10:49 CDT

Original text of this message

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