Page 1 of 1

hard-coding of SQL in cobol

Posted: Sat May 27, 2023 12:27 am
by Sunil Hyderbad
Which term is used to mean hard-coding of SQL in cobol? Could someone guide please.

Re: hard-coding of SQL in cobol

Posted: Sat Jun 03, 2023 9:34 am
by zum13
The term I've always heard and used is "embedded SQL". It's used for C, PL/1, assembler, etc as well and it's certainly the term used in the DB2 manuals. There are two forms. "Static" refers to having fixed SQL statements that can be handled by the precompiler (which gives a performance benefit). "Dynamic" is where the statements are built at run time.

Re: hard-coding of SQL in cobol

Posted: Mon Jun 05, 2023 6:34 pm
by Sunil Hyderbad
Thanks zum13. So hard coded is 'embedded SQL'? That's what you mean?

Re: hard-coding of SQL in cobol

Posted: Thu Jun 08, 2023 5:27 am
by zum13
Yes. Any time you've got an "EXEC SQL" in a program, you've got embedded SQL.

Re: hard-coding of SQL in cobol

Posted: Sun Jun 11, 2023 11:13 am
by Sunil Hyderbad
I replied the same in my interview, though not the exact word. But he didn't agree with me.

Re: hard-coding of SQL in cobol

Posted: Mon Jun 12, 2023 12:15 am
by zum13
That's what embedded SQL has meant since I started working with relational databases, and I go back to 1986 and SQL/DS (which is what DB2 for VM used to be called). According to the current DB2 manuals, it's still called that today...

https://www.ibm.com/docs/en/db2-for-zos ... rogramming

I'd be disagreeing with the guy who disagreed with you!

Re: hard-coding of SQL in cobol

Posted: Mon Jun 12, 2023 10:57 am
by Rahul
I think the question is about 'hard coding' and not 'embedded', interviewer was not wrong.