Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

srw.do_sql() 1

Status
Not open for further replies.

mbl73

Programmer
Mar 28, 2007
9
TT
How do you include a variable in a select into statement enclosed in srw.do_sql()
srw.do_sql('select count(emp_id)
into ' || v_ct ||
' from table1 t1, table2 t2
where trunc(t1.date_entered) = ''12-MAR-07''
and t1.test = t2.test_link');

the variable v_ct is not being recognised.
 
You don't need SRW.DO_SQL to select into. Just type it in directly. The procudyre is used for DDL, like creating a table, etc. So just put
Code:
select count(emp_id)
into v_ct
from table1 t1, table2 t2
where trunc(t1.date_entered) = '12-MAR-07'
and t1.test = t2.test_link;
The variable v_ct is to be declared, of cource.
 
Thank you very much, I tried it and it worked.
 
hi nagornyi
Thanks again for the assistance with do_sql. I have another question this time with Oracle Reports Developer. Is it possible to create a report based on a varray? And if it is how do you go about building it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top