Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Recordsets in C++
In article <kga06.280$Sc1.9436_at_newsread2.prod.itd.earthlink.net>,
"Doug Farrell" <dfarrell01_at_earthlink.net> wrote:
> Hi,
>
> I'm new to using Oracle at my company and trying to develop
applications for
> our dyanmic web sites with Oracle as the backend database. We've been
using
> PL*SQL to develop database classes, but I find this very awkward, time
> consuming and error prone. I've seen access to Oracle using Java and
the
> JDBC and a thing called a Recordset, which is kind of like code I've
seen in
> Visual Basic too. Basically what happens is the program makes an SQL
> statement as string, and then it is passed to Oracle for evaluation.
The
> results of this query is a Recordset object from which the data can be
> retrieved by 'field name' rather than explicitely, as in PL*SQL code.
What
> I'm looking for is something along the lines of the following:
>
> Recordset record;
> std::string query;
>
> query = "SELECT name, number, price from items where id = '1'"
>
> db.exec(query);
>
> std::string name = record.field("name");
> std::string number = record.field("number");
> std::string price = record.field("price");
>
> The Recordset object would provide a lookup mechanism based on the
field
> name. Does anyone know how to do this in Oracle using C++ code? Any
> assistance or pointers where to look would be very much appreciated.
>
> Thanks,
> Doug Farrell
>
>
Look into the Oracle 8i Server Application Development manuals, ProC/C++ Precompiler Programming Guide. You are basically wanting to read the entire manual -- most interesting is chapter 13: Oracle Dynamic SQL.
-- Michael Krolewski Rosetta Inpharmatics mkrolewski_at_rii.com Usual disclaimers Sent via Deja.com http://www.deja.com/Received on Wed Dec 20 2000 - 17:55:55 CST