× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Darryl,
let us try to analyze your programm snippet:

Exec Sql CONNECT TO AXTRN01
USER :SQL_USER
Using :SqlPwd;

this should work, if ArdGate is configured well (verifyed by strsql) and user annd password are correct (verifyed by debug) checking in the programm would be better.

Exec Sql Set Connection AXTRN01;

you won't need this, the last connect is current connection untill changed by set connection, but this will do no harm to your programm.

zSqlCmd = 'Select count(*) into ? from AXTRN01..UNITOFMEASURE'
+ ' where Symbol = '
+ Q + %trim(pUOM) + Q;

Parameter markers are replaced later by vars and are only allowed where a literal could be (in other words: the vars are read only)
=> here we have your problem!

Exec Sql Prepare SQLRMTCMD from :zSqlCmd;

DB2 can't check this, it doesn't see the current value of the prepareString at compiletime. At runtime this is checked by the remote database and diffrennt databases could have very diffrent behaviour. Important is the SQLSTATE in the joblog and for additional information the javalog. The SQLCODE might be misleading, because ArdGate has to derive it from a SQLSTATE of a remote database - it's only guruanteed that success is 0, warning is > 0 and error is < 0.
This might crash for one database and pass for another database. You should check SQLCODE or SQLSTATE for success after every SQL Operation.

Exec Sql Execute SQLRMTCMD using :Count ;

now is the latest point where it will crash.

As I stated over and over again: the easiest way to running programms is, to take an example and go on. If you are not familar with SQL and dealing with remote databases, it might be betterto pay for an expert (BTW: I've done coaching and/or writing the needed programms - it's my business and mostly cheaper than tumbling around for days).

Dieter

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.