Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> What's wrong with my PLSQL Function?
Hi all,
I'm learning in PL/SQL.
I create a little PLSQL block (disp_chars.sql) to execute the function
f_line() as below:
disp_chars.sql
CREATE OR REPLACE FUNCTION f_line (v_number in INTEGER, v_character in
VARCHAR2)
RETURN VARCHAR2
IS
v_line VARCHAR2(80) := '';
BEGIN WHILE v_num > 0 LOOP
v_line := v_line + v_character; v_num := v_num - 1;
END;
/
Declare
v_num INTEGER; v_char VARCHAR2(1); v_result VARCHAR2(80);
v_num := &number;
v_char := '&character';
v_result := f_line(v_num,v_char);
dbms_output.put_line(v_result);
end;
and It failed with the error below:
Warning: Function created with compilation errors.
Enter value for number: 8
Enter value for character: *
v_result := f_line(v_num,v_char);
*
ERROR at line 9:
ORA-06550: line 9, column 16: PLS-00905: object SCOTT.F_LINE is invalid ORA-06550: line 9, column 4:
What's wrong with my function f_line() above?
How can I debug a PLSQL function?
I'm very newbie in Oracle PL/SQL.
Thanks in advance for any help.
DH Received on Wed Apr 23 2003 - 01:34:53 CDT
![]() |
![]() |