In general, Dynamic SQL is a little slower than Static SQL - although there are some cases where it's the better performing choice.
My recommendation is to choose Dynamic vs Static SQL based on the needs of the program. If the program doesn't know exactly what type of SQL request it needs to execute until the program is called, then that's a clear case to use Dynamic SQL. I'll also add that playing tricks (eg, conditional predicates) to simulate a Dynamic SQL with a Static SQL statement is a bad performance choice.
------------------------------
Kent Milligan
------------------------------
Original Message:
Sent: Thu May 12, 2022 12:26 PM
From: Amy Vozza
Subject: Dynamic vs Static Embedded SQL in ILE COBOL
Should we expect a performance difference using dynamic versus static embedded SQL in ILE COBOL? I'm asking in order to understand if we should use discretion in applying the dynamic SQL there and why.
------------------------------
Amy Vozza
------------------------------
#SQL