Actually, two questions here:

1. I have a dynamicly-built query that will be
executed using dynamic sql:
   select Z, (select y from tableA t1 where
t1.id=t2.id) X 
   from tableA t2;
To get the value from the query, I use:
   dbms_sql.column_value( theCursor, 1,columnValue);
   dbms_sql.column_value( theCursor, 2,columnValue);
Now, how can I get the column name (i.e. X) using
dynamic sql? 
2. I tried to use a group function in the above query
as following:
   select countZ) A, (select y from tableA t1 where
t1.id=t2.id) X 
   from tableA t2
   group by X;                  
The query failed and the error message was:
   ORA-00904: invalid column name (i.e. Oracle says
that X is not a valid column name)
Is ther a way to work around this problem?
         
Thanks a lot.

WL

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: lwm
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to