Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with NUL values
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Problem with NUL values
Miscellaneous
Thread ID:
00641273
Message ID:
00641273
Views:
48
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
Map
View

Click here to load this message in the networking platform