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: Dynamic sql (built on the fly)

Re: Dynamic sql (built on the fly)

From: Mark G <mgumbs_at_nospam.hotmail.com>
Date: Wed, 30 Jun 1999 10:18:09 +0100
Message-ID: <3779de73.0@145.227.194.253>

First of all, you need to save your query in a string

e.g v_string := 'Select ......'

You can add your user supplied search criteria as well

e.g v_string := 'Select ' || v_column || ' from ' || v_table);

Once you have your string, pass v_string into the DBMS_SQL package. See any good PL/SQL book for the dbms_sql commands

HTH Mark

huh wrote in message <7lcm1k$14ji$2_at_ns.felk.cvut.cz>...
>Hi,
>
>I'd like to know how can I build up
>the sql string
>(e.g.: select <list of columns according one variable>
> from <table name according another variable>)
>and execute it. Everything in PL/SQL.
>
>TIA
>
>--
>Thank you for keeping >anti-spam< habit:
>not including my address in your reply.
>
>
>
Received on Wed Jun 30 1999 - 04:18:09 CDT

Original text of this message

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