Hi,
I need to submit some SQL statements through VB code via ODBC. My
question is can I submit something like:
DECLARE vOne VARCHAR(40);
SET vOne = ' World'
select 'Hello' || vOne
FROM SYSIBM.SYSDUMM1
Currently, when I do this I get an error. I even tried enclosing my
statements with a BEGIN and END but did not work. I know I can embed the
above statements into a stored procedure, but can I make this return one
row without embedding this into a Store Proc?
Thanks,
Serge Rielau - 06 Feb 2006 12:42 GMT
> Hi,
>
[quoted text clipped - 14 lines]
>
> Thanks,
The first two statements are part of SQL Procedures.
Since you are coding VB you shoudl use teh VB equivalent of local
variables, assignment and then use parameter-markers ('?') to bind the
VB variable to the select statement.
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab