SCM

[#1010853] Error with "?" parameter markers

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-07-21 11:38
Priority:
3
State:
Open
Submitted by:
Paco Calvo (pac)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.9
Category:
Group:
Resolution:
None
Summary:
Error with "?" parameter markers

Detailed description
When using a command with "?" parameter markers (like "select field from table where key=?;"), Prepare() emits an exception.

If the parameter has a name ("box" in this case), the exception's message and call stack are:

Parameter box not found in query.
in Npgsql.NpgsqlCommand.ReplaceParameterValue(String result, String parameterName, String paramVal) in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:línea 2865
in Npgsql.NpgsqlCommand.GetParseCommandText() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:línea 2525
in Npgsql.NpgsqlCommand.Prepare() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:línea 1583
in ...


If the parameter has no name (string.Empty in this case), or is created with none, the exception's message and call stack are:

Parameter Parameter1 not found in query.
in Npgsql.NpgsqlCommand.ReplaceParameterValue(String result, String parameterName, String paramVal) in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:línea 2865
in Npgsql.NpgsqlCommand.GetParseCommandText() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:línea 2525
in Npgsql.NpgsqlCommand.Prepare() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:línea 1583
in ...

Besides that, great development! Thanks!

Followup

Message
Date: 2010-07-28 07:31
Sender: Paco Calvo

Thank you, Josh! I've skipped that part of the user manual.
Date: 2010-07-27 23:01
Sender: Josh Cooley

We support : and @ as parameter markers.

Attached Files:

Changes:

Field Old Value Date By
summaryError with "?" parameter markers2010-07-28 07:31pac
summaryError with "?" parameter markers2010-07-27 23:01jbcooley
Powered By FusionForge