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

Home -> Community -> Usenet -> c.d.o.tools -> Re: running c++ program within database

Re: running c++ program within database

From: Jim Kennedy <kennedy-family_at_home.com>
Date: Fri, 01 Jun 2001 19:46:00 GMT
Message-ID: <YhSR6.93002$p33.1959653@news1.sttls1.wa.home.com>

Are you using host variables? ODBC doesn't support host variables natively. (better to use OCI or OLE objects correctly) Not using host variables would possibly show up as high CPU utilization on the server machine. Also you might try to do an explain plan on each type of query to see if there are proper indexes etc.

Using pl/sql might be a good idea, it would mean that you are not dragging the information accross the network. It depends upon what you need to do. You would write a package and call the package from your c++ program.

Can you give us a flow of what you are doing?

Jim

<davidchantf_at_hotmail.com> wrote in message news:2JOR6.1277$Zy.1232642_at_newsrump.sjc.telocity.net...
> Hi,
> I am using oracle ODBC 8.01.72, VC++ 6.0 on winnt 4.0. I have one
> operation that needs about 20*x database access, where x can be from 5 to
> 30.
> I can set up the program and database in one computer, but still
> slow. Right now I only have hundreds of records for testing, but in
> production mode, it can grow to millions of records.
> And the table design is complex and highly normailized.
> I never try to use PL/SQL, Is it a much better choice than ODBC ? Do I
> need to rewrite my program at all ?
> Thanks.
> David
>
> wayne <no_at_email.please.com> wrote:
> >> I have a C++ program that need to make a lot of database access within
 one
> >> operation, which is very slow. So I am wondering if I can run this
 program
> >> inside database? so to reduce the number of database access, and
 increase
> >> performance.
 

> > First of all, you would need to access the database anyway, regardless
 of
> > whether it's running on the database or outside.
 

> > Now, as far as performance optimization, there are lots of things you
 could
> > do: Server-side tweaks as well as client-side... you can also scrutinize
 the
> > design of both the server and the overall process...
 

> > In answer to your question, I have never seen a C++ program be part of
 the
> > database itself. You can call out from the PL/SQL to the C++, but the
 C++
> > would have to be an external module (and may have to have a C wrapper,
> > possibly), as in a DLL or SO file.
 

> > What would I do at this point if I were you (and I _have_ been in your
> > situation before)? I would start with the overall design. Minor tweaks
 do
> > not help if the underlying design is bad. I would then move on to
> > optimizing the server and the client code (and what I would do depends
> > heaviliy on what the exact tasks are and how long each takes to run).
 

> > If you describe your project more we can help more (ie. what operations
 are
> > being dome that take a long time, how many records are we talking about,
> > what platform you run in, whether or not you are already running the
 program
> > on the same machine as the server, etc...).
>
>
Received on Fri Jun 01 2001 - 14:46:00 CDT

Original text of this message

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