SAP Knowledge Base Article - Preview

3053199 - ExecuteSqlCommand with Parameters

Symptom

An update command with parameters via a DB context (see code below) and sent to the database server generates a syntax error in the request log:

=,<,11,PREPARE,Update :p1 as a SET a.Flag = RsFlagSet(a.Flag, :p2);
=,E,11,-131,Syntax error near 'p1' on line 1


Example:

String allSelectionCommand = $"Update :p1 as a SET a.Flag = RsFlagSet(a.Flag, :p2);";
String sqlStatement = "SELECT * FROM :p1 WHERE RsFlagGet(Flag) = 0;";

context.Database.ExecuteSqlCommand(allSelectionCommand, new object[] {"Art", 1});



Read more...

Environment

SAP SQL Anywhere 17

Microsoft Entity Framework 6

Product

SAP SQL Anywhere 17.0

Keywords

KBA , BC-SYB-SQA-SRV , SQL Anywhere - Server , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.