Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: dynamic table name
Chuck:
Look into the PL/SQL package DBMS_SQL. It lets you submit dynamic SQL - either DML or a select statement as a cursor.
HTH,
Tom Best
R. Chuck Matthews <matthews_chuck_at_bah.com> wrote in message
news:398B523E.AD5080E1_at_bah.com...
> I would like to be able to write a generic select statement where I can
> pass in data elements and a tablename. Example:
>
> IS
>
> tableName varchar2(10);
> dataElements varchar2(60);
>
> tableName := getTableName(arg);
> dataElements := getDataElements(args);
>
> // dataElements could have "element1,element2,element3,element4".
> file://tableName could have "msgType"
>
>
> select dataElements from tableName where ...
>
> Can this be done??? If so, how???
>
> --
> R. Chuck Matthews
> Associate
> BOOZ-ALLEN & HAMILTON INC.
>
> Office: (703) 908-4322
> Fax: (703) 908-4344
> email: matthews_chuck_at_bah.com
>
>
>
>
Received on Mon Aug 07 2000 - 00:00:00 CDT
![]() |
![]() |