Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT and Pro*C/C++
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, > AlexReceived on Tue Oct 12 1999 - 07:03:18 CDT
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................
.....................................................................