Help should clarify capabilities of TMyCommand vs TMyScript for multiple statements

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
davidmarcus
Posts: 50
Joined: Tue 25 Jan 2005 11:22
Location: Somerville, MA
Contact:

Help should clarify capabilities of TMyCommand vs TMyScript for multiple statements

Post by davidmarcus » Sat 23 Jan 2021 20:57

The Help for the TMyScript Class and the TMyCommand Class give the impression that TMyCommand can only execute one SQL statement at a time. However, the code for TMyCommand uses the CLIENT_MULTI_STATEMENTS flag, so TMyCommand can handle multiple statements separated by semicolons.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Help should clarify capabilities of TMyCommand vs TMyScript for multiple statements

Post by ViktorV » Tue 26 Jan 2021 14:39

As described in MyDAC documentation (https://www.devart.com/mydac/docs/devar ... ommand.htm), you can use TMyCommand to access database server using SQL statements. This component allows you to execute several comma-delimited statements in a single run.

TMyScript (https://www.devart.com/mydac/docs/devar ... script.htm) is a component for executing several SQL statements one by one, and in case of an error in one of the statements, it will continue execution of other statements

Note that you can use dbMonitor to find out what information is sent to the server, as well as when it is sent.
You can learn about using Batch Operations in our products on our blog: https://blog.devart.com/using-batch-ope ... nents.html

Post Reply