Re: [dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-25 Thread Fernand Vanrie

Alex Thurgood wrote:

Is this not a bug in that version (which one, by the way) of the ODBC driver ? 
I have had this problem for a long time, and it has caused me no end of 
trouble, for example when I switched to the JDBC driver and it couldn't handle 
default -00-00 strings. It occurs on my system because I have set the 
default value of my date fields to be NULL in the create table statement. Even 
my current MySQL Query Browser client has problems with this and throws an 
error.

Alex,

I use the native connector, but you are right Date, Time and Timestamps 
are always trouble.


But  as  adviced by Peter  i  will  check for  the  datatype  in the 
Resultset, a technic who most work for all drivers ?


and be carefull to use the correct  update method and thecorrect  SQLtype .

in a prepared statement y wronly used

setString ( 1, 93) 1 is the field and 93 is the Datatype will put 
00-00-00 00:00:00 in thet datbasefield


it has to be

setNull(1,93) set the field to (null)

Greetz

Fernand


-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



Re: [dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-25 Thread Alex Thurgood
Hi Fernand,


>  oStatement.setNull(1, ) for a "textfield" works fine ( =
> long
>  SQLType "others")
>  oStatement.setNull(2, ) for a "timestamp" returns "00-00-00
>  00:00:00" and not the Mysql (null)
> 
>  i tried SQLtype 0 also with same results
> 


Is this not a bug in that version (which one, by the way) of the ODBC driver ? 
I have had this problem for a long time, and it has caused me no end of 
trouble, for example when I switched to the JDBC driver and it couldn't handle 
default -00-00 strings. It occurs on my system because I have set the 
default value of my date fields to be NULL in the create table statement. Even 
my current MySQL Query Browser client has problems with this and throws an 
error.

Alex

-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



Re: [dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-24 Thread Fernand Vanrie

Peter,

93 is the right type  at condion i use setNull and not setstring  :-)

sory for the confusion

Thanks
Fernand

Peter,

stupid me,  my rowset is client site

but the server site resultset gives also "93" as type

?

Peter ,

Thanks for the hint but no luick ,  the type in  the rowset = 93  
this gives and still  a lot of "0"'s and no (null) in my table


as i use a SQL statement  i do not alter the rowset but go over the 
active conection to the mySQL table.
when is use the rowset service to update in stead off a direct SQL 
statement then the "column.updatnull" gives a (null) in the table.
as the rowset service still gives problems i need to use 
SQLstatements to alter my tables
"behind" the OO- rowset service runs also a "SQLstatement" : question 
is wath type is there used to set the right SQLtype  ?


Thanks

Fernand

Hi Fernand,

did you query for the type of the column?

resultSet.columns.getByName("myCol").Type?



oStatement.setNull(1, ) for a "textfield" works fine ( = long
SQLType "others")
oStatement.setNull(2, ) for a "timestamp" returns "00-00-00
00:00:00" and not the Mysql (null)

i tried SQLtype 0 also with same results



Regards

Peter

-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



Re: [dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-24 Thread Fernand Vanrie

Peter,

stupid me,  my rowset is client site

but the server site resultset gives also "93" as type

?

Peter ,

Thanks for the hint but no luick ,  the type in  the rowset = 93  this 
gives and still  a lot of "0"'s and no (null) in my table


as i use a SQL statement  i do not alter the rowset but go over the 
active conection to the mySQL table.
when is use the rowset service to update in stead off a direct SQL 
statement then the "column.updatnull" gives a (null) in the table.
as the rowset service still gives problems i need to use SQLstatements 
to alter my tables
"behind" the OO- rowset service runs also a "SQLstatement" : question 
is wath type is there used to set the right SQLtype  ?


Thanks

Fernand 

Hi Fernand,

did you query for the type of the column?

resultSet.columns.getByName("myCol").Type?



oStatement.setNull(1, ) for a "textfield" works fine ( = long
SQLType "others")
oStatement.setNull(2, ) for a "timestamp" returns "00-00-00
00:00:00" and not the Mysql (null)

i tried SQLtype 0 also with same results



Regards

Peter

-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



Re: [dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-24 Thread Fernand Vanrie

Peter ,

Thanks for the hint but no luick ,  the type in  the rowset = 93  this 
gives and still  a lot of "0"'s and no (null) in my table


as i use a SQL statement  i do not alter the rowset but go over the 
active conection to the mySQL table.
when is use the rowset service to update in stead off a direct SQL 
statement then the "column.updatnull" gives a (null) in the table.
as the rowset service still gives problems i need to use SQLstatements 
to alter my tables
"behind" the OO- rowset service runs also a "SQLstatement" : question is 
wath type is there used to set the right SQLtype  ?


Thanks

Fernand  


Hi Fernand,

did you query for the type of the column?

resultSet.columns.getByName("myCol").Type?



oStatement.setNull(1, ) for a "textfield" works fine ( = long
SQLType "others")
oStatement.setNull(2, ) for a "timestamp" returns "00-00-00
00:00:00" and not the Mysql (null)

i tried SQLtype 0 also with same results



Regards

Peter

-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



Re: [dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-24 Thread Peter Eberlein

Hi Fernand,

did you query for the type of the column?

resultSet.columns.getByName("myCol").Type?



oStatement.setNull(1, ) for a "textfield" works fine ( = long
SQLType "others")
oStatement.setNull(2, ) for a "timestamp" returns "00-00-00
00:00:00" and not the Mysql (null)

i tried SQLtype 0 also with same results



Regards

Peter

-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



[dba-dev] How to set a MySQL TIMESTAMP to null

2010-06-24 Thread Fernand Vanrie

Hallo all

Windows
00 3.2.1
MySQL as dbsever
native connector
we  use a "preparedstatement" to update a mySQL table with a timestamp 
column and text columns


oStatement.setNull(1, ) for a "textfield" works fine ( = long 
SQLType "others")
oStatement.setNull(2, ) for a "timestamp" returns "00-00-00 
00:00:00" and not the Mysql (null)


i tried SQLtype 0 also with same results


Thanks for any hint

Fernand

-
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org