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: SELECT and Pro*C/C++

Re: SELECT and Pro*C/C++

From: Kenneth C Stahl <BlueSax_at_Unforgettable.com>
Date: Tue, 12 Oct 1999 08:03:18 -0400
Message-ID: <38032386.C9836DF6@Unforgettable.com>


This is a troubling question. What would make you think that you can duplicate a sqlplus action in a Pro-C program? There are a lot of extra steps you must follow. You must first declare a cursor, open the cursor, fetch from the cursor until there are no more rows and then close the cursor.

What your program tries to do is execute the SELECT statement as if it were a stored procedure and it clearly can't do that, but because you have no error checking in your program you don't even see the errors.

I suggest that you study the example programs that come with Pro-C. That will give you a good start on how to use Pro-C.

Alex Vinokur wrote:

> 
> Hi,
> 
> ------------------------------------
> Using in SQL the following command
> 
>         SELECT * FROM FFF;
> 
> I see on screen what I want to see
> (all rows of table FFF);
> ------------------------------------
> 
> ------------------------------------
> Using in Pro*C/C++ he following code
> 
>         RWCString tmp_str = "SELECT * FROM FFF";
>         EXEC SQL BEGIN DECLARE SECTION;
>         const char* execute_line = ((const char*)tmp_str);
>         EXEC SQL END DECLARE SECTION;
>         EXEC SQL EXECUTE IMMEDIATE : execute_line;
> 
> I give nothing on screen.
> ------------------------------------
> 
> =================================
> === Oracle 8.0.5
> === Pro*C/C++ : Release 8.0.5.0.0
> === SunOS 5.6
> =================================
> 
>         What is wrong?
>         Thanks in advance,
>         Alex

.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
Received on Tue Oct 12 1999 - 07:03:18 CDT

Original text of this message

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