Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update problem

Status
Not open for further replies.

hnkadmn

MIS
Sep 22, 2003
13
US
Hi

I have a problem in update, getting SQLcode -104

UPDATE D1.T_A A
SET TIME(A.T) = (SELECT B.T FROM
D1.T_H B WHERE
A.ID = B.ID AND
A.TMST = B.TMST)

A.T col is timestamp and it have current timestamp value.
B.T col is TIME, I want to update the time value in A.T Timestamp with the time in B.T

Please guide me how to do this.

Hari
 
TIME(A.T) is invalid ... AFAIK, The Left Hand Side Operand of a SET should be a column and not a function ...

Something similar may be a solution

update D1.T_A A a set a.t=(select char(date(a.t))||'-'||char(b.t) from D1.T_H b where A.ID = B.ID AND
A.TMST = B.TMST)

Cheers
Sathyaram

More DB2 questions answered at
 
Thank you very much.

Actually data type of A.T is timestamp and
data type of B.T is time, so I want to update the HH.MM.TT in A.T with the Time value in B.T.
You advised that function cannot work in update.

thank you for ur suggestion.

hari
 
I am not sure of it, but think it is V7.0.

Is it possible to find version details using an SQL, if so pls advise.

thanks for your time.
Hari
 
There is a table called sysibm.Sysversions ...

It will give you the version number, though it will not be very clear ... You will have to apply your best judgement ..

HTH

Sathyaram

More DB2 questions answered at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top