If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Indicator values in SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-05-04, 06:05
BSP BSP is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
Indicator values in SQL

Hi,
I have a query on Indicator fields in DB2.
I am aware that the valid values for Indicator fields are -2,-1,0. But I was told that the indicator fields have values other than these too.
So I was asked to code IndField >=0 instead of IndField =0 when the SQL returns proper values.

Does anyone have any info on this to share.
Reply With Quote
  #2 (permalink)  
Old 04-06-04, 03:17
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
Your approach is correct. You don't care which values are in the indicator variables. If it's greater or equal zero (>=0), DB2 sent you a value. If it's less than zero (<0), DB2 doesn't has a value for the column (it's null).

HTH,
__________________
Rodney Krick
Reply With Quote
  #3 (permalink)  
Old 04-06-04, 13:55
BSP BSP is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
Quote:
Originally posted by RKrick
Your approach is correct. You don't care which values are in the indicator variables. If it's greater or equal zero (>=0), DB2 sent you a value. If it's less than zero (<0), DB2 doesn't has a value for the column (it's null).

HTH,
Thank you for your reply. I was just wondering what is the need to give ' > ', when I am sure it would be equal to zero. Is any any positive value for the indicator??
Reply With Quote
  #4 (permalink)  
Old 04-07-04, 02:09
RKrick RKrick is offline
Registered User
 
Join Date: Feb 2002
Location: Germany
Posts: 141
AFAIK, no. The only I've ever seen are -1, -2 and 0. But I will keep checking for <0 to find null values.
__________________
Rodney Krick
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On