MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Coalesce for a TImestamp field

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Aug 16, 2004 12:31 am    Post subject: Coalesce for a TImestamp field Reply with quote

Hi,
I am facing some problem with the function Coalesce.
I used this function as below:
COALESCE(EUC_UPD_USR_ID,' '),
COALESCE(EUC_GE_REAS_CD,0)
Here EUC_UPD_USR_ID is an alphanumeric field and EUC_GE_REAS_CD is a numeric field.
This is working fine.

I used the same function for a Timestamp field as below:
COALESCE(EUC_UPD_TMST,' ')
Here EUC_UPD_TMST is an alphanumeric field.

But if I use this for a Timestamp field it is saying that THE DATA TYPE, LENGTH OF COALESCE IS INVALID.

Can anybody pls help me on this.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Aug 16, 2004 5:40 am    Post subject: Reply with quote

paneendra,

Try

Code:

COALESCE(EUC_UPD_TMST,'0000-00-00-00.00.00.000000 ')


Hope this helps..

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Aug 16, 2004 5:49 am    Post subject: Reply with quote

Kolusu,
Even moving '0000-00-00-00.00.00.000000' is giving the sql code -171(THE DATA TYPE, LENGTH OF COALESCE IS INVALID).
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Aug 16, 2004 7:47 am    Post subject: Reply with quote

Paneendra,

Try

Code:

COALESCE(CHAR(EUC_UPD_TMST),'0000-00-00-00.00.00.000000 ')


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Aug 16, 2004 8:15 am    Post subject: Reply with quote

Thanks Kolusu,
This syntax is working.
Back to top
View user's profile Send private message Send e-mail
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Sun Sep 05, 2004 5:50 am    Post subject: Reply with quote

hi,

another way can be :

COALESCE(EUC_UPD_TMST, TIMESTAMP('0000-00-00-00.00.00.000000 '))
or
VALUE(EUC_UPD_TMST, TIMESTAMP('0000-00-00-00.00.00.000000 '))

Thanx
P.R.Mohanty
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group