15 pts.
 compile C++ program with embedded SQL
C, SQL
I am trying to insert and update into a oracle table from my C++ program. When I compile the program, it does not insert or update anything. Apparently I had to use the DECLARE TABLE to declare the table, because my program cannot find the table. I compile with another user as the schema where the table is. When I add the schema name in front of the table in the DECLARE TABLE, I got the following errors: Error at line 36, column 10 in file embsql_account_test.pc EXEC SQL DECLARE CDRUSER.ACCOUNT_TEST2 TABLE^M .........1 PLS-S-00103, Encountered the symbol "(" when expecting one of the following: . of Error at line 36, column 10 in file embsql_account_test.pc EXEC SQL DECLARE CDRUSER.ACCOUNT_TEST2 TABLE^M .........1 PLS-S-00103, Encountered the symbol "end-of-file" when expecting one of the following: begin function package pragma procedure subtype type use <an identifier> <a double-quoted delimited-identifier> form current cursor Semantic error at line 36, column 10, file embsql_account_test.pc: EXEC SQL DECLARE CDRUSER.ACCOUNT_TEST2 TABLE^M .........1 PCC-S-02347, PL/SQL found syntax errors When I remove the schema name in front of the table, the errors are on every line of my program. Sorry, I don't have much embedded sql experience. Any suggestions will be highly appreciated. Thanks and regards Bonita

Software/Hardware used:
ASKED: May 9, 2006  9:46 AM
UPDATED: May 14, 2006  1:44 AM

Answer Wiki:
Hi to all, As per my knowledge, tables are not supposed to be declared in a PRO*C program. Also, at compile time I think that no database object checks are performed. The table, just like other database objects, should be known at run time for the Oracle username which is used for connecting to the database in the same PRO*C program. If the connecting user is not the owner of the table, then you may either prefix the table name with the owner name IN THE SQL STATEMENT ( SELECT, INSERT, a.s.o.) or define a private or public synonym for the table at the database level. Hope this could help. Best Rgds, Iudith
Last Wiki Answer Submitted:  May 14, 2006  1:44 am  by  Welcome   0 pts.
All Answer Wiki Contributors:  Welcome   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _