I basically want to do this(in semi-pseudocode, the actual implementation is in perl/DBI, but that should not matter):
inserted_count=0;
for each loop variable i {
insert INTO TABLE VALUES(i);
inserted_count++ ;
commit;}
i.e. I want to incement the inserted counter If and only if the commit succeeds. As you may suspect, the actual code
is much more complicted and we are not talking about simple counts here, of course, but this example gives the essence of the problem. Otherwise it is of course much better to take the count at the end via an SQL statement.
Has anyone dealt with such an issue before?
Thanks, svar
inserted_count=0;
for each loop variable i {
insert INTO TABLE VALUES(i);
inserted_count++ ;
commit;}
i.e. I want to incement the inserted counter If and only if the commit succeeds. As you may suspect, the actual code
is much more complicted and we are not talking about simple counts here, of course, but this example gives the essence of the problem. Otherwise it is of course much better to take the count at the end via an SQL statement.
Has anyone dealt with such an issue before?
Thanks, svar