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: Tricky Dynamic SQL question

Re: Tricky Dynamic SQL question

From: Alexander Miroshnikov <alexander_miroshnikov_at_hotmail.com>
Date: Wed, 25 Dec 2002 10:36:28 -0000
Message-ID: <auc1pk$iih$1@news5.svr.pol.co.uk>


> We have supertype tables that keep logs of a variety of different
> tables. I have a function. So a record in a specific supertype table
> will tell you when a specific subtype table is being used.
>
> I have a function(that I didnt write) that I call earlier in the
> procedure, that tells me which table I need to use.
>
> I have a requirement where I need to dynamically select all columns in
> this table and put it into a record.

You can emulate "dynamic record" using PLSQL table as follows -

type dynamic_field is record( fieldname varchar2(30), fieldtype varchar2(30), numeric_value number, datetime_value date, varchar_value varchar2(4000));
type dynamic_record is table of dynamic_field index by binary_integer;

You can populate "dynamic records" using dbms_sql.

Or, you can extract your records into xml and then parse it into dom.

What exactly is required anyway? You said that you need to dynamically select all columns and put them into a record. What for? Received on Wed Dec 25 2002 - 04:36:28 CST

Original text of this message

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