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



Hi Scott,
Thanks for the example.
I have not had a chance to try it out yet, but after reviewing your code, I 
have a question.
When binding the first column, you use the following value for the field size:
 %len(Row(1).Cust)*256 + %decpos(Row(1).Cust)
Why are you multiplying by 256?
Why do you use %Len rather than %Size as in column 2?
%size(Row.Name)
 
Also, have you tried to use dynamic binding of a selection parameter with a 
character field?
Ex. SQL_Stmt = Select Cust,Name,City from Custfl where Name = ?
.
.   setup connection and statement
.
Parm = '''JEFF'''
rc = SQLBindParm 
.
.
.  appropiate values
.
Parm
 
When I tried it, the return code was 0 indicating no error, but the fetch did 
not return any values.
When I embedded the value in the SQL statement, I was able to retreive the data 
I wanted.
 
 

Thanks,
 
Jeff Young
 

 
----- Original Message ----
From: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
Cc: jyoung@xxxxxxxxx
Sent: Tuesday, July 25, 2006 2:48:19 PM
Subject: Re: SQL CLI problem


Hi Jeff,

I just remembered that you asked for a copy of my SQL CLI program to 
retrieve multiple records into an array. (Sorry, it slipped my mind until 
now.)

Since there are a few different members, I stuck it in a ZIP file. You can 
download it from the following link:
http://www.scottklement.com/rpg/SqlCliArray.zip

---
Scott Klement  http://www.scottklement.com

On Fri, 21 Jul 2006, Jeff Young wrote:

Scott,
Yes, please send me a copy of the working program.
I have my result colums defined in a MODS.
Regarding the bytes returned on the SQLBindCol,  I am not sure how to define 
it.  The prototype calls for a data type SQLINTEGER.
I tried to define it as a sub field in a MODS, but am still getting the Error 
Type 10 on the SQLExtendedFetch.

Please send the link for the source, or an attachment to my direct email 
address at jyoung@xxxxxxxxxx

Thanks again for all the help.

Jeff Young


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.