[Info-ingres] Use tablename in SP

This is a discussion on [Info-ingres] Use tablename in SP within the Ingres Database forums in Other Databases category; (I was asked this in another forum) I have a procedure which executes with a different table name being passed. Inside the procedure. I retrieve the tablename and do an insert in to the table. The question is what is the way of retrieval. -- Nick -----We Solve your Computer Problems--- Panther, Ingres, UNIX, Interbase, Firebird - Available Shortly...

Go Back   Database Forum > Other Databases > Ingres Database

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 12-29-2005, 05:20 AM
Default [Info-ingres] Use tablename in SP

(I was asked this in another forum)

I have a procedure which executes with a different table name being passed.
Inside the procedure. I retrieve the tablename and do an insert in to the
table. The question is what is the way of retrieval.

--
Nick
-----We Solve your Computer Problems---
Panther, Ingres, UNIX, Interbase, Firebird - Available Shortly

Reply With Quote
  #2  
Old 12-29-2005, 06:59 AM
Default Re: [Info-ingres] Use tablename in SP

"Nick" wrote in message
news:mailman.1135848061.26271.info-ingres-at-cariboulake.com...
> (I was asked this in another forum)
>
> I have a procedure which executes with a different table name being

passed.
> Inside the procedure. I retrieve the tablename and do an insert in to the
> table. The question is what is the way of retrieval.


You can't do that in Ingres.

The query execution plan for an Ingres DBP is generated when the DBP is
first loaded, and all the tables that it references are resolved at that
moment, not at execution time. You can't even fake it out by defining a
synonym before invoking the DBP. The only two solutions are separate DBPs
for each possible table, or one DBP that has a series of IF-ELSEIF... tests
to choose the required INSERT statement. (The latter solution has the
potentially nasty side effect of locking all the tables it *could* insert
into.)

Roy Hann (rhann at rationalcommerce dot com)
Rational Commerce Ltd.
www.rationalcommerce.com
"Ingres development, tuning, and training experts"
Ingres Corporation Partner




Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 11:18 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Integrated by bbpixel2009 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.