문제

so i have this wierd question.. as fare as i know, the database server got a validation process to only commit new data, when the data is all stored.

now my question is, can i run multiply sql queries, and delay the commit, until all queries have been run?

i got 600.000 new entries, i want to split into smaller sql "insert into" queries, so i don't have to start all over, if the SQL query fails.

so is there a way to do following

"DELAY COMMIT"
"INSERT INTO ...."
"INSERT INTO ...."
"INSERT INTO ...."
"INSERT INTO ...."
...
...
...
"INSERT INTO ...."
"COMMIT"
도움이 되었습니까?

해결책

yes, use begin and commit transaction:

BEGIN TRANSACTION
INSERT INTO ...
INSERT INTO ...
INSERT INTO ...
INSERT INTO ...
INSERT INTO ...
COMMIT TRANSACTION
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top