Way back when I first started my database in R:Base one of _my_ first rules was don't have any nulls under any circumstances whatsoever!
It's been a good rule but, of course, I don't keep to it 100% N/A for text, -1, 0 or 9999 for integers has served me well over all these years. In my experience, if you find you need a lot of nulls then you probably need a separate table. It's easy to convert your favourite representation into a meaningful comment in forms and reports: (IFEQ(Field, 9999, '(Unknown)', (CTXT(Field)) )). A bit more thinking might be needed for exporting but it's easy enough to get R:base to do what you want or to convert in the receiving program - although R:Base is (usually) easier. To really stick my head above the parapet I have never understood how anything can be null - if a value is not known then show that it is not known. To not know whether it is known or not known seems to me to be a failure -but take note of my second paragraph above! Regards, Alastair. ----- Original Message ----- From: Dennis McGrath To: RBASE-L Mailing List Sent: Monday, March 31, 2008 7:10 PM Subject: [RBASE-L] - Re: How do I make NULL truly NULL? Matt, Have you tried exporting as ASCII when NULL = ' ' (a space) Try it and look at the generated file. There will be no spaces between the commas for a NULL value. This is exactly what you need. Here are my rules for the use of the NULL setting: ALWAYS have NULL='-0-' EXCEPT: When exporting data as ASCII, CSV, etc. When editing with a form When printing a report If you do not have NULL='-0-' and you edit tables manually, you will never get a null entered in text fields. Try as you might, the value will always be a space. The exact opposite is true in forms. If null='-0-' not only will your forms look ugly, but you won't know the difference between NULL and '-0-' When Unloading data and structure from RBASE, ALWAYS set NULL='-0-' RBASE has worked like this as long as I can remember. Dennis McGrath ------------------------------------------------------------------------------ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Matthew Burke Sent: Monday, March 31, 2008 12:46 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: How do I make NULL truly NULL? Well here's my problem with how it seems to work. I understand the need to visually separate null from a blank space within R:Base. So sure, when I open a table within R:Base show me some kind of value, -0- will do just fine. However when I export data from my table to say... and basic csv text file. That data should not be represented by a -0-, but nothing at all, in my opinion. That way if I want to use the data in another database, or as in this case a third party wants to use it in another database, they can do so without the other database having to understand that -0- = null. I thought about setting NULL = ' ' but even that wouldn't work, because even then the third party database would still have to know that null = ' '. I'm certainly no database guru and I really appreciate all the help I receive from you guys and gals. My only other database experience lies with MySQL and it's always been my understanding that null = nothing at all. So I guess ultimately I don't really need to know why R:Base uses text representation for null, but I need to know if there is a solution I can use to make null = nothing at all or empty. Basically if 'empty' was or possibly is a valid command, the logic I want to accomplish is R> set null empty. Is this possible? To further explain what I want, here's an example. Let's say we have a table with one row containing three fields of data; a, b, and c. Field b is null in this case. Something like this. a b c 1 text -0- text As my R:Base is setup now, if I were to export this data to a text file (csv) I get: "text","-0- ","text" The end result text file (csv) I want to achieve is: "text","","text" Thanks again for all your help with my novice problems/questions. Matthew Burke Pioneer Bank - IT Department Computer Systems Technician 505-627-4415 This email contains PRIVILEGED AND CONFIDENTIAL information intended only for the use of the addressee(s) named above. If you are not the intended recipient of this email, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination or copying of this email is strictly prohibited. If you have received this email in error, please notify us by replying to this email and delete this email from your records. Thank you for your cooperation. ------------------------------------------------------------------------------ No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.1/1350 - Release Date: 30/03/2008 12:32

