Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> how can i exeucte stored function in sqlplus program.

how can i exeucte stored function in sqlplus program.

From: ÀÌ¿µÇÑ <hotyoung_at_netnsec.com>
Date: Mon, 22 Jul 2002 08:40:40 GMT
Message-ID: <cyP_8.136068$nP6.13147113@news.bora.net>


 I made PL/SQL code like below and stored oracle.

$ cat func.sql
create function emp_insert ( my_empno in emp.empno%type, my_ename in emp.ename%type ) return boolean as
begin

        insert into emp( empno, ename ) values( my_empno, my_ename );
        return true;
exception
        when others then
                return false;

end;
/

 When I executed this function in sqlplus, I showed error like below.. how can i execute stored function in sqlplus.



SQL> call emp_insert ( 200, 'you' );
call emp_insert ( 200, 'you' )

     *
ERROR at line 1:
ORA-06576: not a valid function or procedure name

SQL> execute emp_insert( 100, 'you' );
BEGIN emp_insert( 100, 'you' ); END;

      *
ERROR at line 1:

ORA-06550: line 1, column 7:
PLS-00221: 'EMP_INSERT' is not a procedure or is undefined
ORA-06550: line 1, column 7:

PL/SQL: Statement ignored

SQL> emp_insert( 100, 'you' );
SP2-0734: unknown command beginning "emp_insert..." - rest of line ignored. SQL> call emp_inert( 100, 'you' );
call emp_inert( 100, 'you' )

     *
ERROR at line 1:
ORA-06576: not a valid function or procedure name



Received on Mon Jul 22 2002 - 03:40:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US