Query Parameter in Session window

Venky

Member
Hello,

Wondering if you can use "&" as to provide dynamic query parameters in Session window so to make it work as linked query feature in PLSQL Developer. For example I can below query in SQL Window but could not make it work in Session window:

SELECT * FROM emp WHERE emp_no = '&emp_no'

What I am not sure is if there is alternate approach to make it work in Session window! I hope someone could help me on this.

Cheers,
Venky

 
Hi,

the session-window is not for this kind of stuff. Use the sql-window.

The session-window is for collecting session-infos. You can create details-tabs like Long-OPS.

Code:
SELECT ceil((sofar / decode(totalwork,0,1,totalwork)) * 100) "%",
       time_remaining time_remain_sec,
       elapsed_seconds time_elap_sec,
       time_remaining + elapsed_seconds time_tot_est_sec,
       round (time_remaining/60) time_remaining_min,
       round ((time_remaining + elapsed_seconds)/60) time_tot_est_min,
       message,
       start_time,
       last_update_time
FROM gv$session_longops
WHERE sid = :sid
      AND serial# = :serial#
ORDER BY start_time DESC

There you can only use Bindvariables like :SID witch correspond to the same columns of the main Session-Query.
 
Thanks Theod for your reply.

Appreciate that session window is for collecting session-info, but I believe the feature (linked queries with bind variable across multiple tabs approach) can be extended/used for queries that are not related to sessions too.

I am not sure how bind variables can be used in SQL Window, can you let me know how linked queries with bind variable across multiple tabs approach can be achieved in SQL window?

Thanks in advance...
 
Hi,

how to use Bindvariables is decribed in the PLSQL Developer Help. Look at Reports/Variables. They working the same way in sql-windows and report-windows.
 
Theod,

I should have been more specific with my question in previous post.

In your initial reply you suggested to use sql window. How can we achieve Details tab feature in sql window?

Cheers..
 
Hi,

this is possible and a little bit tricky. Since you cant "select into" in sql-window, you must get the result of you driving data itself into an &... bindvariable. The same variable can you use for the sub-Queries.

Code:
select '&<name="emp_no" list="select emp_no, ename from emp order by 2" description=YES>'
from dual;

SELECT * FROM emp WHERE emp_no = '&emp_no';
...

If you mark all queries an hit F8 there will be two tabs: the first with our driving data and the second for details.
And in the PLSQL Developer Help you find out more.
 
Back
Top