PDA

View Full Version : Don't show Null


ABC123

Henkie
03-29-2008, 10:20 AM
My MySql database has default Null for new rows. In my Alphaform I want empty fields shown as empty fields, not wit 'Null' in it. Can I do this in Alpha5 or do I need to change in in the database itself?

Henk

Selwyn Rabins
03-29-2008, 02:42 PM
My MySql database has default Null for new rows. In my Alphaform I want empty fields shown as empty fields, not wit 'Null' in it. Can I do this in Alpha5 or do I need to change in in the database itself?

Henk


I will have to check with one of the developers on Monday. I suspect that you can't do it.

However, it is a good idea and we will add it for an upcomming patch.

NoeticCC
03-29-2008, 02:54 PM
I will have to check with one of the developers on Monday. I suspect that you can't do it.

However, it is a good idea and we will add it for an upcomming patch.

Nice one, although it might be useful to include as a formatting option rather than default behaviour, e.g. A 'null value' option, plus then when saving data, something like the 'empty string is null' option in Powerbuilder might be required.

Selwyn Rabins
03-29-2008, 08:09 PM
I will have to check with one of the developers on Monday. I suspect that you can't do it.

However, it is a good idea and we will add it for an upcomming patch.

turns out it can be done, but there is no user interface. so you will have to use notepad.

1. there is a file with a .dbp extension that has the same name as your active link table. e.g. if the active link is called 'customers.dbf', then there will be a file called 'customers.dbp'.

2. edit the .dbp file. you will see a property called dbf.rowdef
it will look something like this:

Cid,C,5,0,"nullable,updateable,setnull,shownull"
COMPANYNAME,C,40,0,"notnullable,updateable,initialize"
Name,C,30,0,"nullable,updateable,setnull,shownull"
CONTACTTITLE,C,30,0,"nullable,updateable,setnull,shownull"
ADDRESS,C,60,0,"nullable,updateable,setnull,shownull"
CITY,C,15,0,"nullable,updateable,setnull,shownull"
State_Region,C,15,0,"nullable,updateable,setnull,shownull"
POSTALCODE,C,10,0,"nullable,updateable,setnull,shownull"
COUNTRY,C,15,0,"nullable,updateable,setnull,shownull"
PHONE,C,24,0,"nullable,updateable,setnull,shownull"
FAX,C,24,0,"nullable,updateable,setnull,shownull"

3. edit out the 'shownull' directive in each of the columns that you don't want to show "(Null)".

4. save the .dbp file.

NoeticCC
03-29-2008, 08:50 PM
2. edit the .dbp file. you will see a property called dbf.rowdef
it will look something like this:

Cid,C,5,0,"nullable,updateable,setnull,shownull"
COMPANYNAME,C,40,0,"notnullable,updateable,initialize"
Name,C,30,0,"nullable,updateable,setnull,shownull"
CONTACTTITLE,C,30,0,"nullable,updateable,setnull,shownull"
ADDRESS,C,60,0,"nullable,updateable,setnull,shownull"
CITY,C,15,0,"nullable,updateable,setnull,shownull"
State_Region,C,15,0,"nullable,updateable,setnull,shownull"
POSTALCODE,C,10,0,"nullable,updateable,setnull,shownull"
COUNTRY,C,15,0,"nullable,updateable,setnull,shownull"
PHONE,C,24,0,"nullable,updateable,setnull,shownull"
FAX,C,24,0,"nullable,updateable,setnull,shownull"

3. edit out the 'shownull' directive in each of the columns that you don't want to show "(Null)".

4. save the .dbp file.
Thanks for that, this'll be very handy for some of our forms etc! :)

Henkie
03-30-2008, 08:33 AM
Thanks a lot Selwyn! Still would be nice for any future release to have this as a formatting option, but my problem is solved.

ninomcd
08-07-2008, 10:29 PM
Thanks a lot Selwyn! Still would be nice for any future release to have this as a formatting option, but my problem is solved.

What is the best option when one has data that is equal to 0 and data that is blank or null in a field? The system is showing either zero for both or blank for both of the fields based on the pre-defined display formatting options that are available for %(percentages).