Home » SQL & PL/SQL » SQL & PL/SQL » Compilation error while CREATE FUNCTION (PL/SQL)
Compilation error while CREATE FUNCTION [message #414373] Tue, 21 July 2009 20:44 Go to next message
kuki
Messages: 8
Registered: November 2005
Junior Member
I get "Warning: Function created with compilation erors." while trying to create the following function.

Any help is much appreciated.

CREATE OR REPLACE FUNCTION f_description ( id NUMBER )  
	RETURN VARCHAR2(70)
	IS  manuf VARCHAR2(70);	
BEGIN
 	SELECT manufacturer
	INTO manuf
	FROM description 
	WHERE resinid = id;
	RETURN  (manuf);
 END f_description;
  /

[Updated on: Tue, 21 July 2009 21:02]

Report message to a moderator

Re: Compilation error while CREATE FUNCTION [message #414375 is a reply to message #414373] Tue, 21 July 2009 21:22 Go to previous messageGo to next message
BlackSwan
Messages: 25041
Registered: January 2009
Location: SoCal
Senior Member
SQL> SHOW ERROR
-- post results
Re: Compilation error while CREATE FUNCTION [message #414376 is a reply to message #414375] Tue, 21 July 2009 21:39 Go to previous messageGo to next message
kuki
Messages: 8
Registered: November 2005
Junior Member
SQL is in the file test.sql

SQL> @test

Warning: Function created with compilation errors.

SQL> show error
Errors for FUNCTION F_DESCRIPTION:

LINE/COL ERROR
-------- -----------------------------------------------------------------
2/17     PLS-00103: Encountered the symbol "(" when expecting one of the
         following:
         . @ % ; is authid as cluster order using external character
         deterministic parallel_enable pipelined aggregate
         result_cache

SQL>
Re: Compilation error while CREATE FUNCTION [message #414377 is a reply to message #414373] Tue, 21 July 2009 22:11 Go to previous messageGo to next message
BlackSwan
Messages: 25041
Registered: January 2009
Location: SoCal
Senior Member
correct RETURN value syntax
compare against input parameter

Or Read The Fine Manual
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/subprograms.htm#sthref1682
Re: Compilation error while CREATE FUNCTION [message #414378 is a reply to message #414377] Tue, 21 July 2009 22:57 Go to previous message
kuki
Messages: 8
Registered: November 2005
Junior Member
Removing the number of characters in RETURN type solved the problem.

Thanks.
Previous Topic: Query to display a column value into multiple rows[Merged]
Next Topic: Invalid ORA-01422 Error
Goto Forum:
  


Current Time: Tue Dec 06 12:07:07 CST 2016

Total time taken to generate the page: 0.06020 seconds