Re: empty strings vs nulls

2003-11-24 Thread R. Joseph Newton
Rob Dixon wrote: > Beware, though, that you may also want to test > for all-spaces in a field. Also some databases > disallow zero-length string fields. > > HTH, > > Rob I don't know about that. Usually I see this constraint as an option applied to required fields when they are needed to maintai

Re: empty strings vs nulls

2003-11-24 Thread Rob Dixon
Kevin Old wrote: > > On Mon, 2003-11-24 at 13:30, Eric Walker wrote: > > How can I test for empty strings and nulls on a particular value. When > > I get an empty string or a null value I need to do something. > > Hi Eric, > > To test for a empty string simply do the following: > > if ($mystring

Re: empty strings vs nulls

2003-11-24 Thread Douglas Lentz
Eric Walker wrote: How can I test for empty strings and nulls on a particular value. When I get an empty string or a null value I need to do something. Thanks in Advance. BassFool # from a unix shell, # empty string perl -e '$s = "";unless ($s) {print "Empty string\n";}' # null value per

Re: empty strings vs nulls

2003-11-24 Thread Kevin Old
On Mon, 2003-11-24 at 13:30, Eric Walker wrote: > How can I test for empty strings and nulls on a particular value. When > I get an empty string or a null value I need to do something. Hi Eric, To test for a empty string simply do the following: if ($mystring eq "") { #string is empty

Re: empty strings vs nulls

2003-11-24 Thread Rob Dixon
Eric Walker wrote: > > How can I test for empty strings and nulls on a particular value. When > I get an empty string or a null value I need to do something. Hi Eric. I assume you're using the DBI module? In general, a null value will be passed back as Perl 'undef' and an empty string as, well

empty strings vs nulls

2003-11-24 Thread Eric Walker
How can I test for empty strings and nulls on a particular value. When I get an empty string or a null value I need to do something. Thanks in Advance. BassFool