Posted: Mon Dec 19, 2005 12:47 pm Post subject: TIMESTAMP Format on SQL/Server DB
Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
I had a nice working message flow that logged timestamps to a DB2 Database. Now the customer decided they don't want to use DB2 any more but SQL/Server.
I moved the audit table from DB2 to SQL/Server. I kept the Primary Key to the table (the timestamp field) as a TIMESTAMP data type.
When I run the message flow, I get errors that relate to the TIMESTAMP field.
The SQLSTATE is 07006
The SQL Error Text is "ODBC SQL Server Driver] Restricted Data Type attribute violation.
I would like to know how I can insert a valid timestamp from the MEssage flow into the SQLServer Timestamp datatype.
I have tried a number of things. I even suggested to the customer that the datatype was changed to DATETIME (which is easy to code in ESQL) but they won't budge.
Any suggestions most welcome. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
Quote:
I would like to know how I can insert a valid timestamp from the MEssage flow into the SQLServer Timestamp datatype.
It is my understanding that SQLServer does not have a TIMESTAMP datatype.
SQLServer has DATETIME and SMALLDATETIME datatypes.
Refer to the WBIMB v5 help topic "ak05730_" for further information on mapping WBIMB v5 ESQL datatypes and database dataypes. _________________ Regards, Ian
Posted: Thu Dec 29, 2005 5:30 am Post subject: Thanks
Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
Ian,
Thanks for the pointer. We have changed the way in which the DB access to SQL server is being done to remove any conflict in this area.
The TIMESTAMP variable type does map directly to the SQL/Server DATETIME type if we do the insert directly rather than via passthru. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum