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: How to use the dbms_sql.variable_value

Re: How to use the dbms_sql.variable_value

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 9 May 1999 19:32:58 +0100
Message-ID: <926274957.4779.0.nnrp-11.9e984b29@news.demon.co.uk>


Do you mean when dbms_sql is called with a pl/sql block as the thing to be executed ?

Is the following example any help (run under 8.0.4):

rem
rem var_val.sql
rem Using the variable_value call when the rem dynamic sql is actually pl/sql
rem

set serveroutput on size 10000

declare

    src_cur pls_integer;
    src_rows pls_integer;

    var_value number(2) := 0;

begin

    dbms_output.put_line('Starting at: ' || var_value);     src_cur := dbms_sql.open_cursor;
    dbms_sql.parse(

            src_cur,
            'begin :m1 := 23; end;',
            dbms_sql.V7

    );

    dbms_sql.bind_variable(src_cur,'m1',var_value);     src_rows := dbms_sql.execute(src_cur);     dbms_sql.variable_value(src_cur,'m1',var_value);

    dbms_output.put_line('Ending at: ' || var_value);     dbms_sql.close_cursor(src_cur);

end;
.
/

--

Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk

Jessie wrote in message <3733B64E.8A72552D_at_ms3.hinet.net>...
>Hello,
>
>Could anyone give an example how to use dbms_sql.variable_value when we
>use pl/sql blocks ?
>Thanks a lot.
>
>
>Jessie
>
>
Received on Sun May 09 1999 - 13:32:58 CDT

Original text of this message

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