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 -> Insert with parameterized table name?

Insert with parameterized table name?

From: <bconver_at_uswest.com>
Date: Fri, 30 Apr 1999 21:26:57 GMT
Message-ID: <7gd76t$ge0$1@nnrp1.dejanews.com>


Hi all,

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);

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.

does anyone know how to do something like this in PRO-C? (I could do it through ODBC, but that isn't an option). How about through a stored procedure or trigger? Is that possible, or will Oracle puke on a parameterized table name there as well...

For anyone wondering why I want to parameterize the table name, I have a database with over 30 duplicate tables. Data of different types goes into different tables with the same data, but with specialized id type. Similar to a customer database with customer data split into tables by customer home state. Don't want to hard-code all possible table names, since tables can be added at anytime...and I'd like to avoid re-compilations every time we add a new table to the system.

If you have a possible solution to this, please mail me at bconver_at_uswest.com

thanks,

   Brian.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Apr 30 1999 - 16:26:57 CDT

Original text of this message

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