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 ")"
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.