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



In SQL, how can I detect a NULL returned by a function like DATE() or
DEC()?

This is my statement:

select storagedt, ifnull(dec(date(storagedt)), 0) as "as Decimal" from
mytable

storagedt is a VARCHAR(64)

here is the result in SQuirreL Client:

STORAGEDT as Decimal
-------------------------------------------------------------------
1993-12-02 19,931,202
RK <null>
RK <null>
RK <null>
RK <null>
CS <null>
CS <null>
RK <null>
1994-05-11 19,940,511
RK - IC <null>
1994-01-26 19,940,126

Apparently an invalid date does not return a real null, but how can I
detect that? I know that iDate is available, but I don't really have
install authority on IBM i.

Run SQL Statements in iACS shows a -- instead of <null>, and STRSQL
displays +++++++++++++++.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.