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



FWiW: On v5r3 at least, there was [and still is for me] an issue whereby a DS declared with a variable of the D [date] data type would encounter the error msg SQL5011 for the FETCH of the equivalent column of the DATE data-type, regardless that the RPG H-spec DATFMT() and the SQL SET OPTION DATFMT both had specified _consistent_ Date Format attributes. One circumvention was to declare the subfield as a character field long enough to hold the date string of the specified format. Another circumvention was to specify the SQL DATFMT() also, and thus redundantly, on the CRTSQLRPGI request. And yet another circumvention was to use an external format to define the Data Structure for the host structure array; but of course, given consistent date formats, for which an SQL TABLE only allows DATFMT(*ISO), but a DDS PF allows others.

Regards, Chuck

On 01-Nov 13:32 , Anderson, Kurt wrote:
Does the file MblSesP contain a date or time format field? I think
I've had issues with inserting a date/time field from SQL into a
host variable date/time field. It's pretty rare that I use embedded
SQL to pull an entire file's record into the program so I haven't
really dealt with this scenario specifically.

Michael Ryan on Wednesday, October 30, 2013 12:03 PM wrote:

Still can't get that external data structure to work.
Now I'm trying this:

D WkMblSesP E DS Dim(1000)
D Qualified
D ExtName(MBLSESP)

Exec SQL
Declare C1 Cursor For
Select * From MblSesp
Where Session_End is null;

Exec SQL
Fetch C1 For 1000 Rows
Into :WkMblSesP;
SQL5011: Position 20 Host structure array WKMBLSESP not defined or not usable.

I'm thinking that Fetch and external data structures don't work
together.

On Wed, Oct 30, 2013 at 12:55 PM, Birgitta Hauser wrote:

But even an array data structure cannot be used in composition
with an SELECT INTO!
You need a cursor. Within a cursor you can do a multiple row
fetch:

D MyArrDS DS Dim(100)
D Fld1 10A
D Fld2 10I 0

/Free
Exec SQL Declare CsrC01 Cursor For
SELECT ....;

Exec SQL Open CsrC01;

Exec SQL Fetch From CsrC01For 100 Rows into :MyArrDS;


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.