cancel
Showing results for 
Search instead for 
Did you mean: 

Error on Executing an Oracle 10g Stored Procedure from PowerBuilder Vr 11.1.

Former Member
0 Kudos

Hi,

I am trying to call an Oracle 10g stored procedure from PowerBuilder Vr 11.1 and I can't get it to work.

Below is my code. When I run my application, the first call to Execute statement returns SQLCODE = 100 and Fetch returns -1.
The second call to the Execute returns SQLCODE = -1 and Fetch returns -1.
I can't get the procedure to return any data.
Any help would be greatly appreciated.


----- Power Builder Code ----------

DECLARE GetData PROCEDURE FOR PARKING.P_Get_data (:p1 ,:p2) /* input params*/

Execute GetData ;

FETCH GetData INTO :P3, :P4; /*output params*/

IF SQLCA.SQLCODE = 100 THEN
Messagebox ("FYI", "SQLCA.SQLCODE = 100")
elseIF SQLCA.SQLCODE = -1 then
MessageBox("Ooops","SQLCA.SQLCODE = -1", StopSign!)
Else
Messagebox ("OUTPUT value for P3 is: ", P3 )
END IF
Close GetData;

chris_keating
Advisor
Advisor
0 Kudos

I do not think there is enough information here to assist. We know that SQLCode 100 means that there were no rows fetched. Can you debug the procedure that is being called and ensure that it is in fact returning row(s)?

When you get SQLCode -1, what is the SQLErrText?

Former Member
0 Kudos

Procedure works fine and p3 and p4 are populated.

Former Member
0 Kudos

I tried below alternative approach and didn't succeed either:

I creates a datawindow that uses a stored procedure as datasource.

But for some reason the data source painter lists only a handful of stored procedures in database and mine is not one of them.

My procedure has EXECUTE permission granted to Public.

I am against tight deadlines and need to get this to work. Any advice would be greatly appreciated.
Former Member
0 Kudos

My database procedures do appear if I open an existing datawindow , then go to ROWS --> Update Stored Procedure.
Unfortunately I don't have any existing datawindow that uses a stored procedure so that I could use that as a baseline.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member202249
Active Participant
0 Kudos

Hi Ari,

Are you using the O10 database interface?

Please review the following in the PB 11 doc as to what can be done with result sets.

http://infocenter-archive.sybase.com/help/index.jsp?topic=/com.sybase.dc37776_1100/html/connpb/connp...

The below discussion may also help.

https://archive.sap.com/discussions/thread/3607505

Pat