[Info-vax] Coding with/without RDBMS
Arne Vajhøj
arne at vajhoej.dk
Sat Oct 23 23:00:01 EDT 2021
On 10/23/2021 4:24 AM, Jan-Erik Söderholm wrote:
> Den 2021-10-23 kl. 09:57, skrev Lawrence D’Oliveiro:
>> I mentioned previously how COBOL was supposedly designed for
>> “business” needs, yet it didn’t take long to become apparent that it
>> had become woefully out of step with actual “business” needs, when
>> businesses became more dependent on SQL databases instead of ISAM
>> files; COBOL was born in the era of ISAM files, and never really
>> adapted to be being able to cope in a very flexible way with SQL.
>>
>
> Again, there is no major difference in how SQL is handled in Cobol
> than in any other compiled language.
Cobol is special because almost all RDBMS access is via embedded SQL
and that is not the case in other languages, but embedded SQL is
available for other languages as well. Embedded SQL for C is seen
in real life.
> Scripting languages might have
> some other run-time mangling of SQL commands, but that can be done
> from Cobol also using a dynamic-SQL interface. But that has worse
> performance since the SQL has to be processed and "compiled" at each
> call.
Many database servers today cache execution plans mitigating the cost of
more dynamic SQL.
> Embedded SQL using a SQL-precompiler does that at compile-time.
> At run-time you do not analyse, compile and execute any SQL at all.
I think that depends on the implementation.
Some embedded SQL simply generate code that calls a regular database
library and pass the SQL as argument to a function that end up sending
the SQL over the netwo0rk to the database server.
One database embedded SQL that does not do that is DB2. It does
a lot during prep and bind.
> And there is no major difference in Cobol between ISAM and SQL.
> I'd say that in most cases the SQL coding is cleaner and easier.
> At least if ISAM=RMS and SQL=Rdb.
Both file IO to ISAM files and embedded SQL are pretty standard
in Cobol, so I would expect that top be true for any ISAM
and RDBMS.
Arne
More information about the Info-vax
mailing list