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

Home -> Community -> Usenet -> c.d.o.server -> Re: column name as a part of the result set

Re: column name as a part of the result set

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Tue, 17 Feb 2004 08:27:08 -0800
Message-ID: <1077035185.594496@yasure>


Billy Verreynne wrote:

> Daniel Morgan <damorgan_at_x.washington.edu> wrote
>

>>Can not be done without hard coding.

>
>
> You can use dynamic SQL and do a DESCRIBE on the cursor to fetch the
> column names/labels into a dynamic array... and then process it from
> there (i.e. iterate through column array per row for columns with the
> same name and then comparing the row's values to see if it is
> different or not).
>
> I'm sure I've seen DESCRIBE supported in PL/SQL (it is an often used
> Pro*C/OCI function).
>
> --
> Billy

Not according to tahiti.oracle.com though I will gladly stand corrected.

SQL> begin

   2 execute immediate 'DESCRIBE dual';    3 end;
   4 /
begin
*
ERROR at line 1:
ORA-00900: invalid SQL statement
ORA-06512: at line 2

If you can write the code you know the columns. If using NDS you could always go to all_tab_columns too.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Tue Feb 17 2004 - 10:27:08 CST

Original text of this message

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