TUniSQL with PostgreSQL

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

TUniSQL with PostgreSQL

Post by ertank » Sat 20 May 2017 13:48

Hello,

My main use of TUniSQL is for multiple command execution. By default TUniSQL.SpecificOptions.UnpreparedExecute is set to True.

This is not a problem for Microsoft SQL Server. However, PostgreSQL cannot insert multiple commands into a prepared statement.

Is it possible to define a project wide setting for all TUniSQL components so that their SpecificOptions.UnpreparedExecute will be set to False?

Or, is it possible to turn this parameter to False by default if provider is PostgreSQL?

Thanks & regards,
Ertan

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: TUniSQL with PostgreSQL

Post by azyk » Wed 24 May 2017 09:41

To solve the specified issue you can use one of the following solutions:

- to execute multiple SQL queries you can use the TUniScript component: https://www.devart.com/unidac/docs/?dev ... script.htm

- in the code of a custom application set the specific option UnpreparedExecute to True for each TUniSQL instance

- use the protocol 2.0 to connect to PostgreSQL. For this, you need to set TUniConnection.SpecificOptions.Values['PostgreSQL.ProtocolVersion'] to the 'pv20' value.

Post Reply