multi sentence mysqlcommand

multi sentence mysqlcommand

Postby LaRoccaNetwork » Wed 26 Jan 2005 02:37

Oleg:

here's the error:

Exception Details: CoreLab.MySql.MySqlException: 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 ';' at line 5

and here's the sql code

insert into tagenciesfilespax
(fileid, tipoDocumentodeIdentidad, numeroDocumento, nombres, apellidos, nacimiento, nacionalidad, cantPax, B4BendUser, B4BcorpUser)
select fileid, tipoDocumentodeIdentidad, numeroDocumento, nombres, apellidos, nacimiento, nacionalidad, cantPax, B4BendUser, B4BcorpUser
from tagenciesfilespax_tmp
where fileid = :xfileid;
delete from tagenciesfilespax_tmp where fileID = :xfileid


this code used to work fine
but it stop doing that since version 2.50 or next

on the other side, in your comments about the mysqlscript:
Often it is necessary to execute several SQL statements one by one. It can be performed by using a lot of components such as MySqlCommand. Usually it isn't a good solution. With only one MySqlScript component you can execute several SQL statements as one. This sequence of statements is named script. To separate single statements use semicolon (;) symbol.

so ... why should this component be created ? it is supposed that mysqlcommand would be much powerful, if it would permit multi-sentences.

more than that, I use to create a mysqlcommand having

insert sentence;
select last_insert_id


and to execute an executeNonQuery to get the result
but, once again, it stopped working since the 2.50 version

regards,
nelson
LaRoccaNetwork
 
Posts: 2
Joined: Fri 21 Jan 2005 17:09

Re: multi sentence mysqlcommand

Postby Oleg » Fri 28 Jan 2005 10:13

To execute SQL with parameters you can use only MySqlCommand.
We tested its working with several statements separated by ';'.
We sent our test to you by email. If your test in any way differs from our one,
please change our test and send it back to us.
Oleg
Devart Team
 
Posts: 264
Joined: Thu 28 Oct 2004 13:56


Return to dotConnect for MySQL