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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding output of two resultset in PL/SQL and sending back by atribute

Status
Not open for further replies.

manush

Programmer
Aug 9, 2004
16
IT
Hi,

I have two string containing two queries like
str1 VARCHAR2(1000);
str2 VARCHAR2(1000);

str1 := Select 'Test1' from dual;
str2 := Select 'Test2' from dual;

In PL/SQL, to get the result set of ONE query I use

OPEN o_result_set FOR str1;

Where o_result_set is IN OUT refcursor in stored procedure's parameter;

Now I have to get the out put of two different query, then to combine them and send it back via OUT parameter.

Pls suggest a solution

Manoj
 
I am not able to use UNION because by using Union, string length of actual query are coming out about 7500 character which can not be stored in VARCHAR2.

So I thought to break into differect select statement, execute them separately, bind the result set and finally send back.

Pls, Suggest.

Manoj
 
Manoj,

You can store 32767 bytes in a PL/SQL varchar2. SQL*Plus bind varibles have a 4000-byte limitation. You can assess the total length of the string in your PL/SQL block, then populate as many 4000-chr. bind variables as you need to accommodate your 32767-maximum result in PL/SQL.

Let us know if this helps,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 22:05 (19Aug04) UTC (aka "GMT" and "Zulu"), 15:05 (19Aug04) Mountain Time)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top