Page 1 of 1

syntax error at or near ":"

Posted: Fri 31 Oct 2008 18:39
by tomcat2001
We are getting the error: syntax error at or near ":"
ErrorCode 42601
FileName "scan.l"
LineNumber 795
Position 76
ProcedureName "base_yyerror"


I am attempting to use the parameterized queries and having some issues. Here is part of the code I'm using. See if anything would appear wrong. We seem to be having problems when the data contains one of the following 2 characters: ` or ". Now if the data contains 2 of these instead of 1, it works fine. I'm looking for a way around this as it's really killing us right now. This only happens in parameterized queries as a similar query without the parameterized part works fine.

using (PgSqlConnection connection = GetNewConnectionAndOpen())
{
PgSqlCommand command = new PgSqlCommand();
command.CommandText = string.Format("Update {0} Set LastName={1},Picture={2} Where PatientID = {3};",
"soapware_charts_generaldemographics",
"'test123\"'",
":Picture",
"'cb35523d-955c-46e0-9eb8-a9c5a6cce2db'");

command.Connection = connection;

PgSqlParameter param = new PgSqlParameter();
param.ParameterName = "Picture";
param.Value = null;
param.DbType = DbType.Binary;

command.Parameters.Add(param);

command.ExecuteNonQuery();
}


If however I use 2 double quote characters it works fine.

using (PgSqlConnection connection = GetNewConnectionAndOpen())
{
PgSqlCommand command = new PgSqlCommand();
command.CommandText = string.Format("Update {0} Set LastName={1},Picture={2} Where PatientID = {3};",
"soapware_charts_generaldemographics",
"'\"test123\"'",
":Picture",
"'cb35523d-955c-46e0-9eb8-a9c5a6cce2db'");

command.Connection = connection;

PgSqlParameter param = new PgSqlParameter();
param.ParameterName = "Picture";
param.Value = null;
param.DbType = DbType.Binary;

command.Parameters.Add(param);

command.ExecuteNonQuery();
}

Posted: Mon 03 Nov 2008 11:53
by AndreyR
Thank you for the bug report.
We have reproduced the error and now we are investigating the problem.

Posted: Fri 05 Dec 2008 14:40
by tomcat2001
I'm wondering what the status of this is?

Posted: Tue 09 Dec 2008 11:26
by Shalex
Sorry for inconvenience, but we need more time to process this request.

Posted: Mon 15 Dec 2008 21:40
by tomcat2001
Shalex wrote:Sorry for inconvenience, but we need more time to process this request.
I'm sorry but this is a pretty major problem for us and we need a solution ASAP. We've been stuck telling our users some things, but this is out of hand. We paid for a tool that will let us connect to PostgreSQL and now this is something you've been able to reproduce and it's a pretty major issue with a character in the text causing it. I expect to be hearing from somebody real soon on a release to check out.

Posted: Wed 17 Dec 2008 13:06
by AndreyR
The problem is solved, look forward to the next build.

Posted: Wed 17 Dec 2008 13:13
by tomcat2001
It looks like 4.00 is the current version. So I guess whatever the next version is? 4.01 or something like that?

Posted: Wed 17 Dec 2008 13:51
by AndreyR
Follow the announcements on our forum.

Posted: Wed 14 Jan 2009 14:52
by tomcat2001
AndreyR wrote:Follow the announcements on our forum.
I've been kind of following this, but nothing yet and it's been a month. Is there some kind of vague estimate so I have some idea. So maybe february or march or this month. I understand that you all need to make sure the build is good and not putting out something with issues, but we're just sitting around waiting for something to help us out.

Posted: Thu 15 Jan 2009 15:04
by Shalex
The new build (4.00.20) of dotConnect for PostgreSQL is available now.
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users Area (for users with valid subscription only).

For more information, please visit: http://www.devart.com/forums/viewtopic.php?t=13900