[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
EmbeddedSql
You might need an ?ODBC API.
SQLCA is short for 'SQL Communications Area'. You need to include/add this file to your program to enable communication and error handling.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
EmbeddedSql
(SQL) Embedded SQL
SQL called from another programming language.IBM
Syntax EXEC SQL [your SQL statement] ;
C example
long age = 0; //'int' is not supported
EXEC SQL select age into :age from database;
You might need an ?ODBC API.
Embedded SQL statements
EXEC SQL INCLUDE SQLCA;
SQLCA is short for 'SQL Communications Area'. You need to include/add this file to your program to enable communication and error handling.
SQLCODE values
Summarized:0 Okay >0 Warning <0 ErrorMore codes at http://www.caliberdt.com/tips/sqlcode.htm
SQLSTATE values
Translated from the Dutch site http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/conn/t0004769.htm00 Unqualified successful execution 01 Warning 02 No data 21 Cardinality violation 22 Data exception 23 Violation of condition 24 Incorrect cursor position 26 Incorrect SQL-instruction-ID 40 ROLLBACK of transaction 42 Violation of access rights 51 Invalid execution status 55 The object does not have the required status 56 SQL- or product error 57 Resource unavailable or intervenience of user 58 System error
External links
- Wikipedia: http://en.wikipedia.org/wiki/Embedded_SQL
- IBM: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/c0005909.htm
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
