Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling DB2 Stored Procedures (VFP6)

Status
Not open for further replies.

foxbldr

Programmer
Apr 16, 2002
109
CA
Hi All,

I am calling DB2 stored procedures within VFP6 prgs.

When I issue my call inside DB2 command center, it works but calling withing VFP6 gives me errors without any clue.

From DB2 command Center:

Call Get_MonthSum ('B1','2006-05-01','2006-05-31',?,?)

From VFP6:

lcDB2Call= " Call Get_MonthSum(?m.lcBranch, ?m.ldDateStart, ?m.ldDateEnd,?@lnReturnCode,?@lcMsg);"

Then I execute:
=sqlexec(gnConn, lcDB2Call,'MonthSum')


Since I don't have any specific error message here, can somebody point me to a good source(clues/hints) that describes DB2 SP calls within VFP?

Foxbldr







 

Hi Foxbldr,

You say "VFP6 gives me errors", but then you say " I don't have any specific error message here".

What sort of errors are you getting if you don't get a message?

Have you checked to see what SQLEXEC() is returning? Have you tried using AERROR() to determine the error message?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike,

When checked with AERROR, time to time, I got different errors.

i.e. The specified C:\...\...\get_month_sum library could not be loaded. (get_month_sum is my DB2 stored procedure.)
and sometimes, DB2 sqlstate codes.

My connection is OK and sqlexec works fine with select statement.


Thanks

Foxbldr


 

Foxbldr,

I would guess it's something wrong in your DB2 configuration that is preventing it from finding the stored procedure. Can you run other SPs in this way?

One other possibility (but unlikely, given the error message): Are you sure that lnReturnCode and lcMsg actually exist before you issue the SQLEXEC()? Since these are being passed by reference, they must be pre-defined.

Sorry I can't be more help.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top