Home » SQL & PL/SQL » SQL & PL/SQL » HELP! variable in global temporary table
HELP! variable in global temporary table [message #37681] Wed, 20 February 2002 11:17 Go to next message
sverch
Messages: 582
Registered: December 2000
Senior Member
When I try to execute procedure which populates global temporary table I get an error.
The following piece of code gives it to me. Apparently, Oracle does not recognize variables. I played with quotes and cancats. If anybody knows how to pass variables to ddl
statement within PL/SQL please respond.

(v_max_dt and v_case_boi were declared)

execute immediate 'insert into ' ||V_TB_NAME ||
' select a.case_nmbr, b.case_id,
FROM tbl a, tbl1 b
WHERE a.case_nmbr=b.case_nmbr
AND ...different conditions
AND (v_max_dt BETWEEN a.begin_date and a.end_date))
AND a.case_nmbr = v_case_boi ';

ERROR at line 1:
ORA-00904: invalid column name
ORA-06512: at line 29.
Re: HELP! variable in global temporary table [message #37689 is a reply to message #37681] Thu, 21 February 2002 06:36 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
execute immediate 'insert into ' ||V_TB_NAME ||
' select a.case_nmbr, b.case_id,
FROM tbl a, tbl1 b
WHERE a.case_nmbr=b.case_nmbr
AND ...different conditions
AND ('||''''||v_max_dt||''''||' BETWEEN a.begin_date and a.end_date))
AND a.case_nmbr = '||v_case_boi;
Re: HELP! variable in global temporary table [message #37691 is a reply to message #37689] Thu, 21 February 2002 07:08 Go to previous messageGo to next message
sverch
Messages: 582
Registered: December 2000
Senior Member
Suresh,

you are genious!!!

Thank you.
Re: HELP! variable in global temporary table [message #38813 is a reply to message #37681] Thu, 16 May 2002 11:37 Go to previous message
Jeff
Messages: 63
Registered: July 1999
Member
use dbms_sql
Previous Topic: V$ tables???
Next Topic: Re: Need to implement this business rule for triggers
Goto Forum:
  


Current Time: Tue Apr 23 04:23:07 CDT 2024