473,395 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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(ByVal strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execute strSQL, lngAffected, adCmdText + adExecuteNoRecords
ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQL "DELETE FROM table1;" -- works fine

objDB.ExecuteSQL "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 4561
** 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.com> wrote in message
news:bi*******************@news.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(ByVal strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execute strSQL, lngAffected, adCmdText + adExecuteNoRecords ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQL "DELETE FROM table1;" -- works fine

objDB.ExecuteSQL "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.com> wrote in message
news:bi*******************@news.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(ByVal strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execute strSQL, lngAffected, adCmdText + adExecuteNoRecords ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQL "DELETE FROM table1;" -- works fine

objDB.ExecuteSQL "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.com> wrote in message
news:bi*******************@news.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(ByVal strSQL As String) As Long

Dim lngAffected As Long

mobjConn.Execute strSQL, lngAffected, adCmdText + adExecuteNoRecords ExecuteSQL = lngAffected

End Function


And I am performing this operations:

objDB.ExecuteSQL "DELETE FROM table1;" -- works fine

objDB.ExecuteSQL "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
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...
2
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 ';'...
0
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. ...
0
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...
1
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...
13
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,...
3
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,...
7
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...
1
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"...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
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
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,...

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.