Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

commit with database-unrelated stuff

Status
Not open for further replies.

svar

Programmer
Aug 12, 2001
349
GR
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top