General information
Category:
Coding, syntax & commands
Title:
Problem with NUL values
Hallo all
I have a problems with NULL values in characterstrings that I hope I can explain so you understand:
I make a select from an SQL server like this: (“Select cfield1, cfield2 from mytable”,”myCursor”)
In the result I get some null values in fields that contains no data on the server.
I present the fields in a form like this: ‘Some text ’+ alltrim(myCursor.cfield1)+’ ‘+alltrim(myCursor.cfield2)
When both fields contains data, there are no problems, BUT…
If one of the fields contains a null value, nothing will be displayed in the form.
If cfield1 have a NULL value, I want this to be displayed: “Some text ”+ the contents in cfield2.
Does anyone have an idea how to manage this?
My only solutions right now is to…
1. replace all NULL values with a single space in the whole 'myCursor' before I use it.
2. replace all NULL values with a single space in the whole table on the server, and allways save new records with spaces in the fields which the user has left empty.
But I feel that its not any good solutions.
Thanks in advance
/Kjell
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only