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 gather bind params in SQL?

Re: How to gather bind params in SQL?

From: Victor <mvici_at_yandex.ru>
Date: 10 Aug 2004 09:27:46 -0700
Message-ID: <2c447de6.0408100827.1dbf4f55@posting.google.com>


mvici_at_yandex.ru (Victor) wrote in message news:<2c447de6.0408090906.12466ac1_at_posting.google.com>...
> Oracle Server 9.2.0.5
> How can I gather param names (bind variables) in dynamic SQL (or PL/SQL)
> string?
> It seems that dbms_sql wouldn't help resolve the problem.
> Manual SQL string parsing is not acceptable...

ok, more tangible explanation...
in response to some posting in this thread (about sys views and lack in understanding of my question)

declare

	l_cur				number;
	p_query_text		varchar2(2000);
	l_param				varchar2(2000);
	i					number;

begin
--(1)

        p_query_text := 'select object_name from all_objects where object_name = :p_object_name';

        l_cur := dbms_sql.open_cursor;

--(2)

        dbms_sql.parse(l_cur, p_query_text, dbms_sql.native);

at the point (1) in the listing p_query_text may contain another sql text with other bind params.
at the point (2) recommended views (V_$SQL_BIND_DATA, V_$SQL_BIND_METADATA) have no bind variables for the open cursor. at the point (3) one of the views contains a row for my bind variable, but with empty bind_name.

that name appears after I recall my PL/SQL block one more... Received on Tue Aug 10 2004 - 11:27:46 CDT

Original text of this message

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