dbTalk Databases Forums  

Stored Procedure: How to output entire buffer

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Stored Procedure: How to output entire buffer in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bill Wordsworth
 
Posts: n/a

Default Stored Procedure: How to output entire buffer - 06-09-2008 , 01:09 PM






I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dmbs_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill

Reply With Quote
  #2  
Old   
Bill Wordsworth
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:30 PM






On Jun 9, 2:09*pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
Quote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill
In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill


Reply With Quote
  #3  
Old   
Bill Wordsworth
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:30 PM



On Jun 9, 2:09*pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
Quote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill
In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill


Reply With Quote
  #4  
Old   
Bill Wordsworth
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:30 PM



On Jun 9, 2:09*pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
Quote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill
In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill


Reply With Quote
  #5  
Old   
Bill Wordsworth
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:30 PM



On Jun 9, 2:09*pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
Quote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill
In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill


Reply With Quote
  #6  
Old   
Dan Blum
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:56 PM



In comp.databases.oracle.misc Bill Wordsworth <bill.wordsworth (AT) gmail (DOT) com> wrote:
Quote:
On Jun 9, 2:09?pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill

In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill
I'm sure exactly what you're trying to do here, but I doubt this is the correct
approach. Most likely you just want to make your OUT variable a ref cursor.
If there's some reason you can't do that, create a record collection type, make
the variable that type, and put the cursor results into the variable.

DBMS_OUTPUT is designed to display results - it's not meant to be used like
this.

--
__________________________________________________ _____________________
Dan Blum tool (AT) panix (DOT) com
"I wouldn't have believed it myself if I hadn't just made it up."


Reply With Quote
  #7  
Old   
Dan Blum
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:56 PM



In comp.databases.oracle.misc Bill Wordsworth <bill.wordsworth (AT) gmail (DOT) com> wrote:
Quote:
On Jun 9, 2:09?pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill

In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill
I'm sure exactly what you're trying to do here, but I doubt this is the correct
approach. Most likely you just want to make your OUT variable a ref cursor.
If there's some reason you can't do that, create a record collection type, make
the variable that type, and put the cursor results into the variable.

DBMS_OUTPUT is designed to display results - it's not meant to be used like
this.

--
__________________________________________________ _____________________
Dan Blum tool (AT) panix (DOT) com
"I wouldn't have believed it myself if I hadn't just made it up."


Reply With Quote
  #8  
Old   
Dan Blum
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:56 PM



In comp.databases.oracle.misc Bill Wordsworth <bill.wordsworth (AT) gmail (DOT) com> wrote:
Quote:
On Jun 9, 2:09?pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill

In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill
I'm sure exactly what you're trying to do here, but I doubt this is the correct
approach. Most likely you just want to make your OUT variable a ref cursor.
If there's some reason you can't do that, create a record collection type, make
the variable that type, and put the cursor results into the variable.

DBMS_OUTPUT is designed to display results - it's not meant to be used like
this.

--
__________________________________________________ _____________________
Dan Blum tool (AT) panix (DOT) com
"I wouldn't have believed it myself if I hadn't just made it up."


Reply With Quote
  #9  
Old   
Dan Blum
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 01:56 PM



In comp.databases.oracle.misc Bill Wordsworth <bill.wordsworth (AT) gmail (DOT) com> wrote:
Quote:
On Jun 9, 2:09?pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill

In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill
I'm sure exactly what you're trying to do here, but I doubt this is the correct
approach. Most likely you just want to make your OUT variable a ref cursor.
If there's some reason you can't do that, create a record collection type, make
the variable that type, and put the cursor results into the variable.

DBMS_OUTPUT is designed to display results - it's not meant to be used like
this.

--
__________________________________________________ _____________________
Dan Blum tool (AT) panix (DOT) com
"I wouldn't have believed it myself if I hadn't just made it up."


Reply With Quote
  #10  
Old   
Bill Wordsworth
 
Posts: n/a

Default Re: Stored Procedure: How to output entire buffer - 06-09-2008 , 02:34 PM



On Jun 9, 2:56*pm, t... (AT) panix (DOT) com (Dan Blum) wrote:
Quote:
In comp.databases.oracle.misc Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:

On Jun 9, 2:09?pm, Bill Wordsworth <bill.wordswo... (AT) gmail (DOT) com> wrote:
I wrote a Stored Procedure wherein I use a Cursor to extract multiple
rows and columns. I then write them into the buffer
(dbms_output.put_line). But when I try to capture the entire result
into an OUT variable, I only get the last buffered line.

So how do I output the entire buffer- all rows and columns?
Cheers, Bill
In other words (maybe), how do I use dbms_output.get_lines() to assign
value to an OUT variable?
Cheers, Bill

I'm sure exactly what you're trying to do here, but I doubt this is the correct
approach. Most likely you just want to make your OUT variable a ref cursor..
If there's some reason you can't do that, create a record collection type,make
the variable that type, and put the cursor results into the variable.

DBMS_OUTPUT is designed to display results - it's not meant to be used like
this.
OK, I added the following to "CREATE OR REPLACE PROCEDURE ... ()":
cursor_out_test OUT cursor_test

But when I try:
DEFINE CURSOR TYPE cursor_test IS REF CURSOR RETURN table%ROWTYPE;
...or...
DECLARE TYPE cursor_test IS REF CURSOR RETURN table%ROWTYPE;
I get errors.

Cheers, Bill


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.