
Found a useful technique for inserting multiple rows into Oracle, MYSQL and MS SQL databases.
Mysql supports this:DUAL is a table which is created by oracle along with the data dictionary. It consists of exactly one column whose name is dummy and one record.
In MS SQL the union all technique also works:This technique is probably a lot faster than using multiple inserts in coldfusion and certainly helps reduce the round-trips that would need to be done.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
JAYESH TALSANIYA said: in mssql u cannot use parentheses in select statement. use as below: INSERT INTO [TABLE] (column1,... [More]
Multiple SQL inserts: Oracle, Mysql, MssqlJD said: I found with MSSQL, I couldn't use parentheses in my select statements for insert. So, from your ex... [More]
BlogCFC ping list and timeoutsWill Wilson said: Nice :) that will come in handy, thanks! [More]
Is this a Coldfusion 8 BUGBarb said: I'm having the same problem . . . when I start CF8, it seems to hang during or just after the user M... [More]
Is this a Coldfusion 8 BUGJoão Fernandes said: Phil, when you install CF8 they give you an option to install LCDS within CF. The messageBrokerServl... [More]
Thanks for that - really helped save my pages from timing out
I found with MSSQL, I couldn't use parentheses in my select statements for insert. So, from your example, I had to do: select 'value1','Fernando' union all select 'value2','Carlos' etc. Thanks for the reference though!
in mssql u cannot use parentheses in select statement. use as below: INSERT INTO [TABLE] (column1,column2) select 'Value1','Fernando' UNION ALL select 'Value2','Carlos' UNION ALL select 'Value3','Vincent'