Re: Prepared SQL in 4GL
Posted in 1995
It depends on how often you are going to execute it. Once and it makes no odds -- you may as well write it in-line since it is easier. Many times, and preparing it once and executing it many times will probably give enhance performance over in-line statements, which are effectively prepared and executed each time they are used. This applies to both I4GL and to ESQL/C (or ESQL/x for any other x). Don't forget that you can parameterise the variables used in the prepared statements. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >Date: Thu, 14 Sep 95 11:08:42 PDT >From: ryeardly@eurobrok.co.uk >X-Informix-List-Id: <list.7442> > >I hope someone can help. In a 4GL program is it quicker to prepare >a piece of SQL and then execute it, rather than just embed the SQL >statement directly in the code. I know that if you need to use variables >and place holders then you have to prepare the SQL, but for example, >a select for use with a cursor. > >Is it quicker to declare the cursor directly >from embedded SQL or by using a prepared SQL statment?