The Correct way to check for NULLs in SAP Business One Transactions Notifications
- August 8, 2024
- Posted by: admin
- Categories:
No Comments
What is the diference between the following two statements? Which one is better? option 1 or option 2?
- WHERE IFNULL(T1.”U_CNote”, ‘ ‘) = ‘ ‘ and T0.”DocEntry” = :list_of_cols_val_tab_del and …
- WHERE T1.”U_CNote” IS NULL and T0.”DocEntry” = :list_of_cols_val_tab_delĀ andĀ …
Option 1 is safer because it checks for white spaces i.e. if a user types the space key instead of a letter, in Option 1 SQL will still read this as a null but in Option 2, SQL willl not see this as a null, yet in essence it is.