467,923 Members | 1,840 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

SQL0440N No authorized routine named "||" of type "FUNCTION" having compatible arguments was found.

Trying to concatenate two fields into one however I seem unable to do
so.

All I want is to execute the following

SELECT MONTH(L.DATE) ||' '|| YEAR(L.DATE) as MTH_OF_YEAR
FROM LOG L

But I get this error:

SQL0440N No authorized routine named "||" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884

This is the only way I know how to concatenate??? Is there another way
to achieve this in DB2 8.2?

Aug 22 '07 #1
  • viewed: 25523
Share:
2 Replies
On Aug 22, 3:48 pm, whitsey <lysterfiel...@gmail.comwrote:
Trying to concatenate two fields into one however I seem unable to do
so.

All I want is to execute the following

SELECT MONTH(L.DATE) ||' '|| YEAR(L.DATE) as MTH_OF_YEAR
FROM LOG L

But I get this error:

SQL0440N No authorized routine named "||" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884

This is the only way I know how to concatenate??? Is there another way
to achieve this in DB2 8.2?
The concatenation function expects strings. Try
RTRIM(CHAR(MONTH(L.DATE)))

--Jeff

Aug 22 '07 #2
whitsey wrote:
Trying to concatenate two fields into one however I seem unable to do
so.

All I want is to execute the following

SELECT MONTH(L.DATE) ||' '|| YEAR(L.DATE) as MTH_OF_YEAR
FROM LOG L

But I get this error:

SQL0440N No authorized routine named "||" of type "FUNCTION" having
compatible arguments was found. SQLSTATE=42884

This is the only way I know how to concatenate??? Is there another way
to achieve this in DB2 8.2?
You are concatenating numbers. You need to cast to CHAR, then concatenate.
In DB2 Viper 2 you can use TO_CHAR(L.DATE, 'MM YYYY')

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Aug 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by jack | last post: by
1 post views Thread by David Furey | last post: by
3 posts views Thread by Ronald W. Roberts | last post: by
12 posts views Thread by Jon Slaughter | last post: by
8 posts views Thread by John Henry | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.