Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Monitor the sql and binding data
You create bind variables in SQL*Plus like so:
VARIABLE g_dname VARCHAR2(15)
The only ways I know to populate a SQL*Plus bind variable are to write a PL/SQL block:
BEGIN :g_dname := 'ACCOUNTING'; END; -- Initialize a bind variable for use in WHERE clause
Or to SELECT INTO it like so:
SELECT dname
INTO :g_dname
FROM scott.dept
WHERE deptno = 10;
You view the contents of a bind variable in SQL*Plus with
PRINT g_dname
If you want to see what SQL statements have been executed against the server using the variable you would
SELECT sql_text
FROM V$sqlarea
WHERE sql_text LIKE '%:g_dname%';
These are SQL*Plus examples. Things work differently in other environments. HTH. Best!
Randall
wy <wy_at_fudan.edu> wrote in message
news:e8d0244c.0105220046.3f54cca7_at_posting.google.com...
> who can tell me the sql to monitor the sql and binding data in sqlplus.
> or other oracle utilitis.
> thanks in advance.
Received on Wed May 23 2001 - 17:02:49 CDT