Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How can I output the content in a variable from dbms_output.put_line

Re: How can I output the content in a variable from dbms_output.put_line

From: <edwardmi1_at_my-deja.com>
Date: Thu, 26 Oct 2000 06:31:09 GMT
Message-ID: <8t8j3d$qrb$1@nnrp1.deja.com>

Hi Maggie,

Believe me, it's a good style of programming to examine the specification of DBMS package you are going to use. (and this assertion isn't based only on my experience ;)

See comments bellow:

> In one part of my PLSQL, I try to watch the output from a variable
 when I
> loop each time:
>
> select * into v_r11
> from orders
> where product_line_cd = '719D';

I guess the variable "v_r11" is type of orders%ROWTYPE, isn't?

>
> dbms_output.put_line( v_r11);
>

procedure "put_line()" takes one of scalar parameters: varchar2, number, date (it's overloaded on the type of argument). So, the argument of type %ROWTYPE is the argument of a wrong type.

If you'd like to display your rowtype variable you can follow the next way:
Format your rowtype variable into varchar2 eg: ..
v_r11_4put_line VARCHAR2(255);
..
v_r11_4put_line := to_char(v_r11.col1_number)||to(v_r11.col2_data).. dbms_output_put_line(v_r11_4put_line);
..

And, be carefull, length of the line (varchar2 argument) is limited by 255 bytes per line!

> However, I got error message:
> PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

As you see above this is an expected behavour of an Oracle session. And you might have found the answer in the specification of the package.

>
> Please help.
>
>

Edward,
OraDev.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Oct 26 2000 - 01:31:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US