Page 1 of 1

NZ sql script calling

Posted: Fri Jan 02, 2015 3:55 am
by vamsi.4a6
I am new to netezza and i have one sql file consists of following statements which we are calling from NZ connector[Read from sql option]


Insert statement1

Update statement1

Updatestatement2


I want all 3 sql statments should be success and if any sql statement is failed i want to rollback all the sql staments that are executed succesfully

Posted: Fri Jan 02, 2015 9:10 am
by chulett
Check the documentation - I believe that separating them with a single semi-colon makes them individual transactions while 'double semi-colons' means all as one transaction.

Posted: Mon Jan 05, 2015 4:21 am
by vamsi.4a6
I believe following settings are sufficient to handle my scenario after reading the documentation and please correct me if i am wrong?

Fail on error=YES

if you specify Fail on error as Yes, all statements are executed as one transaction. If one fails, the statements already executed rolls back and the rest are not executed.

Atomic mode=YES
This property is activated when you specify Fail on error as Yes. The default value for Atomic Mode is Yes and all statements are executed in one transaction.

Posted: Mon Jan 05, 2015 8:41 am
by chulett
Let us know. :wink:

Posted: Tue Apr 07, 2015 3:28 am
by vamsi.4a6
Kindly let me know whether my undersanding is correct or not?

Posted: Tue Apr 07, 2015 3:57 am
by ray.wurlod
Better idea. Why don't you press the Help button when these properties are selected, learn what the possible values are and the effects of each, and report back with your findings?

Posted: Tue Apr 07, 2015 6:44 am
by chulett
I was assuming you'd be testing your understanding then letting us know if they were indeed correct or not.