1

I was trying to concatenate 3 columns in SQL, but I getting error message as

1) [Error Code: -440, SQL State: 42884] DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884, SQLERRMC: CONCAT;FUNCTION. 2) [Error Code: -727, SQL State: 56098] DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-440;42884;CONCAT|FUNCTION

This is my query

select concat(number,ID,name) as MemberDetails from Member where number = '123'

1 Answers1

0

This looks like a problem with the schema. Specifically, it involves functions and procedures.

You have two SQL return codes, both of which are errors. The two codes are

-440: Routine &1 in &2 not found with specified parameters. A function or procedure with the specified name and compatible arguments was not found

and

-727: There actually isn't an error code named this. Did you mean -747?

In SQL, a negative number represents an unsuccessful call with an error.

You need a separate alias name. Also you might want to add the alias before the column name just in case there's disambiguation. Here's what it should look like.

select concat(number,ID,name) as M from Member where M.number = '123'

If neither of them worked, it is a problem with the SCHEMA, not with the above query.

Richard Hamilton
  • 25,478
  • 10
  • 60
  • 87