Info on non-embedded SQL from C
Posted in 1993
Topics: SQL Development & Query Writing, Connectivity: ESQL/C, 4GL & Embedded SQL
I have a C program that generates standard SQL (**) at run time based on user
input and executes against a preexisting database. It is currently
implemented to use Sybase, although I designed it (hopefully) to allow other
SQL engines to be used easily. All I need from the RDBMS is the ability to
execute a single SQL SELECT statement and read the resuling rows back. In
Sybase, I can do this by building a null-terminated C string with the SQL
statement, calling dbcmd(), dbexec(), and dbresults(). I cannot use an
embedded SQL system because I do not know the SQL statements to be used at
compile time.
My question is: What commercial database systems provide this functionality on
Unix platforms? I initially assumed that they all would, since it appears to
be such a simple and common approach; however, I was stunned when an Informix
rep told me that what I wanted to do was impossible with their system.
However, I also got the impression that the Informix rep was an idiot, so I
don't want to take that as the last word.
Any information will be appreciated. Thanks.
Barry Jaspan, bjaspan@aktis.com
Geer Zolot Associates / Aktis, Inc.
** I do not claim to be an SQL guru. My working definition for "standard SQL"
is that it allows the following statement syntax:
INSERT INTO table_name VALUES (expr_list)
SELECT column_list
FROM table_list
WHERE condition_list
GROUP BY column_list
HAVING condition_list(plus aggrs)
ORDER BY column_list
I also assumed that all commercial RDBMs would support standard SQL, perhaps
this is also incorrect.