Re: Prepared SQL in 4GL
Posted in 1995
In article <811272378snz@haunted.demon.co.uk>,
Spokey the Wheeler <spokey@haunted.demon.co.uk> wrote:
> In article <jlumbleyDEyG5G.BFt@netcom.com>
> jlumbley@netcom.com "Joe Lumbley" writes:
>
> > ryeardly@eurobrok.co.uk wrote:
> > : 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 embedd the SQL
>
> > Generally, it is best to prepare and execute statements that get executed
> > multiple times. Perfect example is something that is deep inside a program
>
> [Perfectly true stuff snipped]
>
> IMHO, however, I think it's a good idea to write all your code using PREPAREd
> cursors for consistency.
Only problem I have with PREPAREd cursors is that they reduce readability of
most of the code I see.
EXECUTE ord_del -- This tells me bugger-all about what's happening
DELETE FROM order WHERE del_date < TODAY -- Tells me much more
of course: EXECUTE delete_old_orders
would be just fine, but I've got bitten quite a bit recently with 6 tools
blowing up at runtime because my identifiers are longer than 16 characters
(earlier versions just quietly ignored the extra characters).
------------------------------------,------------------------------------------
Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ v2.2 Mar 95
Quanta Systems, Auckland | kcbbs.gen.nz:/informix/informix.[faq|apx]
New Zealand. Work: +64 9 377-4473 | mathcs.emory.edu:/pub/informix/faq/ " "
Home: +64 9 279-3571 | http://www.garpac.com/informix.html