transact statements

Hi All,

Wondering is there a way to execute something similar to sql transact statements in

Kdb? i.e. If you have several insert statements but if one fails then rollback all

the previous inserts. All or none succeed. 

Thanks,

Brian

there’s no built-in transaction support in the sense of commit/rollback.
But maybe this helps you

http://code.kx.com/wiki/Cookbook/Logging

so long as your set of cmds is issued in a single call, rollback here will undo everything in that cmd.

rollback can be expensive as it reconstructs by playing back all changes until before the error.

$ q logTest -l

KDB+ 3.2t 2014.05.09 Copyright (C) 1993-2014 Kx Systems

q)0"t:1"

q)0"t:a+1" / missing a

'a

q)t / t unchanged

1

q)0"b:1;t:a+1" / set b, then try a again

rollback

'a

q)b / b not set

'b

q)t / t unchanged

1

Thanks Charles! That helps.

Hi, 

I am not able to do rollback and commit any one can explain this below process in step by step, and what is logTest-I how to use this and this link is http://code.kx.com/wiki/Cookbook/Logging is not working please share new link

https://code.kx.com/v2/kb/logging/




Stephen Taylor | Librarian | Kx | +44 7713 400852 | stephen@kx.com