×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hello Dan,
Am 11.09.2025 um 23:13 schrieb Dan Bale <dan.bale@xxxxxxxxxxxxxxxxxxxxx>:
We have a lot of embedded SQL that uses host variables, e.g.:
Select a, b, c from custmast where c = :hostc;
It has been suggested to me that this can cause performance issues because the plan cache may need to be "rebuilt"(?), so we should consider replacing these type of queries with dynamic SQL using parameter markers, e.g.
SQLStatement = 'Select a, b, c from custmast where c = ?';
Exec SQL Prepare P1 from :SQLStatement;
Exec SQL Declare C1 cursor for P1;
Exec SQL Open C1 USING :hostc;
Is anyone aware of a resource that describes this in detail?
I can't elaborate about embedded SQL, but I'm also using parameter markers when I access my machine via ODBC from Perl scripts. Instead of immediately executing a request, I'm just preparing it for later repeated execution, as per your example. Syntax is somewhat different, though.
When using this feature, the OS creates *SQLPKG objects, probably as cache?
Maybe also provide test cases that prove performance gains? (Or not?)
I have no precise numbers, but I presume that the number of raw inserts per second into tables on my venerable model 150 increased about tenfold. That was a good thing to learn about, and rewrite the code accordingly.
I don't remember performance gains in selects, but that's probably because the transition period between just using ODBC as I knew it from MySQL, and adopting prepared statements was rather brief. Some days, maximum.
Not much to offer here, but maybe it gives you an idea.
:wq! PoC
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.