Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sei.cmu.edu!marc From: marc@sei.cmu.edu (Marc Graham) Newsgroups: comp.databases Subject: Re: c++ and SQL Message-ID: <26540@as0c.sei.cmu.edu> Date: 5 Jun 91 15:58:01 GMT References: Sender: netnews@sei.cmu.edu Distribution: comp Organization: The Software Engineering Institute Lines: 55 In article , cimshop!davidm@uunet.UU.NET (David S. Masterson) writes: |> #define SOAPBOX_MODE |> |> For this reason, I believe that the SQL standard should not specify a |> preprocessing standard on top of some other language, but rather a method of |> using SQL that does *not* require a change to the base language that it will |> be used with. If that were the standard, then any RDBMS with an SQL interface |> that works under (for instance) VAX/VMS would be able to interface with *all* |> the languages used on VMS. You would not need a special preprocessor for each |> language. |> |> #undef SOAPBOX_MODE The current ANSI SQL standard includes just such a facility. It is called the Module Language and is defined in ANS X3H2.135-1989 and X3H2.168-1989. A module has the following format (clause 7 of .135 and clauses 7 and 8 of .168): -=-=-=-=-=-=- MODULE My_Module LANGUAGE ADA DECLARE My_Cursor CURSOR FOR SELECT stuff FROM places WHERE Column=Parameter PROCEDURE Open_My_Cursor Parameter INT SQLCODE; OPEN My_Cursor; -- and fetch and close statements -=-=-=-=-=- Notice that the only language specific part is the LANGUAGE clause, which specifies the calling conventions to be used by the code to be produced by the module language compiler. That code will contain a callable procedure called Open_My_Cursor which will take an integer input paramter called Parameter and produce an SQLCODE. And similar things for fetch, close, and whatever else you like. The Ada standardization group (Working Group 9 of SubCommittee 22 of ISO) has been working on an extension (actually, a modest rewrite) to the module language, called the SQL Ada Module Description Language (SAMeDL) which is a module language more suitable to the needs of Ada. (Strong, abstract types, checked at compile time, for example.) Marc H. Graham Software Engineering Institute marc@sei.cmu.edu Carnegie Mellon University (412) 268 7784 Pittsburgh, PA 15213