[comp.databases] Embedded SQL: Same across vendors?

mark@DRD.Com (Mark Lawrence) (02/15/91)

I've had a look at the reference manuals for Oracles embedded SQL
program interface (happened to be for DOS, but I imagine that its
consistent for all platforms supported) and I've looked at the Ingres
reference books for ESQL for SCO UNIX/ODT.  The way host variables are
handled and so forth appear amazingly similar.  I was wondering, for those
of you who've dealt with the equivalent 3gl interfaces in sybase, informix
and what-not, is it the same there too?  Is embedded SQL similar for all
vendors which support it?  Is it a part of the SQL standard (if such
exists)?
-- 
mark@drd.com
mark@jnoc.go.jp    $B!J%^!<%/!&%i%l%s%9!K(B   Nihil novum sub solem

davidm@uunet.UU.NET (David S. Masterson) (02/16/91)

>>>>> On 14 Feb 91 19:04:11 GMT, mark@DRD.Com (Mark Lawrence) said:

Mark> I've had a look at the reference manuals for Oracles embedded SQL
Mark> program interface (happened to be for DOS, but I imagine that its
Mark> consistent for all platforms supported) and I've looked at the Ingres
Mark> reference books for ESQL for SCO UNIX/ODT.  The way host variables are
Mark> handled and so forth appear amazingly similar.  I was wondering, for
Mark> those of you who've dealt with the equivalent 3gl interfaces in sybase,
Mark> informix and what-not, is it the same there too?  Is embedded SQL
Mark> similar for all vendors which support it?  Is it a part of the SQL
Mark> standard (if such exists)?

Embedded SQL is part of the ANSI standard (to what degree, I'm not sure), so
it will be "amazingly similar" from platform to platform.  However, there is
still enough flexibility in the standards that there are gotchas to watch for.
For instance, data definition statements as opposed to data manipulation
statements were not really addressed in the standard (that may have changed
recently).  I still think the safest approach to building portable programs
for multiple types of relational database systems is to *extremely* modularize
your code and put the SQL statements in functions/procedures by themselves.
If there are differences between platforms, only the code with the data access
statements will change.  The 3GL tends to be more standardized than the
database access statements (especially with the coming wave of object
orientation), so you're better off using the tried and true methodologies of
systems design to modularize/encapsulate unknown quantities into safe areas.
--
====================================================================
David Masterson					Consilium, Inc.
(415) 691-6311					640 Clyde Ct.
uunet!cimshop!davidm				Mtn. View, CA  94043
====================================================================
"If someone thinks they know what I said, then I didn't say it!"