473,786 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MyODBC 3.51 executing multiple SQL statements

Hello,

I am using MyODBC from VB and I want to submit a batch of insert statements
in one call from my App. This is more efficient than making multiple calls
from code because of the communication overhead.

If I send a batch multiple statements separated by ; or ; + newline I get
syntax errors pointing at the start of the next statement..
If I fire each statement one at a time with the ; at the end there's no
problem.

I cannot be the first person with this problem. Is it common practice to
make multiple calls from you application or is there a magic trick I am
missing?

Code and error message below, thanks in advance!

Cheers,

Tim H


My execute function is like this:

Public Function ExecuteSQL(ByVa l strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execut e strSQL, lngAffected, adCmdText + adExecuteNoReco rds
ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQ L "DELETE FROM table1;" -- works fine

objDB.ExecuteSQ L "DELETE FROM table1; DELETE FROM table1;" -- error

Error message:
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-max-nt]You have an error in your SQL
syntax. Check the manual that corresponds to your MySQL server version for
the right syntax to use near '; DELETE FROM `in(

Jul 19 '05 #1
3 4605
** following is my opinion, not really the answer to your question **
INSERTS? why not switch to VFP and use the remote views and handle it all
with the tableupdate() command ?

VB really sucks at doing data, and sucks even more at doing REMOTE data.
if you have Visual Studio EnterPrise Edition Version 6, VFP is on CD 1.
IF you have the MSDN Universal subscription, you can find VFP version 6,7,8
there .

here are some notes about how to do it:
http://fox.wikis.com/wc.dll?Wiki~VFPmySQLLinuxP1~VFP

hth - mondo regards [Bill]
ps - your example here was for DELETE, btw....
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex****** **@efgroup.net
mySql / VFP / MS-SQL
"Tim Hastings" <so***@nospam.c om> wrote in message
news:bi******** ***********@new s.demon.co.uk.. .
Hello,

I am using MyODBC from VB and I want to submit a batch of insert statements in one call from my App. This is more efficient than making multiple calls
from code because of the communication overhead.

If I send a batch multiple statements separated by ; or ; + newline I get
syntax errors pointing at the start of the next statement..
If I fire each statement one at a time with the ; at the end there's no
problem.

I cannot be the first person with this problem. Is it common practice to
make multiple calls from you application or is there a magic trick I am
missing?

Code and error message below, thanks in advance!

Cheers,

Tim H


My execute function is like this:

