Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Result of a function executing a command
A copy of this was sent to "Antony Giblin" <agiblin_at_software-resource.com>
(if that email address didn't require changing)
On Wed, 25 Aug 1999 15:30:37 +0100, you wrote:
>Does anyone know whether it is possible to execute a command in SQL*Plus,
>based on a result
>of a function. For example :
>
>SQL > VAR result VARCHAR2
>SQL > EXEC :result::=PROCEDURE_10111 (parameters);
>SQL > IF :result='equality test' then EXEC PROCEDURE 2; << i.e. can this be
>done in Oracle 7.3 ???
>
>If anyone is also trying to do the same, please let me know and we may be
>able to help each other !!
>
>Cheers
>Tony Giblin.
>
var result varchar2
exec :result := procedure_10111( parameters );
exec if :result = 'equality test' then procedure_2; end if;
is but one way. another would be:
begin
:result := procedure_101111( parameters );
if ( :result = 'eqality test' ) then
procedure_2;
end if;
end;
/
another:
declare
result varchar2(25);
begin
result := procedure_101111( parameters );
if ( result = 'eqality test' ) then
procedure_2;
end if;
end;
/
another:
begin
if ( procedure_101111( parameters ) = 'equality test' ) then
procedure_2;
end if;
end;
/
(i would say that procedure_10111 has a bad name, its really function_10111)
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Aug 25 1999 - 10:03:16 CDT
![]() |
![]() |