× 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.



Dieter

this is the program I need to get working. I will have about 20 more like
it so they will all be sub procedures or functions.

Our management will not spend money at this time so I am unable to get
funding for assistance.

Darryl.

On Fri, Aug 26, 2016 at 1:24 AM, D*B <dieter.bender@xxxxxxxxxxxx> wrote:

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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.