{ Please limit your text to fit within 80 columns, preferably around 70,
so that readers don't have to scroll horizontally to read each line.
This article has been reformatted manually by the moderator. -mod }
Hello guys,
I am looking at various database libraries for C++ but have not been
able to find exactly what I am searching for. I hope someone can point
me in the right direction, if there is one.
I am after something that will enable a C++ program to call stored
procedures that have already been written. As you read on, you might
think of tools that enable stored procedures to be generated along with
corresponding CRUD code in C++ but the stored procs that I have in mind
already exist.
It is more than just the means of invoking the sp. It is also a way to
nicely automate the population of the result set so that a related object
is produced. Ideally the object should act like a vector of objects whose
type corresponds to a row from the result set. Since the classes have a
shape that is peculiar to the shape of the result set I anticipate that
what I am looking for will be some sort of code generator.
This is a tall order, I know, but here are some other requirements that
make it even harder:
o it should be vendor neutral and work with oracle, sybase and
postgres as a minimum.
o Ideally the code generator will use the data dictionary to get
the information it needs. This would avoid the user having to
redescribe the shape of the result set in a separate input to
the generator. This might make the generator extremely complex
since a strongly typed stored proc may be expressed in terms of
several user defined types.
o It should use the native API for certain well known proprietary
RDBMS, e.g. OCI for Oracle, CTLIB for sybase. This avoids the
ineffiencies of ODBC in these cases.
o Ideally the code generator should generate result set accessor
names derived from the names in the parameter list of the return
value. This would be better than using generically named
acessors. It enables the code that uses the output from the code
generator to be more readable since the reader can see which
parts of the result set are being used.
I have seen various database wrappers in my travels. Several are
multi-RDBMS, portable and useful. The OTL is the main one I am familiar
with. However, none of them have the code generator I am talking about.
They allow sps to be called but setting up the binding and creating a
suitable object type to hold the results is up to the caller.
I have only seen two code generators that come close. One was Sybase only
and completely exposed its use of CTLIB. So that would be no good for me
in my current environment, which uses Oracle. And the other is in C# and
is Oracle only. Deep sigh.
Regards,
Andrew Marlow
--
[ See
http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]