var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Inserting multiple rows at a time into table
I am trying to implement functionality that will insert multiple rows at a time irrespective of the database used. The SQL command should be compatible across all the database. If any one knew about this please let me know as its very urgent.
Thanks in advance
can't be done
Do ya not reckon (for major RDBMSs anyway)?
CREATE TABLE dummy (nowt INT)
INSERT INTO dummy (nowt) VALUES(0)
INSERT INTO destination (col1, col2, col3)
SELECT 'this', 'that', 'the other'
SELECT 'something', 'nothing', 'anything'
ur codings are working excelent.
actually, for major database systems, just use this, it's standard SQL --
you might be surprised which microsoft database products would not be considered "major" by this criterion
( col1, col2, col3 )
( 'this', 'that', 'the other' )
, ( 'something', 'nothing', 'anything' )
Edit: it's "F641, Row and table constructors" and i just realized it's optional -- apologies for the hasty snipe at ms
heh -- i said "snipe"
Last edited by r937; 03-11-09 at
Will these SQL commands work for almost all databases like oracle,db2 and ms sql server
yes, almost all of those
Just so you know Rudy - SQL Server 2008 supports this construct
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert
as does mysql
the point wasn't to list the ones that do support row constructors, which is standard sql, but to highlight the "major" database systems that don't support it
actually, the original question was whether there was a way to do it the same way across all database systems and the answer is still "no"