Home » SQL & PL/SQL » SQL & PL/SQL » Use result from function in a Anonymous Block
Use result from function in a Anonymous Block [message #32] Sat, 05 January 2002 04:31 Go to next message
Aykut
Messages: 1
Registered: January 2002
Junior Member
Used software : W98, Oracle 8i, SQL Plus

FUNCTION
----------------------------------------
CREATE OR REPLACE function FKT()
      return Number
is
begin
      return 0;
end;
----------------------------------------

ANONYMOUS BLOCK
----------------------------------------
DECLARE
      i NUMBER;
      j_value NUMBER;
BEGIN
      i = FKT();
      IF i = 0
      THEN
            dbms_output.put_line('Result = 0.');
      ELSE
            dbms_output.put_line('Result = 1.');
      END IF;

      &j_value;
END;
/
----------------------------------------

QUESTION
After the Function return the "return-value",
I want that first of all the IF part should done.
But here is the Problem.
After I get the result from the function,
there is the prompt to enter the j_value.

But I want the output from the IF-Part.

How can I do that ?

bye
Aykut (from Germany)
Re: Use result from function in a Anonymous Block [message #41 is a reply to message #32] Mon, 07 January 2002 04:04 Go to previous message
Satish Shrikhande
Messages: 167
Registered: October 2001
Senior Member
when the anonymous block strats compling it will look for bind variables first and as you have it , it will ask for the value of that variable .
Previous Topic: Re: package problem
Next Topic: Executing PL/SQL from a file
Goto Forum:
  


Current Time: Sun May 31 19:17:36 CDT 2020