you need to accept the return value of the function in a variable. the correct way to do is
 
SQL> var a varchar2(1000)
sql> execute :a := emp_sel('gali')
SQL> print a
 
OR
 
SQL>declare
SQL>a varchar2(1000);
SQL>begin
SQL>a := emp_sel('gali');
SQL>DBMS_OUTPUT.PUT_LINE(a);
SQL>end;
SQL>/
 
Regards
Naveen
-----Original Message-----
From: purushottam krishna hegde [mailto:[EMAIL PROTECTED]
Sent: Friday, June 06, 2003 5:05 PM
To: Multiple recipients of list ORACLE-L
Subject: procedure/function error

hi all,
this is purushottam hegde from Bangalore(IND)
i am relatively new to oracle and so to this group.
iam having a problem with function...
it goes like this.
 
 
 
SQL> CREATE OR REPLACE FUNCTION EMP_SEL(ename IN Varchar2) return varchar2 is
  2  resex varchar2(3);
  3  Begin
  4  SELECT sex into resex from emp where name=ename;
  5  return(resex);
  6  END;
  7  /
Function created.
 
SQL> EXECUTE EMP_SEL('gali');
BEGIN EMP_SEL('gali'); END;
      *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'EMP_SEL' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
 
 
 
pl help me in this regard
 
thanking all of u
 
purushottam hegde
 
 


Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

DISCLAIMER:
This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission.

Reply via email to