Focal Point
DB2 Stored Procedures

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8361067331

October 30, 2003, 11:34 AM
<FOCUS Freak>
DB2 Stored Procedures
Hello All,

My team is currently investigating the use of DB2 Stored Procedures called from WebFOCUS. We are attempting to get our data adapter set up to use CLI instead of CAF. We have created a DB2 Stored Procedure on the Main Frame and can call it using COBOL on the Main Frame, passing it parameters and receiving a cursor.

My question is, does anyone have a sample stored procedure and a sample foc exec that I can look at to give me an idea of how to code it? I have looked in the Online InfoResponse and have seen some generic items that are not much help. A real and usable stored procedure and foc exec would do me more good! Thanks for any help!

-FOCUS Freak
October 31, 2003, 01:10 PM
Carol Dobson
This is how we code it against SQL - it may help you a bit?

-DEFAULT &FromDate = '05/1/2003';
-DEFAULT &ToDate = '08/19/2003';
-DEFAULT &Cusip = '319963ah7';
-*
ENGINE SQLMSS SET CONVERSION LONGCHAR ALPHA
ENGINE SQLMSS SET SERVER connectionname
-RUN
SQL SQLMSS EX Cusip_report '&FromDate','&ToDate','&Cusip';
-TYPE &RETCODE
-TYPE &FOCERRNUM
-*
TABLE FILE SQLOUT
PRINT
OriginalCusip
NewCusip
DateMessageSent
LastModifiedUser
FromDate
ToDate
Comments
ON TABLE SET ONLINE-FMT PDF
-*ON TABLE HOLD FORMAT ALPHA
END
-RUN
October 05, 2004, 04:31 PM
krishkasi
Hi!!!
I have an stored procedure in Sql Server and used the above sample code and placed the stored proc name and connection name in place.
But i am getting following error message...

(FOC1400) SQLCODE IS 229 (HEX: 000000E5) XOPEN: 42000 : Microsoft OLE DB Provider for SQL Server: [42000] EXECUTE permission den
: ied on object 'KASITEST', database 'KasiTest', owner 'dbo'.
L (FOC1405) SQL PREPARE ERROR.

Please advise any other way i can explicitly pass the user id and password.
This would be of great help.
October 19, 2004, 01:39 PM
Carol Dobson
It appears you need security, (execute permission to run the stored procedure).