Home » SQL & PL/SQL » SQL & PL/SQL » wrong number or types of arguments in call to 'PUT_LINE'
wrong number or types of arguments in call to 'PUT_LINE' [message #35890] Mon, 22 October 2001 13:45 Go to next message
Dewana
Messages: 6
Registered: October 2001
Junior Member
Hi,
could please tell what i am doing wrong in the folowing block? It is not letting me print the valuse which I think can be there. if i took out the v_name, v_status, v_size, v_used from OUT_PUT line it runs fine.

Thanks in advance.

Here is the anonymous block

DECLARE
v_Name dba_tablespaces.tablespace_name%type;
v_status dba_tablespaces.status%type;
v_size number(12,3);
v_used number(12,3);
v_used_pct number(5,3);
CURSOR v_tablespace_usage IS
SELECT d.tablespace_name, d.status,
(a.bytes / 1024 / 1024) "SIZE",
(((a.bytes - DECODE(f.bytes, NULL, 0, f.bytes)) / 1024 / 1024)) "USED"
FROM sys.dba_tablespaces d, sys.sm$ts_avail a, sys.sm$ts_free f
WHERE d.tablespace_name = a.tablespace_name
AND f.tablespace_name (+) = d.tablespace_name;
BEGIN
open v_tablespace_usage;
loop
FETCH v_tablespace_usage into v_name, v_status, v_size, v_used;
exit when v_tablespace_usage%notfound;
v_used_pct := ((v_used / v_size) * 100);
DBMS_OUTPUT.PUT_LINE(v_name, v_status, v_size, v_used, v_used_pct);
end loop;
close v_tablespace_usage;
END;

----------------------------------------------------------------------
Re: wrong number or types of arguments in call to 'PUT_LINE' [message #35893 is a reply to message #35890] Mon, 22 October 2001 14:06 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You'll need to call it with just a single parameter - concatenate your variables using a comma or some other delimiter:

DBMS_OUTPUT.PUT_LINE(v_name || ',' || v_status || ',' || v_size || ',' || v_used || ',' || v_used_pct);

----------------------------------------------------------------------
Re: wrong number or types of arguments in call to 'PUT_LINE' [message #35908 is a reply to message #35893] Tue, 23 October 2001 05:59 Go to previous message
Dewana
Messages: 6
Registered: October 2001
Junior Member
Thanks man.

----------------------------------------------------------------------
Previous Topic: Insert statements from Stored Function
Next Topic: Executing An Generated sql statement from a procedure
Goto Forum:
  


Current Time: Thu Apr 02 02:23:55 CDT 2020