Public Function ExecuteSQL(ByVa l strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execut e strSQL, lngAffected, adCmdText + adExecuteNoReco rds ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQ L "DELETE FROM table1;" -- works fine

objDB.ExecuteSQ L "DELETE FROM table1; DELETE FROM table1;" -- error

Error message:
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-max-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; DELETE FROM `in(


Jul 19 '05 #2
** following is my opinion, not really the answer to your question **
INSERTS? why not switch to VFP and use the remote views and handle it all
with the tableupdate() command ?

VB really sucks at doing data, and sucks even more at doing REMOTE data.
if you have Visual Studio EnterPrise Edition Version 6, VFP is on CD 1.
IF you have the MSDN Universal subscription, you can find VFP version 6,7,8
there .

here are some notes about how to do it:
http://fox.wikis.com/wc.dll?Wiki~VFPmySQLLinuxP1~VFP

hth - mondo regards [Bill]
ps - your example here was for DELETE, btw....
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex****** **@efgroup.net
mySql / VFP / MS-SQL
"Tim Hastings" <so***@nospam.c om> wrote in message
news:bi******** ***********@new s.demon.co.uk.. .
Hello,

I am using MyODBC from VB and I want to submit a batch of insert statements in one call from my App. This is more efficient than making multiple calls
from code because of the communication overhead.

If I send a batch multiple statements separated by ; or ; + newline I get
syntax errors pointing at the start of the next statement..
If I fire each statement one at a time with the ; at the end there's no
problem.

I cannot be the first person with this problem. Is it common practice to
make multiple calls from you application or is there a magic trick I am
missing?

Code and error message below, thanks in advance!

Cheers,

Tim H


My execute function is like this:

Public Function ExecuteSQL(ByVa l strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execut e strSQL, lngAffected, adCmdText + adExecuteNoReco rds ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQ L "DELETE FROM table1;" -- works fine

objDB.ExecuteSQ L "DELETE FROM table1; DELETE FROM table1;" -- error

Error message:
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-max-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; DELETE FROM `in(


Jul 19 '05 #3
** following is my opinion, not really the answer to your question **
INSERTS? why not switch to VFP and use the remote views and handle it all
with the tableupdate() command ?

VB really sucks at doing data, and sucks even more at doing REMOTE data.
if you have Visual Studio EnterPrise Edition Version 6, VFP is on CD 1.
IF you have the MSDN Universal subscription, you can find VFP version 6,7,8
there .

here are some notes about how to do it:
http://fox.wikis.com/wc.dll?Wiki~VFPmySQLLinuxP1~VFP

hth - mondo regards [Bill]
ps - your example here was for DELETE, btw....
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex****** **@efgroup.net
mySql / VFP / MS-SQL
"Tim Hastings" <so***@nospam.c om> wrote in message
news:bi******** ***********@new s.demon.co.uk.. .
Hello,

I am using MyODBC from VB and I want to submit a batch of insert statements in one call from my App. This is more efficient than making multiple calls
from code because of the communication overhead.

If I send a batch multiple statements separated by ; or ; + newline I get
syntax errors pointing at the start of the next statement..
If I fire each statement one at a time with the ; at the end there's no
problem.

I cannot be the first person with this problem. Is it common practice to
make multiple calls from you application or is there a magic trick I am
missing?

Code and error message below, thanks in advance!

Cheers,

Tim H


My execute function is like this:

Public Function ExecuteSQL(ByVa l strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execut e strSQL, lngAffected, adCmdText + adExecuteNoReco rds ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQ L "DELETE FROM table1;" -- works fine

objDB.ExecuteSQ L "DELETE FROM table1; DELETE FROM table1;" -- error

Error message:
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-max-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; DELETE FROM `in(


Jul 19 '05 #4

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

Similar topics

8
11751
by: MrTrix | last post by:
Hello: I'm having a problem formulating the code to execute a multiple line command. I'm trying to execute something like: set rowcount 100000 declare @rowct int select @rowct = 1 while (@rowct > 0) begin
2
6413
by: Richard Adams | last post by:
Is it possible to execute more than one statement in SQL via MDAC ODBC? I have a fairly complex select I wanted to create a view with, but trying to send it all as one string with terminators ';' between doesn't work (invalid character.) How can I do this kind of thing from VB.NET? Thanks in advance Richard
0
732
by: Andrew | last post by:
With command-line interface ( 3.23.37, UNIX Socket ) all is well with column aliasing. However, column aliases disappear in Excel, over ODBC, when there are multiple (joined) tables in the query. I run the following query with aliased columns with CLI: select table1.c1 as 'pet category', table1.c2 as 'item', table1.c3 as 'quantity', table2.c2 as 'attendant' from table1 left outer join table2 on (table1.c1=table2.c1);...
0
1377
by: Tim Hastings | last post by:
Hello, I am using MyODBC from VB and I want to submit a batch of insert statements in one call from my App. This is more efficient than making multiple calls from code because of the communication overhead. If I send a batch multiple statements separated by ; or ; + newline I get syntax errors pointing at the start of the next statement.. If I fire each statement one at a time with the ; at the end there's no problem.
1
478
by: Adrian | last post by:
Dear All I've come across a strange issue when using UNION via MyODBC on my Fedora linux box (I'm using MySQL 4.1.3-standard-beta) **This doesn't work: (select a from tbl_name where a=10 and b=1 order by a) union (select a from tbl_name where a=11 and b=2 order by a)
13
2858
by: BK | last post by:
Can someone point me to a code sample that illustrates executing long running tasks (asynchronous) from a web application in ASP.NET? I assume that Web Services might come into play at some point, but I'm not sure how to get started. For example, I have an application that, upon a user initiating through a button or link click, will go out and generate a bunch of files (this could take several minutes). This will happen in batches, so I...
3
1525
by: Dean g | last post by:
Hi, I have a problem with running multiple sql statements using asp. Basically if there is an error with any of the statements inside the query a rollback is done. the sql and rollback work fine, But on the actual asp page no error is detected unless it occurs in the first statement in the query. heres an example <% Sql= " BEGIN TRAN INSERT INTO Users VALUES ('BLAH', 'BLAH') INSERT INTO TESTING VALUES ('SOMETHING','SOMETHING') IF @@error...
7
6170
by: Glenn Davy | last post by:
Hidely hodley everyone I'd like to run a series of of sql ddl statements against an msde2000 server. Normally I just deploy cmd file that impliments as osql statement, but I'd like to store the 'patch' in an mdb file and use say ado or even a passthrough statement to execute it. The problem I've got Is I access (?) seems to require me to execute one ddl at a time, otherwise the script breaks at the 'go' statement. While I _could_ do...
1
2815
by: rudykayna | last post by:
I'm having trouble executing multiple DDL statements in one SQL file. I've been using ExecuteNonQuery() but it does not seem to like the "GO" statements in my SQL file. I need to keep the "GO" statements because its DDL. Anyone know a way around this? --- Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
1
2502
by: arthy | last post by:
Hi, Is it possible to execute multiple statements on to the database using a single dbconnection object.what is the drawback in using .If not possible ,then how can the execution of multiple statements using a single object be done. thanks in advance, arthy
0
9496
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9961
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8989
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.