10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Processing of SQL Statements<br />

In an OCCI application, you can also take advantage of PL/SQL, <strong>Oracle</strong>’s<br />

procedural extension to SQL. The applications you develop can be more powerful<br />

and flexible than applications written in SQL alone. OCCI also provides facilities for<br />

accessing and manipulating objects in an <strong>Oracle</strong> database server.<br />

Processing of SQL Statements<br />

One of the main tasks of an OCCI application is to process SQL statements.<br />

Different types of SQL statements require different processing steps in your<br />

program. It is important to take this into account when coding your OCCI<br />

application. <strong>Oracle</strong> recognizes several types of SQL statements:<br />

■ Data definition language (DDL) statements<br />

■ Control statements<br />

– Transaction control statements<br />

– Connection control statements<br />

– System control statements<br />

■ Data manipulation language (DML) statements<br />

■ Queries<br />

Data Definition Language Statements<br />

Data definition language (DDL) statements manage schema objects in the database.<br />

DDL statements create new tables, drop old tables, and establish other schema<br />

objects. They also control access to schema objects.<br />

The following is an example of creating and specifying access to a table:<br />

CREATE TABLE employees (<br />

name VARCHAR2(20),<br />

ssn VARCHAR2(12),<br />

empno NUMBER(6),<br />

mgr NUMBER(6),<br />

salary NUMBER(6))<br />

GRANT UPDATE, INSERT, DELETE ON employees TO donna<br />

REVOKE UPDATE ON employees FROM jamie<br />

DDL statements also allow you to work with objects in the <strong>Oracle</strong> database, as in<br />

the following series of statements which create an object table:<br />

Introduction to OCCI 1-5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!