Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie Dynamic SQL Question
Thanks for the reply. I have come across the DESCRIBE_COLUMNS procedure
in pl/sql 8 and am trying to use that to build the query. I can get
information such as the name, type, etc of the columns in the specified
table from this procedure. I am now trying to take that information and
build my dynamic query with that information. When I use the procedure
DEFINE_COLUMN, it appears that I have to create different versions of
the output definition dependent on what the datatype of the column is.
In reading the documentation, I am unaware as to what the procedure is
looking for in its 'column' parameter. In the examples it seems that
the 'column' parameter (e.g. DEFINE_COLUMN(c IN INTEGER, position IN
INTEGER, column)) is just taking in the type of the column. However,
the datatype of the column paramater varies. Do I just have to pass an
example of the datatype in the 'column' parameter? I'm sorry if the
question is muddled, I'm quite confused. Any help is greatly greatly
appreciated.
In article <82h7l2$uiq$1_at_nnrp1.deja.com>,
AleX <korrozia_at_my-deja.com> wrote:
> Yes, you will need to build the statements dynamically.
DBA_TAB_COLUMNS
> is the view that I'd use - it gives the name name of the columns in
the
> right sequence. You can also datatypes from it. However, it gets
pretty
> hairy when you have to bind the columns of the return dataset. So you
> may want to define the max number of columns, etc.
>
> In article <82h5jq$t2b$1_at_nnrp1.deja.com>,
> bravo6500_at_my-deja.com wrote:
> > Hello,
> > I am trying to write a stored procedure that takes a user
inputted
> > tablename and dumps all the contents of the table into a flat file.
> > Since I will be using the dbms_sql package to build my query, it
seems
> > that it is necessary to definte output variables. I am not sure how
> to
> > proceed since the output variables will vary dependent on what
> > tablename the user enters. Will I just have to write a long
> > conditional statement that looks explicitly for what table the user
> > enters then picks the output variables from it, or is there a
sleeker,
> > more efficient way of doing this? Any advice is greatly
appreciated.
> >
> > Thanks.
> > MM
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> --
> Alex Shterenberg
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Dec 07 1999 - 18:14:43 CST
![]() |
![]() |