Hi,
I have 3 insert statements like
INSERT INTO table(col1,col2,col3)values (value1,value2,value3);
INSERT INTO table(col1,col2,col3)values (value1,value2,value3);
INSERT INTO table(col1,col2,col3)values (value1,value2,value3);
My query is to insert it in a single command object i.e.
I created
VerticaCommand command = new VerticaCommand (Parameters);
----
----
command.ExecuteNonQuery(); // I need this statement will execute once for above 3 statements.
But Vertica doesn't taking these how can I do this,If anybody knows,plz guide.
Thanks,
Ajit Kumar Nayak
ajit.nayak@vichara.com
How To Insert Multiple Statements in One verticacommand
Moderator: NorbertKrupa
-
- Newbie
- Posts: 15
- Joined: Tue May 14, 2013 1:25 pm
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: How To Insert Multiple Statements in One verticacommand
Hi,
Welcome to the forums!
Check out the following post which may help you out:
http://www.vertica-forums.com/viewtopic.php?f=63&t=998
I'm thinking you gotta do something like this:
Hopefully Vertical will give a multi-record insert command in a future release!
Welcome to the forums!
Check out the following post which may help you out:
http://www.vertica-forums.com/viewtopic.php?f=63&t=998
I'm thinking you gotta do something like this:
Code: Select all
INSERT INTO table (col1, col2, col3)
SELECT value1, value2, value3
UNION
SELECT value1_2, value2_2, value3_2
UNION
SELECT value1_3, value2_3, value3_3;
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- Newbie
- Posts: 15
- Joined: Tue May 14, 2013 1:25 pm
Re: How To Insert Multiple Statements in One verticacommand
Thanks Jim Knicely
It helps me lot.
Thanks
Ajit
It helps me lot.
Thanks
Ajit