Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
BEGIN
DECLARE LOCAL TEMPORARY TABLE temp_t1 (
key_1 INTEGER NOT NULL,
col_2 INTEGER NOT NULL,
PRIMARY KEY ( key_1 ) )
NOT TRANSACTIONAL;
LOAD TABLE temp_t1 FROM 't1_d.txt';
INSERT t1 SELECT * FROM temp_t1;
END;
Now the individual inserted rows are recorded in the transaction log. Here is
what the output from dbtran.exe looks like:
--INSERT-1001-0000475402
INSERT INTO DBA.t1(key_1,col_2)
VALUES (1,1)
go
--INSERT-1001-0000475411
INSERT INTO DBA.t1(key_1,col_2)
VALUES (2,2)
go
Note that operations involving temporary tables are not recorded in the transac-
tion log, and with the NOT TRANSACTIONAL clause they arent recorded in
the rollback log either. That means the LOAD TABLE statement isnt written to
the transaction log, the rows it inserts arent written to the rollback log, and it
doesnt cause a commit or a checkpoint; the speed disadvantage of this tech-
nique might not be so bad after all. For more information about temporary
tables, see Section 1.15 in Chapter 1, Creating.