3 ms·
Art. SQL embedded in C using gotos. I don't want to meet whoever juxtaposed those two.
by jng 7y ago
Art. SQL embedded in C using gotos. I don't want to meet whoever juxtaposed those two.
- gmfawcett 7y agoI can't be certain that they were the first, but Oracle's Pro*C/C++ tooling does the same thing as the example in this article, and with virtually the same syntax. https://docs.oracle.com/cd/E11882_01/appdev.112/e10825/toc.htm https://docs.oracle.com/cd/E11882_01/appdev.112/e10825/toc.h... I've worked on a legacy app written with these tools. It's not the most awful thing I've ever had to use. But there's a lot of magic in those macros, and you have to code carefully to avoid introducing action-at-a-distance bugs, esp. w.r.t. error handling.
- tannhaeuser 7y agoIt's called Embedded SQL, and is part of an ISO standard [1]. At one point an embedded version of Informix translated ESQL/C to ISAM calls, without any SQL parsing and query compilation at runtime. Though I don't know what this has to do with metaprogramming as we know it today. [1]: https://en.m.wikipedia.org/wiki/Embedded_SQL https://en.m.wikipedia.org/wiki/Embedded_SQL
- gmfawcett 7y agoI had no idea that it was standardized. Thanks for sharing this!