(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;
Cannot insert multiple commands into a prepared statement
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
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
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