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



Code is as follows:


*-------------------------------------------------------------------------
* Procedure name: SQLCLI_getResultRowCount
* Purpose: Get the Result Set Row Count
* Returns: Returned Result Set Row Count
* Parameter: piConnHandle

*-------------------------------------------------------------------------
p SQLCLI_getResultRowCount...
p b export
d SQLCLI_getResultRowCount...
d pi 10i 0
d piConnHandle 10i 0

* Local definitions
d pDescHandle s * inz
d pRowCount s * inz
d vBLen s 5i 0 inz
d vDescHandle s like(SQLINTEGER) inz
d vRecNum s like(SQLSMALLINT) inz(0)
d vRowCount s 10i 0 inz
d vSLen s 5i 0 inz
d vSQLRC s 10i 0 inz
d vConnHandle s 10i 0 inz

/free

vConnHandle = piConnHandle;

pDescHandle = %addr(vDescHandle);
vSQLRC = SQL_AlcHandle(SQL_HANDLE_DESC :vConnHandle :pDescHandle);

pRowCount = %addr(vRowCount);
vBLen = %len(vRowCount);
vSQLRC = SQL_GetDescField(vDescHandle :vRecNum :SQL_DESC_COUNT
:pRowCount :vBLen :vSLen);

vSQLRC = SQL_FreeHandle(SQL_HANDLE_DESC :vDescHandle);

return vRowCount;


//----------------------------------------------------------------------
// Subprocedure error handling routine

//----------------------------------------------------------------------
begsr *pssr;
dump(a) 'SubProc(SQLCLI_getResultRowCount)';
vRowCount = -1;
return vRowCount;
endsr;

/end-free
p SQLCLI_getResultRowCount...
p e



On Fri, May 29, 2015 at 2:14 PM, Mike Garrison <
ibmisoftwareengineer@xxxxxxxxx> wrote:

Michael Ryan,

Text from my reply yesterday should be "and it was NOT providing what I
needed.".

I did add code today to use SQLAllocHandle and SQLGetDescField and I
apparently do not have it right yet as vSQLRC returns a -2 on the
SQLGetDescField.

vSQLRC = 0 after SQLAllocHandle call but vDescHandle is 0 as well.

Any thoughts or guidance?


On Thu, May 28, 2015 at 4:14 PM, Mike Garrison <
ibmisoftwareengineer@xxxxxxxxx> wrote:

I will give that a try tomorrow and report back. I had been using
SQLGetDiagField and it was providing what I needed.

The quick reply is much appreciated.

On Thu, May 28, 2015 at 4:02 PM, Michael Ryan <michaelrtr@xxxxxxxxx>
wrote:

Check out Get Descriptor...that's how I do it.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.