× 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 Paul,

It seems to me to be a bug in the SQL precompiler.

I just tried it out our system with release V5R4 (and current PTF level).
If a date field is specified in either an array data structure or a MODS
that is used in a multiple row fetch, the compilation fails and SQL5011 is
returned.
If a date field is specified in a simple data structure, that is used in a
single row fetch the program will be compiled.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Paul Tuohy
Gesendet: Saturday, January 19, 2008 13:14
An: 'RPG programming on the AS400 / iSeries'
Betreff: Embedded SQL date in DS array problem


Hi All,



I am having a problem with date defined fields in a DS. In this example the
column NEWSDATE is defined (using DDL) as a date field. When I compile the
program below I get the message "SQL5011 30 22 Position 54 Host
structure array MYDS not defined or not usable."



Both date fields are *ISO.



If I get rid of the date field, all works fine.



If I define MyDate as character and use CHAR(NewsDate), all is fine.



I am at V5R3 - any idea what is going on?






D MyDS Ds Qualified

D Dim(10)

D MyDate d

D DaySeq 5 0



/Free

Exec SQL

Set Option Naming = *SYS,

DatFmt = *ISO;



Exec SQL

Declare C1 Cursor For

Select NewsDate, DaySeq from NewsItem

Where DaySeq = 5

for read only;



Exec SQL

Open C1;



Exec SQL

Fetch C1 for 10 rows into :MyDs ;



Exec SQL

Close C1;

*InLR = *On;

/End-Free



Regards



Paul Tuohy

ComCon

<http://www.comconadvisor.com> www.comconadvisor.com

<http://www.systemideveloper.com> www.systemideveloper.com






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.