concatenate timestamp with char

Database

concatenate timestamp with char

Hi ,

How come select current_date ||'abc' works and select current_timestamp||'abc' throws an error..

i believe something to do with how they are internally stored and then implicity casted.?

date is internally stored as integer, what is TS stored as?

thanks,

1 REPLY
Senior Apprentice

Re: concatenate timestamp with char

There's no automatic typecast for Timestamps, you need to cast them explicitly:

cast(current_timestamp as varchar(32))||'abc'