Xref: utzoo comp.databases:6729 comp.lang.c++:8859 Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!dlogics!dsa From: dsa@dlogics.COM (David Angulo) Newsgroups: comp.databases,comp.lang.c++ Subject: Re: Embedded SQL in C++ Summary: connecting eSQL to c++ Message-ID: <609@dlogics.COM> Date: 7 Aug 90 17:34:11 GMT References: <897@rm1.UUCP> Followup-To: comp.databases,comp.lang.c++ Organization: Datalogics Inc., Chicago Lines: 27 In article <897@rm1.UUCP> bapat@rm1.UUCP (Bapat) writes: > >What's the best way to declare C++ constructs to the Embedded SQL Precompiler >interface? > > ... copy the FETCH'ed data into regular temp >variables (which we can declare in the EXEC SQL DECLARE SECTION), and then >subsequently copy them [back into c++ variables] Yes, that is really the only way. Then send your source through the SQL precompiler and send the output of that into your c++ precompiler. We have been doing this sort of thing for about a year. This is really the easy part. The harder part comes in trying to isolate your eSQL statements for a particular class to the methods of that class. At first glance, it would seem easy. Each class, after all, needs an INSERT, UPDATE, FIND-BY-ID, FETCH-NEXT, DELETE, etc. methods. And, this works for simple vanilla type of queries. However, when you get into larger, more complex queries, you'll find you need a FIND-BY-this-type-of-query method for each different type of query and a cursor to go along with this, then you'll need to have a FETCH-BY- this-type-of-query, and variables to let you know if each cursor is opened so that you can close them in the destructor, and it just keeps going on. It is doable, however. Good luck! -- David S. Angulo (312) 266-3134 Datalogics Internet: dsa@dlogics.com 441 W. Huron UUCP: ..!uunet!dlogics!dsa Chicago, Il. 60610 FAX: (312) 266-4473