Cannot insert multiple commands into a prepared statement

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
ccampbell
Posts: 31
Joined: Tue 01 Jun 2010 17:31
Location: Oregon

Cannot insert multiple commands into a prepared statement

Post by ccampbell » Tue 27 Jul 2010 16:06

(4.95.146.0)
Hi, seems to me this used to work but it's been awhile since I last worked with this tool. Isn't the point of using the pgScript to have multiple commands? I've got other scripts that have multiple statements like below that run fine. What's special about this one? What am I doing wrong? Thanks.

pgConn.Open()
pgConn.BeginTransaction()
pgScript = New PgSqlScript(sqlText, pgConn)
pgScript.Execute()
pgConn.Commit()

sqlText =

-- Function iif_bool

CREATE OR REPLACE FUNCTION iif_bool(condition boolean, truecase boolean, falsecase boolean) RETURNS boolean AS ' BEGIN If Condition = True Then Return TrueCase; Else Return FalseCase; END IF; END;' LANGUAGE 'plpgsql' VOLATILE COST 10000; ALTER FUNCTION iif_bool(boolean, boolean, boolean) OWNER TO ddadmin;

-- Function iif_text

CREATE OR REPLACE FUNCTION iif_text(condition boolean, truecase text, falsecase text) RETURNS text AS ' BEGIN If Condition = True Then Return TrueCase; Else Return FalseCase; END IF; END;' LANGUAGE 'plpgsql' VOLATILE COST 10000; ALTER FUNCTION iif_text(boolean, text, text) OWNER TO ddadmin;

-- Function iif_int

CREATE OR REPLACE FUNCTION iif_int(condition boolean, truecase integer, falsecase integer) RETURNS integer AS ' BEGIN If Condition = True Then Return TrueCase; Else Return FalseCase; END IF; END;' LANGUAGE 'plpgsql' VOLATILE COST 10000; ALTER FUNCTION iif_int(boolean, integer, integer) OWNER TO ddadmin;

-- Function iif_date

CREATE OR REPLACE FUNCTION iif_date(condition boolean, truecase date, falsecase date) RETURNS date AS ' BEGIN If Condition = True Then Return TrueCase; Else Return FalseCase; END IF; END;' LANGUAGE 'plpgsql' VOLATILE COST 10000; ALTER FUNCTION iif_date(boolean, date, date) OWNER TO ddadmin;

-- Function iif_cur

CREATE OR REPLACE FUNCTION iif_cur(condition boolean, truecase numeric, falsecase numeric) RETURNS numeric AS ' BEGIN If Condition = True Then Return TrueCase; Else Return FalseCase; END IF; END;' LANGUAGE 'plpgsql' VOLATILE COST 10000; ALTER FUNCTION iif_cur(boolean, numeric, numeric) OWNER TO ddadmin;

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 28 Jul 2010 09:26

Thank you for your report, we've reproduced the issue. We will fix the problem and inform you when the corresponding build is available.

ccampbell
Posts: 31
Joined: Tue 01 Jun 2010 17:31
Location: Oregon

Post by ccampbell » Wed 11 Aug 2010 15:03

Hi, just curious as to how long until we may have a fix for this. Thanks.

- CBC

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 12 Aug 2010 11:56

We've fixed the issue, the fix will be available in the nearest build which we plan to release in about three weeks.

As a workaround, please try setting the 'Unprepared Execute' connection string parameter to true.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 24 Sep 2010 16:47

We have released the new 4.95.170 build of dotConnect for PostgreSQL containing the fix for the issue. The build can be downloaded from
http://www.devart.com/dotconnect/postgr ... nload.html
(the trial version) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/

The detailed information about the fixes and improvements implemented in dotConnect for PostgreSQL 4.95.170 is available at
http://www.devart.com/forums/viewtopic.php?t=19070

Post Reply