amorosik Expert Licensed User Longtime User Apr 3, 2023 #1 It often happens to read lines from a db where some fields are null Attempting to add a row to a FlexGrid when a field is null invalidates the entire row insert operation The question is: how to read db fields whose content is null without creating problems for subsequent instructions? Is the only way the classic comparison via IF or are there any tricks to protect the reading of db fields and prevent a Null from being returned?
It often happens to read lines from a db where some fields are null Attempting to add a row to a FlexGrid when a field is null invalidates the entire row insert operation The question is: how to read db fields whose content is null without creating problems for subsequent instructions? Is the only way the classic comparison via IF or are there any tricks to protect the reading of db fields and prevent a Null from being returned?
Andrew (Digitwell) Well-Known Member Licensed User Longtime User Apr 3, 2023 #2 One option is to define the database with default values so that the returns are never null. Upvote 0
amorosik Expert Licensed User Longtime User Apr 3, 2023 #3 Andrew (Digitwell) said: One option is to define the database with default values so that the returns are never null. Click to expand... Yes, of course But in some cases the db is not under your diret control, and you have to read 'other peoples data' In this case you have no control over what is entered, it is only possible to protect the db read Upvote 0
Andrew (Digitwell) said: One option is to define the database with default values so that the returns are never null. Click to expand... Yes, of course But in some cases the db is not under your diret control, and you have to read 'other peoples data' In this case you have no control over what is entered, it is only possible to protect the db read
LucaMs Expert Licensed User Longtime User Apr 3, 2023 #4 Use the IfNull (sql) function (search for it ? ) Upvote 1 Solution
brent judith New Member Apr 3, 2023 #5 use IS NULL or IS NOT NULL instead of comparison operator. Upvote 0