[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Using the LET functions Isnull or Nvl withCHARorVARCHAR database columns
- Subject: RE: [sqr-users] Using the LET functions Isnull or Nvl withCHARorVARCHAR database columns
- From: "Larry Roux" <LRoux@syr.edu>
- Date: Fri, 09 Jul 2004 11:12:43 -0400
- Delivery-date: Fri, 09 Jul 2004 10:13:27 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
isnull returns true or false - which SHOULD NEVER be confused with 0 or 1 (even
though most software codes it that way).
Why not just do:
if isnull(&ENTITY)
Let $line3 = '00'
else
Let $line3 = '01'
end-if
or better yet:
if &ENTITY = ''
Let $line3 = '00'
else
Let $line3 = '01'
end-if
we usually check for an empty string or null this way:
if RTRIM(&ENTITY,' ') = ''
...
end-if
Larry Roux
Syracuse University
lroux@syr.edu
>>> GinaBencke@forestcity.net 07/09/04 10:55AM >>>
The problem I was running into was not only the ISNULL function, but in
the use of EDIT(ISNULL(&ENTITY), '09). Once I made the following
changes my results were more acceptable. However I still determined
that SQR can not truly distinguish between a column containing an empty
string and one containing a NULL value. Obviously I can get around this
using the database function ISNULL instead of SQR's function so I shall
not dwell on this.
However, can anyone explain why the below sections of code produce
different output???
Originally my code which I thought was printing the appropriate ISNULL
results was as follows:
let $line3 = 'isnull(&ENTITY) expected: 01 actual: <' ||
edit(isnull(&ENTITY), '09') || '>'
print $line3 (+1,1)
Result "isnull(&ENTITY) expected: 01 actual: <00>"
After receiving 'the dragons' email I suspect the edit function was not
working as expected and changed it to:
let #null = isnull(&ENTITY)
let $line3 = 'isnull(&ENTITY) expected: 01 actual: <' ||
edit(#null, '09') || '>'
print $line3 (+1,1)
Result "isnull(&ENTITY) expected: 01 actual: <01>"
Btw - We are using some tables that are not created in PeopleSoft and
thus may contain NULL values.
Gina Bencke
Bencke Consulting Corporation
Office (440) 519-0060
email: gina.work@bencke.com
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users