By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,589 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,589 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.