Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> how can i exeucte stored function in sqlplus program.
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;
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:
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