Le message est le suivant ... pas vraiment original mais
plutôt ultra-classique !
@ERROR = -180 ERROR : [IBM][CLI Driver][DB2] SQL0180N The
syntax of the string representation of a datetime value is incorrect.
SQLSTATE=22007
J'ai tracé la requête et récupéré la valeur du timestamp
=> 2004-05-12-19.20.49.642284
Sur mon poste de developpement j'ai passé la requête avec succés
en attaquant une base de production
Sur le serveur de production, je ne dispose pas de fenêtre ma
permettant de lancer une requête ... et avec le programme (Natstar) en utilisant ce même formatage (et en traçant) je provoque l'erreur (-180) ci dessus !
Question : Comment sur une base DB2 s'assurer du
format date/time (timestamp) en cours de validité sur un poste donné ?
J'ai trouvé ça, mais je voudrais avoir votre avis
ou vos remarques
SELECT current timestamp FROM sysibm.sysdummy1
That is, the format is MM/DD/YYYY. If you want to change the format, you can bind the collection of db2 utility packages to use a different date format. The formats supported are:
DEF Use a date and time format associated with the territory code.
EUR Use the IBM standard for Europe date and time format.
ISO Use the date and time format of the International Standards Organization.
JIS Use the date and time format of the Japanese Industrial Standard.
LOC Use the date and time format in local form associated with the territory code of the database.
USA Use the IBM standard for U.S. date and time format.
To change the default format to ISO on windows (YYYY-MM-DD), do the following steps:
On the command line, change your current directory to sqllib\bnd.
For example:
On Windows: c:\program files\IBM\sqllib\bnd
Connect to the database from the operating system shell as a user with SYSADM authority:
db2 connect to DBNAME
db2 bind @db2ubind.lst datetime ISO blocking all grant public
Partager