Subject: Re: How to retrieve data from Linux UDB from VSE
From: John Mycroft (johnm@csi-international.com)
Date: Thu Jul 31 2008 - 12:01:23 EDT
Hi, Frank I suspect we're getting close. I need to add SQLDBA.CSIDMBSQ to SYSTEM.SYSACCESS, presumably on the local server. (Supplementary question - how do I do that with a batch job?) My inability to plug those names seems like a DB2 restriction and I am stuck with whatever I put into the pre-compiler PARM info. I can't bind at pre-compile time as I don't have any idea what the remote server name is going to be until I run my program - hence the use of host variables in the CONNECT. Cheers - John Frank Swarbrick wrote: >>>> On 7/29/2008 at 9:35 AM, in message > <WJGjk.542$De7.376@bignews7.bellsouth.net>, John > Mycroft<johnm@csi-international.com> wrote: >> Gday, All >> I am having little joy getting data from a Linux UDB database from VSE, >> largely because I have no idea what commands & parameters are needed to do > >> the job, a topic on which all my DB2 books are amazingly silent. >> >> My program is written using dynamic SQL (as I have no idea what I want >> it to do until I run it) and works just fine accessing a VSE DB2 database > >> using all the default user ids and passwords. >> >> Skipping all the junk in my program, here are the commands I execute:- >> >> EXEC SQL CONNECT :ID IDENTIFIED BY :PW TO :TO >> EXEC SQL PREPARE S1 FROM :COMML >> EXEC SQL DESCRIBE S1 INTO SQLDA >> >> I then get the following error (the message layout is mine) >> SQLCODE = -805, SQLSTATE = 51002 >> RELATED TO SQLDBA.CSIDMBSQ 0X4040404040404040 >> >> and the DB2 messages manual tells me that error -805 means the package >> owner.package-name is not in the SYSTEM.SYSACCESS catalog table. >> >> I assembled the program as user SQLDBA and the program name is CSIDMBSQ >> so I am half right - I would think that the userid should be the :ID from > >> the CONNECT, not SQLDBA but SQLDBA is assembled into my program as a >> literal created by the pre-compiler which is sub-convenient, especially as > >> my >> program is re-entrant so I can't plug the literal. >> >> Can someone please tell me what vital step I am missing here, please, >> and save my sanity. > > Is CSIDMBSQ the name of your program? The message you are getting is > actually from the server, so using the VSE messages manual might not get you > what you want (though in this case it is very close). If you have the DB2 > Command Line Processor installed on your PC you can go in to it and type, in > this case "? SQL805" and you'll get back this: > > db2 => ? sql805 > > > SQL0805N Package "<package-name>" was not found. > > Explanation: > > The statement cannot complete because the necessary package was not > found in the catalog. > > ...plus a lot more stuff. > > Basically, from what I can tell you are not binding the package to the > server. Even if all of your statements are dynamic I am guessing the server > still needs a package. (I am only guessing. I know that a program with > only "non-server" related SQL need not have a package. This includes > CONNECT, COMMIT, and the like. But I have not tried just dynamic SQL.) > > Anyway, I am curious as to what your parameters are for your SQL preprocess. > Are you using the BIND parameter? If not, you need to. Either that or you > need to use CBND or the batch binder to bind the package from your SQLBIND > file to the server. > > The other thing I can think of is that you are binding against your VSE > server and not against the remote server. You need to specify the name of > the server in the DBNAME= parameter on the bind. Or, again, bind later from > SQLBIND. (Can't imagine why you wouldn't want to precompile and bind at the > same time, but...) > > Hope this helps! > Frank > >
This archive was generated by hypermail 2b25 : Tue Aug 19 2008 - 17:50:10 EDT