View previous topic :: View next topic
|
Author |
Message |
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
Hi,
There is a table (X) and it has this column (XT) defined as timestamp.
At test environment, When I run below query then it gets executed successfully.
Update X
SET XT = '2017-12-26'
WHERE X_primary key = '123'
;
XT then updated as '2017-12-26-00.00.00.000000'.
Now issue at prod environment with same query. It gives sqlcode -180.
To avoid this error I needed to write query like below.
Update X
SET XT ='2017-12-26-00.00.00.000000' (whole timestamp format data given)
WHERE X_primary key = '123'
;
Anybody know why prod did not accept date in timestamp where as test does or why test has accepted date in place timestamp ?
[/b] |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Did you talk to DBAs yet, if not then talk to them first? Looks like you have two different DB2 versions and DB2 set up in prod and Test. |
|
Back to top |
|
|
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
Hi,
I checked DB version at both test and prod are same. I will check with DBA but just wanted to know which DB version has which settings on timestamp? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
just wanted to know which DB version has which settings on timestamp |
Why ask us? We do not work where you work. We do not know how your systems are set up. Your DBA does. Your DBA is always your first point of contact, after your colleagues. |
|
Back to top |
|
|
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
I am asking in terms of general knowledge on Db2. Are there any kind of settings on timestamp field which allows date? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You MUST ask YOUR site support about these things.
They may restrict some things, or change them across environments, giving differeing results, as you have seen and posted.
We cannot possibly know what they know |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
asking in terms of general knowledge on Db2 |
The relevant manual is probably the installation guide. Did you look there? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
I ran Update query as below, so my test result is different than what you said.
Code: |
update table a
set upd_ts = current date
where
a= 'xyz'
Before update value : 2018-12-23-12.02.10.330326
After update value : 2018-12-27-12.02.10.330326 |
I have DB2 V12R1 installed for this test. So since we can have different results in different set ups so its best you provide full 26 bytes timestamp to be at safer side always. As suggested spend time looking at manuals to find what specific set up caused different results or get that info from DBA since they know it easily, when you know share us back so others can be benefited. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello There,
Just check ZPARM BIF_COMPATIBILITY parm in both the environment. |
|
Back to top |
|
|
|