| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| (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 |
|
#2
|
| "Nick" 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 |
![]() |
| Thread Tools | |
| Display Modes | |