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

PL/SQL

Status
Not open for further replies.

NitinJain

Programmer
Jun 28, 2002
18
0
0
IN
Hello,
I have defined a simple function as follows:

CREATE OR REPLACE FUNCTION isValidName (theString VARCHAR) RETURN BOOLEAN IS

BEGIN
RETURN TRUE;

END isValidName;

I was trying to test it by executing the following:

SET SERVEROUT OFF

BEGIN
dbms_output.put_line( isValidName ('HELLO') );

END;

but get the following errors:
ERROR at line 2:
ORA-06550: line 2, column 2:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored

Please can anyone advise me on this.

Regards
 
You cannot print a boolean in DBMS_OUTPUT.PUT_LINE
I believe you need a string.

Putting a TO_CHAR around the function will not do it either.
To print, the result:

RES := isValidName ('HELLO');
IF RES THEN
dbms_output.put_line('True');
END IF;

=================================
Thomas V. Flaherty Jr.
Birch Hill Technology Group, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top