Why does SQL Anywhere ignore the @ named parameter?

Israel Lopez

I am using Dapper to query a SQL Anywhere Datasource, and I am getting an error that makes it seem that the "@" prefix for my where clause value is ignored.

 Double balance = qb.Query<Double>("select end_balance_amt from QBReportAdminGroup.v_lst_customer where list_ident = @listid", new { listid = ListID }).Single();

Error:

Column '@listid' not found

I have access to that table and my manual query works fine.

select end_balance_amt from QBReportAdminGroup.v_lst_customer where list_ident = '8000000B-1433635931'

Example:

enter image description here

Frédéric

With SQL Anywhere and its .Net data provider (at least Sap.Data.SQLAnywherev4.5), parameters should be prefixed with : instead of @.

This looks to me as being the issue in your case. But I do not know if Dapper is supposed to abstract away such vendor's specific behavior from its users.

So you should try with:

Double balance = qb.Query<Double>(
    "select end_balance_amt from QBReportAdminGroup.v_lst_customer where list_ident = :listid",
    new { listid = ListID }).Single();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why does Python requests ignore the verify parameter?

From Dev

Why does Swift constructor use named parameter calling?

From Dev

Why does Swift constructor use named parameter calling?

From Dev

Why does RNGCryptoServiceProvider's constructor ignore its parameter?

From Dev

Why does Git ignore these folders?

From Dev

Why does FloatToStr ignore ThousandSeparator?

From Dev

Why does setInterval() ignore errors?

From Dev

Why does GLSL ignore return?

From Dev

Why does sudo ignore aliases?

From Dev

Why does bash ignore SIGTERM?

From Dev

Why Gulp does not ignore the file?

From Dev

how does the ignore parameter works in gulp and nodemon?

From Dev

how does the ignore parameter works in gulp and nodemon?

From Java

Using React Router the <Redirect /> Does not redirect anywhere, but why?

From Dev

Why does strcpy_s not exist anywhere on my system?

From Dev

SQL ignore part of WHERE if parameter is null

From Dev

SQL: SAP Hana if parameter is null, ignore where

From Dev

Sql Server Ignore search on a field if parameter is null

From Dev

Why does Sqoop ignore column names when importing data from SQL Database

From Dev

Why does Django say there is no module named views?

From Dev

Why does AngularJS ignore $scope field change?

From Dev

Why does this code ignore the await and proceed anyway?

From Dev

Why does make ignore my modifications?

From Dev

Why does Git ignore the .vs directory?

From Dev

Why does XhtmlTextWriter ignore custom attributes?

From Dev

Why does Linq ignore my where clause?

From Dev

Why does Yii ignore my .po file?

From Dev

Why does my Android transition ignore the TransitionListener?

From Dev

Why does expand.grid ignore options?

Related Related

HotTag

Archive