I seem to remember that Witango had some internal logic that behaved differently depending on the data dictionary for the table as well...
so for example, all things being equal, a varchar field would end up with an empty string, while a char field would get the null value when using an insert.... Which has always meant to us that if you're doing an insert or an update, you just need to be explicit if you want there to be a null... I may have my data types mixed up, but keep that in mind if you dig deeper... On Mon, Apr 7, 2008 at 4:55 PM, Fogelson, Steve <[EMAIL PROTECTED]> wrote: > Robert, Jesse and Robert, > > Thanks for the help. > > Steve > > -----Original Message----- > From: Ben Johansen [mailto:[EMAIL PROTECTED] > Sent: Monday, April 07, 2008 4:05 PM > To: [email protected] > Subject: Re: Witango-Talk: Null in MySQL > > nope your not missing anything, > > the setting you have for default NULL is if you dont include that > column in the insert/update it will default to null > > an empty arg on an insert or update to MySQL will result in a "" and > not a NULL > > you have to specifically set NULL or change you code to not include > that field in the insert/update > > Ben > > On Apr 7, 2008, at 1:57 PM, Fogelson, Steve wrote: > > > Hi Jesse, > > > > I have these fields set as DEFAULT NULL, but with some testing with > > Witango, > > it appears like Robert said that I need to set a field specifically > > to NULL > > and not a blank string when updating or inserting in order for > > Witango to > > set it to a NULL. > > > > Unless I am missing something. > > > > Thanks > > > > Steve > > > > -----Original Message----- > > From: Jesse Parker [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 07, 2008 3:21 PM > > To: [email protected] > > Subject: RE: Witango-Talk: Null in MySQL > > > > You might want to check the column definition. A quick test > > suggests that a > > default value of NULL works as expected: > > > > mysql> create table mytest (ind int, txt varchar(20) default NULL); > > Query OK, 0 rows affected (0.00 sec) > > > > mysql> insert into mytest (ind) values (102); > > Query OK, 1 row affected (0.00 sec) > > > > mysql> select * from mytest; > > +------+------+ > > | ind | txt | > > +------+------+ > > | 102 | NULL | > > +------+------+ > > 1 row in set (0.00 sec) > > > > mysql> select * from mytest where txt is null; > > +------+------+ > > | ind | txt | > > +------+------+ > > | 102 | NULL | > > +------+------+ > > 1 row in set (0.00 sec) > > > > mysql> select * from mytest where txt = 'NULL'; > > Empty set (0.00 sec) > > > > mysql> drop table mytest; > > Query OK, 0 rows affected (0.00 sec) > > > > mysql> > > > > > > -----Original Message----- > > From: Fogelson, Steve [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 07, 2008 4:02 PM > > To: [email protected] > > Subject: RE: Witango-Talk: Null in MySQL > > > > > > So do I have to turn the "Quote Value" to FALSE for all TEXT fields > > that I > > want to be able to insert a NULL for UPDATE or INSERT actions and > > then use > > the following? > > > > <@ifempty "<@arg foo">NULL<@else><@sq><@arg foo><@sq></@if> > > > > To insert a "NULL" in a field in MySQL? > > > > Seems like a lot of extra work, but I will do it if I need to. > > > > Thanks > > > > Steve > > > > > > > > From: Robert Garcia [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 07, 2008 2:25 PM > > To: [email protected] > > Subject: Re: Witango-Talk: Null in MySQL > > > > This works in a NON Quoted field. You will have to experiment. I > > have done > > it before but don't have time to look up old code at the moment. > > > > -- > > > > Robert Garcia > > President - BigHead Technology > > VP Application Development - eventpix.com > > 13653 West Park Dr > > Magalia, Ca 95954 > > ph: 530.645.4040 x222 fax: 530.645.4040 > > [EMAIL PROTECTED] - [EMAIL PROTECTED] > > http://bighead.net/ - http://eventpix.com/ > > > > On Apr 7, 2008, at 12:21 PM, Robert Garcia wrote: > > > > > > > > Then do this in the field you are inserting data into: > > > > <@ifempty "<@arg foo">NULL<@else><@arg foo></@if> > > > > -- > > > > Robert Garcia > > President - BigHead Technology > > VP Application Development - eventpix.com > > 13653 West Park Dr > > Magalia, Ca 95954 > > ph: 530.645.4040 x222 fax: 530.645.4040 > > [EMAIL PROTECTED] - [EMAIL PROTECTED] > > http://bighead.net/ - http://eventpix.com/ > > > > On Apr 7, 2008, at 12:15 PM, Fogelson, Steve wrote: > > > > > > Hi Robert, > > > > That would be a great idea, but I only see the "Include Empty" > > option in the > > READ action. I don't see it in the WRITE or UPDATE action. I also > > see it in > > the "Select Rows Matching These Criteria" part of the UPDATE action. > > > > I only see "Quote Value" in the WRITE and UPDATE action. > > > > Maybe I am missing something. > > > > Steve > > > > > > > > > > From: Robert Garcia [mailto:[EMAIL PROTECTED] > > Sent: Monday, April 07, 2008 1:59 PM > > To: [email protected] > > Subject: Re: Witango-Talk: Null in MySQL > > > > I believe you can check to NOT INCLUDE if empty. If you put an empty > > arg in > > there, witango will write an empty string "". if the field is NOT > > included, > > it will be null. > > > > -- > > > > Robert Garcia > > President - BigHead Technology > > VP Application Development - eventpix.com > > 13653 West Park Dr > > Magalia, Ca 95954 > > ph: 530.645.4040 x222 fax: 530.645.4040 > > [EMAIL PROTECTED] - [EMAIL PROTECTED] > > http://bighead.net/ - http://eventpix.com/ > > > > On Apr 7, 2008, at 11:48 AM, Fogelson, Steve wrote: > > > > > > > > > > Hi, > > > > I am completing work adjusting an app that was originally written to > > work > > with R:Base to now work with MySQL as well. Whenever I write or > > update a > > record in R:Base, all empty text fields are written with a NULL. It > > appears > > that this is not happening in MySQL, I can set a MySQL text field to > > <@arg > > xxxxx> where <@arg xxxxx> is empty, but MySQL doesn't write a NULL > > to the > > field. > > > > Is this correct? > > > > If so, is my only option to write a \N in the field if I am using > > MySQL? > > > > Thanks in advance. > > > > Steve Fogelson > > Internet Commerce Solutions > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > ________________________________________________________________________ > > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > > ________________________________________________________________________ > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > ________________________________________________________________________ > TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf > > -- /John ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
