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



Hey all,

I am currently playing around with calling SQL CLI directly from an RPG
service program. So far I have had great success when using these functions
except that I was hoping to give more information in the job log as to which
statements are being prepared/executed (and which have errors). Currently
the joblog provides:

DESCRIBE of prepared statement SQLSTATEMENT000003 completed.
PREPARE of statement SQLSTATEMENT000003 completed.

In an attempt to try and get this working I tried naming the cursor using
the sqlSetCursorName function. My findings so far have lead me to the
following possibilities:

1) The Cursor name is not the name given in the job log (is there any way
other than manually coding messages to the job log?), or;
2) I am not using the function correctly.

In the hopes that my problem is option 2 I have used sqlSetCursorName in the
following way:
/free
rc = SQLAllocEnv(envHandles);

rc = SQLAllocConnect(envHandle:connectionHandle);

rc = SQLConnect(connectionHandle :dataSource
:dataSourceLen :pUserId :userIDLen
:pPassword :passwordLen);


rc = SQLAllocStmt(connectionHandle :statementHandle);

rc = SQLSetCursorName(statementHandle
:%trim(statementName)
:SQL_NTS);

rc = SQLPrepare(statementHandle
:%trim(curStatement)
:statementLength);
/end-free

My understanding is that the Internal Cursor Name would be allocated during
the SQLPrepare function? If it is then is this the correct place to specify
the SQLSetCursorName function? All of the return codes have been 0 (ie no
errors found).

Thanks for the help

Alex

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.