marcello62
Technical User
Hi there,
I am new in Db2, and for my first project I try to use an SQL statement in a stored procedure, the statement getting it's values from variables. However, I can't seem to link the variable to the statement:
SET sSql = 'UPDATE EIGENAAR SET SALDO= ' || @BEDRA; This does not work.
@BEDRA is the variable. I can assign it a value, it works. But I could not put it directly into the string, but I also can't concatenate. I thought || should work but it doesn't. I tried + and &, but it don't work either. I used the variables with and without the @-prefix, but that doesn't seem to influence the result. I tried to run the code in SQLDbx as well as db2's commandline editor. No result. Does anyone know how to do this?
Any help will be greatly appreciated. Thanks.
I am new in Db2, and for my first project I try to use an SQL statement in a stored procedure, the statement getting it's values from variables. However, I can't seem to link the variable to the statement:
SET sSql = 'UPDATE EIGENAAR SET SALDO= ' || @BEDRA; This does not work.
@BEDRA is the variable. I can assign it a value, it works. But I could not put it directly into the string, but I also can't concatenate. I thought || should work but it doesn't. I tried + and &, but it don't work either. I used the variables with and without the @-prefix, but that doesn't seem to influence the result. I tried to run the code in SQLDbx as well as db2's commandline editor. No result. Does anyone know how to do this?
Any help will be greatly appreciated. Thanks.