How to pass multiple values through a single variable? [message #376975] |
Fri, 19 December 2008 05:21  |
vasantha17
Messages: 10 Registered: April 2008 Location: Hyderabad
|
Junior Member |
|
|
Hi,
I am trying to pass two values to a select statement like below.
declare
pv_geo varchar2
v_count varchar2(7);
begin
pv_geo:='''AMER''.''LA''';
dbms_output.put_line(pv_geo);
v_count:=0;
select count(1) into v_count FROM oper_units
WHERE oputcode IN ('FE','CUSTOMER')
AND geo in (pv_geo) AND delete_flag IS NULL ;
dbms_output.put_line(v_count);
end;
/
Its returning 0 values. But when i tried to run the select statement directly on the database its returning 16000 records.
please help me to fix this issue.
Thanks,
Vasantha
[MERGED by LF, after moving topic from the Forms forum into the SQL & PL/SQL one]
[Updated on: Sat, 20 December 2008 02:09] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
Re: how to pass multiple values through a single varialbe [message #377083 is a reply to message #376975] |
Sat, 20 December 2008 00:59   |
rajy_salim
Messages: 204 Registered: January 2008 Location: Beirut - Lebanon
|
Senior Member |
|
|
Nothing is mentioned about FORMS although this post is in the FORMS FORUM. The title mentions "Oracle 9i" only.
Besides,
Quote: | dbms_output.put_line(v_count);
|
the OP uses "DBMS_OUTPUT.PUT_LINE" in his query, which ,I believe, is not supported in FORMS too. So, I think this post may be moved to the appropriate forum, and then the use of EXECUTE IMMEDIATE is correct.
To use dynamic SQL in forms, try the DBMS_SQL package.
Have a look at THIS THREAD
Rajy
|
|
|
|
|