multiple statements with parameters in ado .net client
i am trying to execute multiple statements via a single command having parameters. They pass when executed independently but fail when executed as single query, Any idea as to why this is happening. Sample below.
In the schema create a table as
create table test(id integer not null);
in Ado .NET with version 6.1.3 execute the following code.
const string query = "insert into test(id) values (@anumber) ; select id from test limit 1;";
using (var connection = new VerticaConnection(TestUtils.DatabaseConnectionString))
using (var command = connection.CreateCommand())
{
command.CommandText = query;
connection.Open();
command.Parameters.Add(new VerticaParameter("anumber", VerticaType.BigInt, 12));
command.ExecuteScalar();
}
and it gives me the following error :
Vertica.Data.VerticaClient.VerticaException : [42601] ERROR: Syntax error at or near ")"
----> Vertica.Data.Internal.Util.ServerException : ERROR: Syntax error at or near ")"
In the schema create a table as
create table test(id integer not null);
in Ado .NET with version 6.1.3 execute the following code.
const string query = "insert into test(id) values (@anumber) ; select id from test limit 1;";
using (var connection = new VerticaConnection(TestUtils.DatabaseConnectionString))
using (var command = connection.CreateCommand())
{
command.CommandText = query;
connection.Open();
command.Parameters.Add(new VerticaParameter("anumber", VerticaType.BigInt, 12));
command.ExecuteScalar();
}
and it gives me the following error :
Vertica.Data.VerticaClient.VerticaException : [42601] ERROR: Syntax error at or near ")"
----> Vertica.Data.Internal.Util.ServerException : ERROR: Syntax error at or near ")"
0
Comments
In the 'JDBC Feature Support' page (https://my.vertica.com/docs/6.1.x/HTML/index.htm#16749.htm) it states that In the Vertica ADO.NET documentation on 'Using Parameters' (https://my.vertica.com/docs/6.1.x/HTML/index.htm#11722.htm) it states: Does this explain what we are seeing?
Is it possible to prevent Prepare() being called for a parameterised query?
Is this fixed in 7.x?
Is this a known issue?