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

Home -> Community -> Usenet -> c.d.o.tools -> dbms_sql advice

dbms_sql advice

From: A Kydd <akydd_at_gpu.srv.ualberta.ca>
Date: 2000/07/24
Message-ID: <8lhnch$ato$1@pulp.srv.ualberta.ca>#1/1

I understand that dbms_sql will allow me to use dynamic queries with a select statement such as
stmt_str := 'SELECT ename, sal

             FROM emp
             WHERE job = :jobname';

I've been trying to do a similar query, but with variables in the SELECT clause, as well as in the FROM clause. My query string looks like this: stmt_str:= 'SELECT :field

            FROM :myTable 
            blah blah blah...';

where field and myTable are later bound to a column and table name. However, dbms_sql.parse gives me an error: ORA-00923: FROM keyword not found where expected. I've checked and rechecked the string, but have found no obvious errors. Is there another way to approach what I'm trying to do?

-- 
	...Alan...

"Have you seen a rubix cube around lately??  Slinky?
 What's happening to our world?" --Tey Steenbergen
Received on Mon Jul 24 2000 - 00:00:00 CDT

Original text of this message

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