Hi,
I am using a SQL Query like the following:
Dim Value as String
Value = LoadSQL.ExecQuerySingleResult("SELECT Surname FROM users WHERE ClientName='John'")
log(Value)
In my database the table 'users' has the ClientName Set to 'John' and the Surname set to 'Smith'.
In my example above the 'Value' should log 'Smith', which it does.
However lets say the ClientName is set to 'Bill' and that doesn't exist in the database it seems to return 'null' since
Is there a way to make 'value' log something like 'no user in database' instead ?
The only way I see doing this is having something like:
If Value = "null" then Value = "No such user"
Or, What I should be looking for is something like this SQL Query:
SELECT Surname FROM users WHERE ClientName='john' IF clientName NOT IN users THEN Surname='Not in database'