dynamic SPs
Posted in 2003
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
I have a piece of code that generate a large batch of SQL statements. Because of a bug in informix/esql (if a statement in the middle of a batch affect 0 rows, no subsequent statements will be executed) we have to split it and execute one statement at a time. This slows down the execution enormously. I was thinking about dynamically creating stored procedures to avoid this problem. I create a bunch of SPs that contain my script and then execute those. Is there any risks, bottlenecks etc that I may encounter if I do that? (Create procedure, execute procedure, drop procedure)? Or can informix handle a lot of create/execute/drop procedure calls from many users?
Doesn't anyone have an opinion on this? Is it safe or do I risk running into bottlenecks (such as locks on the system tables that hold SPs) if I repeatedly create, execute and immediately drop stored procedures? Also, why does it take so long time to create a SP? Informix doesn't seem to do too much syntax validation when creating a SP so where is the time spent when I execute a "create procedure"? "Kristofer Andersson" wrote in message news:<nkaob.94416$5n.89900@bignews5.bellsouth.net>... > I have a piece of code that generate a large batch of SQL statements. > Because of a bug in informix/esql (if a statement in the middle of a batch > affect 0 rows, no subsequent statements will be executed) we have to split > it and execute one statement at a time. This slows down the execution > enormously. > > I was thinking about dynamically creating stored procedures to avoid this > problem. I create a bunch of SPs that contain my script and then execute > those. Is there any risks, bottlenecks etc that I may encounter if I do > that? (Create procedure, execute procedure, drop procedure)? Or can informix > handle a lot of create/execute/drop procedure calls from many users?