PostgreSQL SQL commands can sometimes contain characters (:?) which are treated by ADO. NET provider as placeholder for value from DbParameter. For example those symbols can appear in:
* PostgreSQL type cast - foo::text
* DateTime values formatted as - '02.11.2017 19:39'
I'm trying to execute SQL command containing colon (:) symbols, and they are not intended to be treated as parameters placeholder.
PgSqlCommand cmd;
cmd.CommandText= "UPDATE TABLE 'foo' SET baz= bar::TEXT";
cmd.ExecuteNonQuery(); //Exception here cause parameter :text is missing.
Resolved: How to escape characters like '':$@?" used in SQL CommandText?
Resolved: How to escape characters like '':$@?" used in SQL CommandText?
Last edited by bpipe on Fri 03 Nov 2017 13:48, edited 1 time in total.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: How to escape characters like '':$@?" used in SQL CommandText?
We could not reproduce the issue. Please tell us your dotConnect for PostgreSQL version.
Please also create and send us a small test project with corresponding DDL\DML scripts which reproduces the issue with all characters that you want to escape.
And tell us your PostgreSQL server version.
Please also create and send us a small test project with corresponding DDL\DML scripts which reproduces the issue with all characters that you want to escape.
And tell us your PostgreSQL server version.
Re: Resolved: How to escape characters like '':$@?" used in SQL CommandText?
The problem resolved, sorry it was false alert.