K krzyszp Member Licensed User Longtime User Dec 1, 2013 #1 Hello, I have silly problem... I have created query to database and sometimes one or more fields return "NULL" and I get exception for this... How I can catch nulls in recordset and go to next command without stopping app?
Hello, I have silly problem... I have created query to database and sometimes one or more fields return "NULL" and I get exception for this... How I can catch nulls in recordset and go to next command without stopping app?
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2013 #2 Can you post the code that fails? Upvote 0
K krzyszp Member Licensed User Longtime User Dec 2, 2013 #3 B4X: lblJobRef.text = m.Get("JobRef") In this case record "JobRef" returns NULL (sometimes, sometimes not - depend of number of factors). Upvote 0
B4X: lblJobRef.text = m.Get("JobRef") In this case record "JobRef" returns NULL (sometimes, sometimes not - depend of number of factors).
Erel B4X founder Staff member Licensed User Longtime User Dec 2, 2013 #4 You can use the ifnull command to convert the null value to an empty string (or to any other value): B4X: "SELECT ifnull(JobRef, ''), ... FROM ..." Upvote 0
You can use the ifnull command to convert the null value to an empty string (or to any other value): B4X: "SELECT ifnull(JobRef, ''), ... FROM ..."