Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / February 2006

Tip: Looking for answers? Try searching our database.

DB2 Programing help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack Miller - 06 Feb 2006 09:57 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.