| Mailing List | | Home | | MySQL General - General MySQL discussion | | MaxDB - Everything about MaxDB, formerly known as SAP DB | | MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP | | MySQL++ - Programming with the C++ API to MySQL | | ODBC - ODBC with the MySQL Connector/ODBC driver | | Java Help - Mostly related to the MySQL Connector/J driver | | Perl - Perl support for MySQL with DBI and DBD::mysql | | GUI - MySQL GUI Tools | | Announcement |
|
|
  | |  | DATE-formats in kern sent by ODBC ( was: odbc driver | DATE-formats in kern sent by ODBC ( was: odbc driver 2004-05-11 - By Zabach, Elke
Back Tom.Zschockelt@(protected) wrote > > Hi, thanks for this answer, > > but how can I process a SQL_C_DATE type within a single sql-statement > > e.g. > > INSERT INTO testtable VALUES ( 1, '01.01.2004') > > If I exec this statement I get the following error : > > Datetime field overflow;-3048 POS(35) Invalid date format:ISO. > insert into testdatum values (1, '12.12.2004') >
As ISO is the default-date_time_format for ODBC, the server knows that every string_literal (as your '01.01.2004') has to be written in ISO. Every output is sent to ODBC using format ISO.
The format which can be used when using variables/parameters of ODBC-datatypes is a different topic. But if you want to use these in an sql-statement, you have to set the variable (in your example let us name it startdate to '01.01 .2004') and then use this variable in the sql-statement like this: INSERT INTO testtable VALUES ( 1, :startdate )
Then ODBC has to handle the startdate-value to the format usually used by ODBC and known by the server.
Elke SAP Labs Berlin
> Best regards > > tom > > > > > > > "Koetter, Thomas Theodor" <thomas.theodor.koetter@(protected)> > 11.05.2004 09:39 > > > An: "'Tom.Zschockelt@(protected)'" > <Tom.Zschockelt@(protected)>, > maxdb@(protected) > Kopie: > Thema: RE: odbc driver > > > Hi Tom > > > -- --Original Message-- -- > > From: Tom.Zschockelt@(protected) [mailto:Tom.Zschockelt@(protected)] > > Sent: Dienstag, 11. Mai 2004 07:14 > > To: maxdb@(protected) > > Subject: odbc driver > > > > > > Hi, > > > > are there any plans to modify the odbc-driver to allow other > > date-formats > > than ISO-Date ? > > With ODBC you can process any time, date, timestamp format if you > use the appropriated data types like > > SQL_C_TYPE_TIME > SQL_C_TYPE_DATE > SQL_C_TYPE_TIMESTAMP > > cmp. the ODBC Programmer's Reference, Appendix D: C Data Types. > Online accessible at www.microsoft.com > > If you mean the conversion from e.g. date to character, cmp. > Appendix D: Converting Data from C to SQL Data Types, C to SQL: Date > > Excert: > > When date C data is converted to character SQL data, > the resulting character data is in the "yyyy-mm-dd" format. > > > HTH Thomas > > > -- ---- ---- ---- ---- ---- ---- ---- ---- --- > Dr. Thomas Kötter > SAP AG, SAP Labs Berlin > > > Do you know SAP^H^H^H MaxDB ? www.sapdb.org > > > > > >
-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=mysql@(protected)
|
|
 |