Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how can i exeucte stored function in sqlplus program.
Hi,
functions always return a value so you must provide
a variable where this value can be stored.
In SQL*PLUS you have to code an anonymous block.
Check the docs for examples on using stored functions.
Greetings,
Guido
"ÀÌ¿µÇÑ" <hotyoung_at_netnsec.com> wrote...
> 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;
> /
<snip>
> When I executed this function in sqlplus, I showed error like below.. how
> can i execute stored function in sqlplus.
<snip>
> 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
<snip>
Received on Mon Jul 22 2002 - 04:06:56 CDT
![]() |
![]() |