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: witango-talk@witango.com
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: witango-talk@witango.com
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: witango-talk@witango.com
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: witango-talk@witango.com
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

Reply via email to