#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    New Jersey, U.S.A.
    Posts
    40
    Rep Power
    11

    Smile any function like ISNULL in FireBird?


    Hello all,

    I am building an asp.net web server application with FireBird 1.5 and wonder if there is any pre-defined function in FireBird just like ISNULL in MS SQL2000?

    Thank you.
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
    maybe this link can help:
    Code:
    This function will return either absolute value, or -1 if the argument was NULL (or not a valid integer). 
    function TEST_Abs (val: PChar): integer; stdcall;
    begin
      try
        Result := Abs( StrToInt(val) );
      except
        Result := -1;
      end;
    end;
    
    
    DECLARE EXTERNAL FUNCTION TEST_ABS
      CSTRING(20)
      RETURNS INTEGER BY VALUE
      ENTRY_POINT 'TEST_Abs' MODULE_NAME 'UDF_Examples';
    
    
    SELECT I, TEST_Abs(I) FROM TAB;
    
           I TEST_ABS
    ======== ========
           5        5
          -5        5
           0        0
             -1
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    250
    Rep Power
    14
    Use the SQL standard COALESCE function in Firebird 1.5. Check the Release Notes for details.
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    New Jersey, U.S.A.
    Posts
    40
    Rep Power
    11

    Wink Great!


    Thank you all!

IMN logo majestic logo threadwatch logo seochat tools logo