Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Unanswered: 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.

  2. #2
    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

  3. #3
    Join Date
    Apr 2004
    Posts
    2
    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??

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •