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



Henrik

SQL itself has no problem with nulls - you use the "is null" predicate - easy. Embedded SQL in HLLs does present more problems, I suppose.

Vern

hr@xxxxxxxxxxxx wrote:
Well, lets take a survey on the web - a question where you have 3 choises in a combobox:

- Not answered (returns a "-")
- yes (returns a "0")
- no (returns a "1")

you have to do some kind of special code to convert the combobox
values into a *null - back and forth - so what is it worth ?

/Henrik



"John Arnold (MFS)" <jarnold@xxxxxxxxxxxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
14-04-2010 20:29
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: AW: SQL null indicators when not all columns are null capable






In our application, a null value identifies a survey question that was not answered. We do not want to default to true or false when no answer was given.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of hr@xxxxxxxxxxxx
Sent: Wednesday, April 14, 2010 2:32 PM
To: RPG programming on the IBM i / System i
Subject: Re: AW: SQL null indicators when not all columns are null capable

Just following this discussion from the sideline, can anybody give me a reason to use a *NULL capable field in a commercial database ?

It seems to me that it only makes trouble !

/henrik




"Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
14-04-2010 19:33
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
"'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
AW: SQL null indicators when not all columns are null capable






Alan means, instead of specifying an array in the IND_ARRAY data structure
you should specify each indicator.
D IND_ARRAY D Occurs(10)
D IND01 5I 0
D IND02 5I 0
...

Good luck! The last time I tried it, it didn't work either.
(But perhaps meanwhile a PTF was sent out).
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 Rick.Chevalier@xxxxxxxxxxxxxxx
Gesendet: Wednesday, 14. April 2010 19:11
An: rpg400-l@xxxxxxxxxxxx
Betreff: RE: SQL null indicators when not all columns are null capable

Alan,

Would you be more specific please? Can't do what? The code was based on an
example right out of the SQL Programming link on the V5R4 InfoCenter site.
Specifically, Database-> Programming->Embedded SQL programming->Coding SQL
statements in ILE RPG applications->Using host structure arrays in ILE RPG
applications that use SQL.

>From the web site:
The following example uses a host structure array called DEPARTMENT and a
blocked FETCH statement to retrieve 10 rows from the DEPARTMENT table.

DDEPARTMENT DS OCCURS(10)
D DEPTNO 01 03A
D DEPTNM 04 32A
D MGRNO 33 38A
D ADMRD 39 41A

DIND_ARRAY DS OCCURS(10)
D INDS 4B 0 DIM(4)
...
C/EXEC SQL
C+ DECLARE C1 CURSOR FOR
C+ SELECT *
C+ FROM CORPDATA.DEPARTMENT
C/END-EXEC
...

C/EXEC SQL
C+ FETCH C1 FOR 10 ROWS
C+ INTO :DEPARTMENT:IND_ARRAY
C/END-EXEC

Rick

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Alan Campin
Sent: Wednesday, April 14, 2010 11:28 AM
To: RPG programming on the IBM i / System i
Subject: Re: SQL null indicators when not all columns are null capable

The manual specifically states you cannot do this. I talked with IBM and
they pointed this out. What you have in effect is a two-dimensional array
which SQL does not support.


Privileged and Confidential. This e-mail, and any attachments there to, is
intended only for use by the addressee(s) named herein and may contain
privileged or confidential information. If you have received this e-mail in
error, please notify me immediately by a return e-mail and delete this
e-mail. You are hereby notified that any dissemination, distribution or
copying of this e-mail and/or any attachments thereto, is strictly
prohibited.

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.