I m working on SQLite 3 command window. When I execute Rollback command it don't work correctly. I m using ON CONFLICT clause with ROLLBACK command. I provide NOT NULL constraint and provide NULL value in UPDATE statement. Before that I have updated same row with different value. Like I updated 3 rd row whose value was 3 with 6 and then update this value to NULL. According to Rollback it should delete value 6 which I have previously updated. Now in Fail algorithm I have updated first 2 rows with 5 and 6 value. Their previous values were 1 and 2. I have inserted Null value in 3 rd row. And after that I update 4th row with 8. Now according to Fail algorithm,it should convert the first and second rows to their previous values. But its not happening. I have even tried that may be 4th row value is changed to previous value. Even I have tried to insert 1st,2nd,3rd nad 4th rows after the Null value row updation. I m using the following syntax:-
create emp(name text,code int NOT NULL ON CONFLICT FAIL/ROLLBACK); . Please help. Thanks.
Loading
Monika AroraPosted Dec 1, 2011, 12:08 AM
I have used Rollback ON CONFLICT clause its working fine. But Fail clause is not working correctly. According to its definition,it don't rollback statements before constraint error and it also don't updates records which are occuring after constraint error. But its updating values. I have tried it with transaction as well as individually. But the result is same. Please tell me the solution. Thanks.
Pravin MorePosted Nov 30, 2011, 11:35 PM
are these all insert/update statements in same transaction?
because rollback undo changes of current transaction.
Thanks,
Pravin.