Hi PFC Gurus,
Sorry for non-PFC question. But you might find it baffling...
My friend, Mahendra encountered this strange problem...
problem no 1------
Now here's what I did. I had only IN parameters in the Procedure. When I
called the procedure through the front end, I got a return code 100.
Then I added an OUT parameter. I did not use the OUT parameter anywhere.
Now in PB I got a return code 0. Try this out:
Create a table Temp having just 1 column 'x'. Insert one row in the table.
Now write this procedure.
Create or Replace Procedure SP_TEMP as
Begin
Update Temp set x = 100;
End;
In PB:
Declare proc_temp Procedure for SP_TEMP;
Execute proc_temp;
MessageBox("",SQLCA.SQLCODE)
The messagebox give 100.
Now just make a small change in the procedure.
Create or Replace Procedure SP_TEMP(m OUT NUMBER) as
Begin
Update Temp set x = 100;
m := 100;
End;
Now in PB:
Declare proc_temp Procedure for SP_TEMP;
Execute proc_temp;
MessageBox("1",SQLCA.SQLCODE)
Fetch proc_temp into :abc;
MessageBox("2",SQLCA.SQLCODE)
In both the messageboxes we get 0. Just by defining an OUT parameter for the
procedure.
Now problem no 2------
I wrote a function in Oracle which has only select statements. Say the
functions name is f_new_room() which returns Varchar2.
Now in SQLPlus I wrote a statement:
Select f_new_room() from Dual;
I get a proper result.
Now I had to write many such functions in order to use it in the datawindow
select statement. So I wrote a Package say PK_1 and included the function in
the package. The package contains only functions and all
functions have only select statements. The is no Pragma in any of the
function.
Now in SQLPlus I wrote a statement:
Select PK_1.f_new_room() from Dual;
And I got this error. "Function does not guarantee in not updating the
database".
Please help me out.
Karthik S.
> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE: help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]