-
Bind bariables
hi
1) when i used some SQL statement in PL/SQL procedure, i dont see that SQL in V$SQL and V$SQLAREA Views, why? how can i view those.
2) While using a somple variable in selection crietera in a procedure, just like below
create or replace procedure try (a number) is
b emp%rowtype;
begin
select * into b from emp where empno=a;
dbms_output.put_line(b.empno||' '||b.ename);
end;
can we call "a" a bind variable and if every time i exectute this procedure with a different values of a, would it use the already present SQL statement in shared pool or on every execution, it would be hard parsed again?
3) i m using VB ans SQR(For reports) When i use some VB variable to run a query just like below
ABC = "SCOTT"
select * from emp where ename = ABC
Here suppose that ABC is a VB variable.
when ever i run this query with a different value of ABC, i see a new row in v$SQLAREA, it means that query is not being reused.
How would i use BIND variables in VB or any other language so that Oracle would consider it bind variable instead of a literal
Regards
in v$SQL
Salman Ahmed Qureshi
Lahore, Pakistan
-
Depends on what data access component you are using .Here is an example using ADO.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|