Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USE VARIABLE IN SQL

Status
Not open for further replies.

marcello62

Technical User
Jun 19, 2006
42
NL
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top