Tom, you are 100% right. Most of us converts like the dynamic selection, the dynamic sort, and the better joins we get from SQL over old fashioned logicals. Although 99% of us out there are doing "record at a time" cursor FETCH statements in our code just as your examples show, I have yet to find good examples where I can reap the really big performance boost that "record-set" processing would buy me (other than a mass update using UPDATE filename SET xxx WHERE . . )
What I find hindering adoption is that SQLSTT status codes for Found and Not Found and End of Group are lacking in production programs, and end up giving us problems later. Maybe an article from you, showing good examples of SQL with SQLSTT handlers could be a follow-on article. (There are some examples at this site and elsewhere of SQLSTT, but it never hurts to drive good practices home by repetition.) And I find myself curious how tests of SQLSTT would look in these other languages.
Although I still often fall back to older tried and true CHAIN / READE styles in my code, I find that during the design phases, I force myself to think "Embedded SQL" for production code for the simple reason that if my code is to be something that will last the test of time, it will probably migrate - or be copied and pasted - into another language.
What I find hindering adoption is that SQLSTT status codes for Found and Not Found and End of Group are lacking in production programs, and end up giving us problems later. Maybe an article from you, showing good examples of SQL with SQLSTT handlers could be a follow-on article. (There are some examples at this site and elsewhere of SQLSTT, but it never hurts to drive good practices home by repetition.) And I find myself curious how tests of SQLSTT would look in these other languages.
Although I still often fall back to older tried and true CHAIN / READE styles in my code, I find that during the design phases, I force myself to think "Embedded SQL" for production code for the simple reason that if my code is to be something that will last the test of time, it will probably migrate - or be copied and pasted - into another language.
Comment