Page 1 of 1

Cannot insert multiple commands into a prepared statement

Posted: Tue 27 Jul 2010 16:06
by ccampbell
(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;

Posted: Wed 28 Jul 2010 09:26
by StanislavK
Thank you for your report, we've reproduced the issue. We will fix the problem and inform you when the corresponding build is available.

Posted: Wed 11 Aug 2010 15:03
by ccampbell
Hi, just curious as to how long until we may have a fix for this. Thanks.

- CBC

Posted: Thu 12 Aug 2010 11:56
by StanislavK
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.

Posted: Fri 24 Sep 2010 16:47
by StanislavK
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