Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Executing Data Definition Language (DDL) statements

Data Definition Language (DDL) statements manage schema objects in the database. DDL statements create new tables, drop old tables, and establish other schema objects. They also control access to schema objects. For example:

Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

Set EmpDb = OO4OSession.OpenDatabase("ExampleDb", "scott/tiger", 0)

EmpDb.ExecuteSQL("create table employees (name VARCHAR2(20),

ssn VARCHAR2(12),

empno NUMBER(6),

mgr NUMBER(6),

salary NUMBER(6))")

EmpDb.ExecuteSQL("GRANT UPDATE, INSERT, DELETE ON employees TO

donna")

EmpDb.ExecuteSQL("REVOKE UPDATE ON employees FROM jamie")

DDL statements also allow you to work with objects in the Oracle database server. For example:

Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

Set EmpDb = OO4OSession.OpenDatabase("ExampleDb", "scott/tiger", 0)

EmpDb.ExecuteSQL("create type person_t

as object ( name VARCHAR2(30),

ssn VARCHAR2(12),

address VARCHAR2(50))")

EmpDb.ExecuteSQL("create table person_tab OF person_t")