473,503 Members | 10,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 Programing help

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,
Feb 6 '06 #1
1 1341
Jack Miller wrote:
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,

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
--
Serge Rielau
DB2 Solutions Development
DB2 UDB for Linux, Unix, Windows
IBM Toronto Lab
Feb 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1574
by: warhero721 | last post by:
HI. First i like to point out i suck at programing. All i realy whant to know is how do i git my site orginized.I whant to know how to do somthing like this Chatroom fourm sighn up event...
12
3564
by: Xah Lee | last post by:
Of Interest: Introduction to 3D Graphics Programing http://xahlee.org/3d/index.html Currently, this introduction introduces you to the graphics format of Mathematica, and two Java Applet...
15
2768
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
2
1091
by: maamirj | last post by:
Hi, I am newly start prgraming from very beigning using .net c# 2005 can u help me the concepts of programing, oops from begining and how to start programing wih right techniques. thanks
0
7264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5562
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.