Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie Dynamic SQL Question
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.
Received on Mon Dec 06 1999 - 14:51:49 CST
![]() |
![]() |