I know I can set the default commit option for a program at compile time with "exec sql set option = ???;" or with the appropriate compile command option.
I know that an individual embedded SQL statement can have its own commit setting by ending it with "with xx;" (e.g. "with CS;")
Is there a way to programatically condition the commitment option, so that the same embedded SQL statement can run with commitment option *NONE or *CS depending on the value of some variable at runtime?
The only way I can think of to do this is to duplicate the SQL statement (one with *NONE, the other other with *CS) and run one or the other - but I would really prefer if it could be one statement.
I know that an individual embedded SQL statement can have its own commit setting by ending it with "with xx;" (e.g. "with CS;")
Is there a way to programatically condition the commitment option, so that the same embedded SQL statement can run with commitment option *NONE or *CS depending on the value of some variable at runtime?
The only way I can think of to do this is to duplicate the SQL statement (one with *NONE, the other other with *CS) and run one or the other - but I would really prefer if it could be one statement.
Comment