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



The easiest way, if you're not concerned about the values, is to use
COALESCE to replace the NULL with a value. THen you don't have to worry
about the indicator.

EXWC-SQL
DECLARE XXX CURSOR FOR
SELECT COALESCE(numeric_field_with_possible_null,0)
FROM table
WHERE whatever
ORDER BY whatever
END-EXEC

This basically says, if the numeric field is null make it zero. You don't
have to worry about declaring or testing null indicators. However, if you
want to know whether you got a null, then the code samples provided by
others will be required.

Gord Royle
Cott Corporation

-----Original Message-----
From: Hatzenbeler, Tim [mailto:thatzenbeler@clinitech.net]
Sent: Friday, October 12, 2001 5:57 PM
To: 'rpg400-l@midrange.com'
Subject: Sql Skeleton Sample...


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
I was wondering, if someone would be willing to share an rpgsql program,
that is very robust...

I'm looking for the techniques, to be able to handle null values (not change
them) but at least let the rpg continue, plus how to handle the various
error codes, that might arise..

right now, I have null's in my data data types (lovals), and the sql, cann't
handle these... So I would like the program to at least keep functioning,
and then let me handle the nulls later when it comes to displaying them...

Thanks, tim

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


Cott - The Leader in Premium Retailer Brand Beverage Innovation.




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.