> So, you can use something like this: > > if { ! [catch {set selectResult [eval db "select x from y where z = > 'blah'"]} catchErr] } { > puts "Failed - the error is $catchErr" > } else { > puts "selectResult= $selectResult" > } >
Except that you've got the if/else clauses reversed (or just remove the !) -- also, you don't really need the 'set selectResult', although it's sometimes convenient, because if the script succeeds, the result will be in the supplied variable (catchErr in this case) -- also, it's 'db eval', not 'eval db'. Regards