Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to use dynamic sql? - Where's some documentation ?

Re: How to use dynamic sql? - Where's some documentation ?

From: Toon Koppelaars <T.Koppelaars_at_INTER.NL.NET>
Date: Thu, 29 Feb 1996 21:04:41 +0100
Message-Id: <9602292016.AA19911@alice.jcc.com>


Execute the following query, and lots of documentation on using dynamic SQL within
PL/SQL (not within PRO*C) will appear...

        select text
        from all_source
        where name='DBMS_SQL'
        order by type,line;



>Hi to all,
>eventually I'll try now to get familiar with dynamic sql. Filing through
>meters of oracle and sql guides I found at last a Chapter 'using Dynamic
>SQL' in the 'programmer's guide to the Oracle precompilers V 1.5'.
>The examples I found there were quite different to those I've already seen
>in some mails which had been sent to this list.
>
>e.g. in this chapter of the oracle guide they used dynamic sql with
>statements as :
>
>
>EXEC SQL INCLUDE SQLCA;
>display ...
>...
>EXEC SQL CONNECT :name ....
>set upd_stmt = 'Update tab SET val = :v ';
>...
>EXEC SQL PREPARE sql_stmt FROM :upd_stmt;
>...
>EXEC SQL EXECUTE sql_stmt USING :value;
>...
>EXEC SQL COMMIT WORK RELEASE ;
>...
>
>
>which is very different from something like :
>
>
>CREATE or REPLACE PROCEDURE make_preimm_view
>> > ( this_provider IN person.primary_provider%TYPE) IS
>
>> > c1 INTEGER;
>> > rc INTEGER;
>> > str1 VARCHAR2(800);
>> >
>> > BEGIN
>> > str1 := 'CREATE OR REPLACE VIEW test as select * from providers; ';
>> > c1 := dbms_sql.open_cursor;
>> > dbms_sql.parse(c1,str1,dbms_sql.native);
>> > rc := dbms_sql.execute(c1);
>> > dbms_sql.close_cursor(c1);
>> > END;
>
>which was a code from another mail sent to the list.
>
>Where can I find something about dynamic sql as it is used in the second
>example? I'm a bit at a loss now.
>
>Thanks to everybody who can help to end my dynamic-sql-confusion,
>TIA,
>best regards
>
>Susanne Stolpe
>
>
>
>Ruhr-Universitaet Bochum
>Medizin. Fakultaet
>Inst. f. Biomathematik & Informatik
>Bochum, FRG
>e-mail : Susanne.stolpe_at_rz.ruhr-uni-bochum.de
>
>
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

|    """                                                                |
|  T/O-O\N   Toon Koppelaars                                            |
|   \ - /    E-mail: T.Koppelaars_at_inter.nl.net                          |
|            Phone : 00-31-345-630451                                   |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ Received on Thu Feb 29 1996 - 15:16:42 CST

Original text of this message

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