Subject Re: [firebird-support] stored procedure, concatenate input parameters
Author Martijn Tonies

> Hi, I have a stored procedure with a couple of input parameters that I
> want to concatenate:
> In_param1 VarChar(100)
> In_param2 VarChar(100)
> .
> .
> .
> declare variable str VarChar(200)
> I was hoping I could do something like:
> str = In_param1 & In_param2;
> If In_param1 equals "Hello " and In_param2 equals "World", str should
> read "Hello World".
> This doesn't work. Could anyone help me with this?

Well, that might be related to the fact that "&" isn't the concatenation
operator :-)

Firebird uses the double pipe: || - as with the SQL standard.

str = In_Param || In_Param2;

Do note, that if one of the pieces to be concatenated IS NULL,
the result will be NULL as well.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions