Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Recordsets in C++

Re: Oracle Recordsets in C++

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Thu, 21 Dec 2000 08:19:58 -0500
Message-ID: <3A42037E.CD493F41@Unforgetable.com>

Doug Farrell 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

Keep in mind that if you start putting the sql in your program then you are moving away from the "thin client" scenario. One of the reasons why stored procedures should be used is that it allows the details of implementation to be hidden from the client application and also allows changes to be made on the server without any need to change the client application. Received on Thu Dec 21 2000 - 07:19:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US