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 -> generating SQL in SQL

generating SQL in SQL

From: Scott Freeman <freeman_at_cs.purdue.edu>
Date: Wed, 27 Oct 1999 16:40:06 GMT
Message-ID: <7v79t5$60n$1@nnrp1.deja.com>


I am trying to generate SQL select statements dynamically through a select. What I have is:

select "select """||table_name||""", count(*) from "||table_name||";" from all_tables
where table_name = 'foo';

The statement I am trying to get out of this is:

select "foo", count(*) from foo;

I get the following error...

select "select """||table_name||""", count(*) from "||table_name||";"

                                                                  *
ORA-00904: invalid column name

Help with this would be appreciated.

Scott

--
Scott E. Freeman
freeman_at_cs.purdue.edu

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Oct 27 1999 - 11:40:06 CDT

Original text of this message

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