OCILIB (C and C++ Driver for Oracle)
4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
OcilibCApiTransactions
Executing SQL statements or PL/SQL blocks is really simple with OCILIB.
First, call OCI_StatementCreate() to allocate a statement handle. Then :
These two steps can be done together by calling OCI_ExecuteStmt() that prepares and executes in one go.
To find out if the statement has affected any rows, call OCI_GetAffectedRows()
Finally, release the statement and its resources with OCI_StatementFree()
Functions | |
OCI_SYM_PUBLIC OCI_Statement *OCI_API | OCI_StatementCreate (OCI_Connection *con) |
Create a statement object and return its handle. | |
OCI_SYM_PUBLIC boolean OCI_API | OCI_StatementFree (OCI_Statement *stmt) |
Free a statement and all resources associated to it (resultsets ...) | |
OCI_SYM_PUBLIC boolean OCI_API | OCI_Prepare (OCI_Statement *stmt, const otext *sql) |
Prepare a SQL statement or PL/SQL block. | |
OCI_SYM_PUBLIC boolean OCI_API | OCI_Execute (OCI_Statement *stmt) |
Execute a prepared SQL statement or PL/SQL block. | |
OCI_SYM_PUBLIC boolean OCI_API | OCI_ExecuteStmt (OCI_Statement *stmt, const otext *sql) |
Prepare and Execute a SQL statement or PL/SQL block. | |
OCI_SYM_PUBLIC boolean OCI_API | OCI_Parse (OCI_Statement *stmt, const otext *sql) |
Parse a SQL statement or PL/SQL block. | |
OCI_SYM_PUBLIC boolean OCI_API | OCI_Describe (OCI_Statement *stmt, const otext *sql) |
Describe the select list of a SQL select statement. | |
OCI_SYM_PUBLIC const otext *OCI_API | OCI_GetSql (OCI_Statement *stmt) |
Return the last SQL or PL/SQL statement prepared or executed by the statement. | |
OCI_SYM_PUBLIC const otext *OCI_API | OCI_GetSqlIdentifier (OCI_Statement *stmt) |
Returns the statement SQL_ID from the server. | |
OCI_SYM_PUBLIC unsigned int OCI_API | OCI_GetSqlErrorPos (OCI_Statement *stmt) |
Return the error position (in terms of characters) in the SQL statement where the error occurred in case of SQL parsing error. | |
OCI_SYM_PUBLIC unsigned int OCI_API | OCI_GetAffectedRows (OCI_Statement *stmt) |
Return the number of rows affected by the SQL statement. | |
OCI_SYM_PUBLIC unsigned int OCI_API | OCI_GetSQLCommand (OCI_Statement *stmt) |
Return the Oracle SQL code the command held by the statement handle. | |
OCI_SYM_PUBLIC const otext *OCI_API | OCI_GetSQLVerb (OCI_Statement *stmt) |
Return the verb of the SQL command held by the statement handle. | |
OCI_SYM_PUBLIC OCI_Statement *OCI_API OCI_StatementCreate | ( | OCI_Connection * | con | ) |
#include <api.h>
Create a statement object and return its handle.
con | - Connection handle |
Referenced by ocilib::Statement::Statement().
OCI_SYM_PUBLIC boolean OCI_API OCI_StatementFree | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Free a statement and all resources associated to it (resultsets ...)
stmt | - Connection handle |
OCI_SYM_PUBLIC boolean OCI_API OCI_Prepare | ( | OCI_Statement * | stmt, |
const otext * | sql | ||
) |
#include <api.h>
Prepare a SQL statement or PL/SQL block.
stmt | - Statement handle |
sql | - SQL order or PL/SQL block |
Referenced by ocilib::Statement::Prepare().
OCI_SYM_PUBLIC boolean OCI_API OCI_Execute | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Execute a prepared SQL statement or PL/SQL block.
stmt | - Statement handle |
Referenced by ocilib::Statement::ExecutePrepared().
OCI_SYM_PUBLIC boolean OCI_API OCI_ExecuteStmt | ( | OCI_Statement * | stmt, |
const otext * | sql | ||
) |
#include <api.h>
Prepare and Execute a SQL statement or PL/SQL block.
stmt | - Statement handle |
sql | - SQL order - PL/SQL block |
Referenced by ocilib::Statement::Execute().
OCI_SYM_PUBLIC boolean OCI_API OCI_Parse | ( | OCI_Statement * | stmt, |
const otext * | sql | ||
) |
#include <api.h>
Parse a SQL statement or PL/SQL block.
stmt | - Statement handle |
sql | - SQL order - PL/SQL block |
Referenced by ocilib::Statement::Parse().
OCI_SYM_PUBLIC boolean OCI_API OCI_Describe | ( | OCI_Statement * | stmt, |
const otext * | sql | ||
) |
#include <api.h>
Describe the select list of a SQL select statement.
stmt | - Statement handle |
sql | - SELECT sql statement |
Referenced by ocilib::Statement::Describe().
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSql | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Return the last SQL or PL/SQL statement prepared or executed by the statement.
stmt | - Statement handle |
Referenced by ocilib::Statement::GetSql().
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSqlIdentifier | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Returns the statement SQL_ID from the server.
stmt | - Statement handle |
Referenced by ocilib::Statement::GetSqlIdentifier().
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetSqlErrorPos | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Return the error position (in terms of characters) in the SQL statement where the error occurred in case of SQL parsing error.
stmt | - Statement handle |
Referenced by ocilib::Statement::GetSqlErrorPos().
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetAffectedRows | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Return the number of rows affected by the SQL statement.
stmt | - Statement handle |
The returned value is :
Referenced by ocilib::Statement::GetAffectedRows().
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetSQLCommand | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Return the Oracle SQL code the command held by the statement handle.
stmt | - Statement handle |
Referenced by ocilib::Statement::GetSQLCommand().
OCI_SYM_PUBLIC const otext *OCI_API OCI_GetSQLVerb | ( | OCI_Statement * | stmt | ) |
#include <api.h>
Return the verb of the SQL command held by the statement handle.
stmt | - Statement handle |
Referenced by ocilib::Statement::GetSQLVerb().