Problems with OCI update to database

From: Jeff Anderson <jeff_at_sporty.col.oh.us>
Date: Tue, 4 May 1993 01:37:50 GMT
Message-ID: <1993May4.013750.2167_at_sporty.col.oh.us>


Before I begin, I must confess I'm a novice at all this Oracle stuff.

Here is my problem:

We have a shell script (Sun OS) that calls sqlplus to set a flag in a database. The sql script is as follows:

     REM  set flag to indicate db is being updated.
     set pause off
     set ver off
     set feedback off
     update status                
     set   being_updated = '&&1'

/
commit
/
exit

I would like to do this same thing in a C program. I am using the OCI interface libraries and the function is as follows:

     [orlon & oopen]
     
     sprintf(szTmp,"update status set being_updated='%c'",chValue);
     if (osql3(&cursorDb,szTmp) || oexec(&cursorDb) || ocom(&ldaDb))
        {
        LogMessage("ERROR: updating Oracle status table",TRUE);
        bReturn = FALSE;
        }

At execution time, the routine logs in and gets a cursor but the osql3 statement returns error -933. I have tried a variety of syntax and they all return -933 or some other syntax related error.

When I manually use SQLPLUS, this same statement works fine. Moreover, SQLPLUS executes the script above with no problems. Why won't osql3 process the statement correctly? Is there something blatent I'm missing?

Notes: We are using Oracle 6 on a network of Suns.

Any comments/suggestions welcome and appreciated. ;-)##


Jeff Anderson                                      jeff_at_sporty.col.oh.us
H: 614-252-7563                                    jeff_at_sporty.UUCP
W: 614-249-0747                                    B7 f+ t w dc g+ k+ s+ r 
-------------------------------------------------------------------------------
Received on Tue May 04 1993 - 03:37:50 CEST

Original text of this message