#1 Yesterday 07:59:18

squirrel
Member
Registered: 2015-08-13
Posts: 165

Run sql statement unprepared

Is there a way to specify that a specific sql statement should not be executed prepared?  In Mysql, some statements should not be prepared and causes Mysql to return:
This command is not supported in the prepared statement protocol yet (1295)
In these limited instances, it would be useful to be able to directly execute the statement without preparing

Offline

#2 Yesterday 17:58:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,510
Website

Re: Run sql statement unprepared

From the ORM? Or via direct SQL?

Which mormot.db unit do you use to connect to MySQL?

Online

#3 Today 06:34:03

squirrel
Member
Registered: 2015-08-13
Posts: 165

Re: Run sql statement unprepared

Direct SQL
mormot.db.sql, mormot.db.sql.odbc and for another project mormot.db.rad.firedac

Offline

#4 Today 19:48:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,510
Website

Re: Run sql statement unprepared

Which statements are you referring to?

You have low-level access to ExecDirect() and ExecDirectW() in TOdbcLib perhaps you could use that.
It may be possible to add some new methods to TSqlDBOdbcStatement, like ExecuteDirect().

But it is not directly supported yet.

Online

Board footer

Powered by FluxBB