I have fixed the problem using bulk fetch / insert statments. Thanks for the help.