Date data types and NULL or ZERO

fernando.olmos at hpa.com.au fernando.olmos at hpa.com.au
Tue Oct 4 18:29:53 CDT 2005


Hi guys, 

A work colleague of mine is having problems with SQL cursors. She is
using a simple SELECT but with a WHERE clause saying DATE_PROCESS is
NULL. Her query does not return anything.

The database is Oracle. I was wondering how would one interrogate Oracle
databases using PH CURSORS, where you want to check a date column that
is blank?

She tried DATE_PROCESS = 0 but the parser rejects this as an invalid
logical construct. We want to check for ZERO but it looks like we may
need to convert the 0 (CAST it) to a date type and not (I assume) a
native INTEGER type. Of course if she uses DATE_CONVERT IS NULL the
parser accepts this, but we know none of the rows have an actual NULL
value.

In PL/SQL, we physically removed a date value from the column and then
used QUIZ to see if it stored the "empty" field as a NULL. We found out
using a "DEFINE a = 1 if DATE_PROCESSED is NULL else 0" came back 0 and
not 1.

Cheers 

Fernando Olmos 
M.I.S. 

HPA
Direct:  03 9217 5411
Mobile: 0410 382 857
Fax:     03 9217 5716 

 <file:///H:/Appdata/Microsoft/Signatures/www.hpa.com.au> www.hpa.com.au



**********************************************************************
IMPORTANT
The contents of this e-mail and its attachments are confidential and intended
solely for the use of the individual or entity to whom they are addressed.  If
you received this e-mail in error, please notify the HPA Postmaster, postmaster at hpa.com.au,
then delete  the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For more
information about use, disclosure and access see our Privacy Policy at
www.hpa.com.au
**********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20051005/c98faa73/attachment.html


More information about the powerh-l mailing list