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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter

Status
Not open for further replies.

db2SQLUSer

Programmer
Mar 3, 2005
1
NL
I want to use a parameter in a select-statement
In Interbase I use for example:

SELECT *
FROM TABEL
WHERE ID = :parameter

but when i use it in DB2 it won't work and get
"Wrong number of parameters. SQLSTATE=07001"-error.
How must I use parameters in DB2??
 
Where is this SELECT statement?

There appears to be no facility for run-time parameters in Interactive SQL, though UNIX scripts can get around this limitation.

If it is within a host program (Cobol etc) the syntax is fine, as long as 'parameter' is declared as a DB2 field in an EXEC SQL DECLARE SECTION of working storage.


If you need more information let us know the platform and the environment and we will do what we can.


Brian
 
I've been banging my head against a wall over the same issue. Having come from a SQL Server\Sybase world I am in shock of the differences in DB2.

So I guess there is no way to declare parameters in simple SQL?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top