iSelfSchooling.com - Copyright © 1999-2007 iSelfSchooling.com  References  Job Openings  |  Secure Login
    Home  | Search more...  |  FREE Online VIDEO Oracle Training  |  Gift Store  |  Bookstore

   Unlimited access!   

    Oracle  Syntax  | Suggestions Your Contribution  |  FREE Legal Forms

 

Email2aFriend Homepage us! |  Bookmark   -  Copyright & User Agreement

Products/Services

 Vision/Mission

 Community Sharing

 Services

  Products

 Biography

 Contact Us

 FAQ

 Current News

 Website Traffic

 Bookstore

 FREE Training

 SQL

 PL/SQL

 Forms 

 Reports

 Other TOOLS

 Fundamentals

 Performance

 OEM

 Application Server

 Grid Control

 Articles

 Prepare for OCP

Oracle SYNTAX

 Oracle Functions

 Oracle Syntax

 Oracle 10g Syntax

  PL/SQL Syntax

UNIX and more...

 UNIX for DBAs

 LINUX for DBAs

 DB using PHP

  A+ Certification

 Basics of JAVA  

 Tips of  SEO

Finance/Jobs

 Financial Aid

 Skilled

 Oracle

 Jobs

  Magazine

More Training

 Q & Answers

 SQL-PL/SQL

 DBA

 Developer

 Important Notes

 Case Studies

 9i New Features

 10g New Features

 10g Qs/As

 Grid Control

 OracleAS # I

 OracleAS # II

  LDAP and OID

  HTTP Server

 Instructor-Led

  Virtual Hosts

 Community Sharing

More to know...

Acknowledgement**

 FREE Legal Forms

 Who is who

 Market Place

 University Directory

 Advisory Articles

 Links...

 

 

FREE Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

BASICS

SQL | PL/SQL

DEVELOPERS

FORMS 2 | REPORTS | Other TOOLS

DBAs

FUNDAMENTALS 2 | PERFORMANCE | OEM

ADVANCE

APPLICATION SERVER | GRID CONTROL | ARTICLES 2 3 4

Advanced - Articles II

Lesson 01 | Lesson 02 | Lesson 03 | Lesson 04 | Lesson 05 | Lesson 06 | Lesson 07 | Lesson 08 | Lesson 09 | Lesson 10 | Lesson 11 | Lesson 12 | Lesson 13 | Lesson 14 | Lesson 15 | Lesson 16 | Lesson 17 | Lesson 18 | Lesson 19 | Lesson 20 | Lesson 21 | Lesson 22 | Lesson 23 | Lesson 24 | Lesson 25 | Lesson 26 | Lesson 27 | Lesson 28 | Lesson 29 | Lesson 30 | Lesson 31 | Lesson 32 | Lesson 33 | Lesson 34 | Lesson 35 |

Lesson 07

"So many gods, so many creeds; So many paths that wind and wind, while just the art of being kind is all the sad world needs." 

-Ella Wheeler Wilcox (1850-1919)

Examples of how to use DBMS_DDL package...

 

Examples of how to use DBMS_DDL package:

DBMS_OUTPUT

 

SQL> SET SERVEROUTPUT ON SIZE 400000

 

Create a table.

SQL> CREATE TABLE test01_4ddl_pkg

1 (col1 NUMBER)

2 /

 

Create a procedure.

SQL> CREATE OR REPLACE PROCEDURE test02_4ddl_pkg

1 AS

2 BEGIN

3 /* We created this procedure to show

4 how you can compile a procedure by

5 using the DBMS_DDL package. */

6 NULL;

7 END;

8 /

 

Change the object_name column size.

SQL> COL object_name FORMAT a20

 

Query the last analyzed time from USER_TABLES for the created table.

SQL> SELECT

1 TO_CHAR (LAST_ANALYZED,'mm-dd-yy hh24:mi:ss') last_analyzed_time

2 FROM USER_TABLES

3 WHERE TABLE_NAME = 'TEST01_4DDL_PKG'

4 /

 

Query the last ddl time from the USER_OBJECTS table for the

created procedure.

SQL> SELECT object_name,

1 to_char(last_ddl_time,'mm-dd-yy hh24:mi:ss') ddl_time

2 FROM user_objects

3 WHERE object_name = 'TEST02_4DDL_PKG'

4 /

Use the DBMS_DDL.ANALYZE_OBJECT procedure to analyze the

created table.

SQL> BEGIN

1 DBMS_DDL.ANALYZE_OBJECT

2 ('TABLE','ISELF','TEST01_4DDL_PKG','COMPUTE');

3 END;

4 /

SQL>

 

Query the last analyzed time from USER_TABLES for the created table.

Check the difference from pervious query.

SQL> SELECT

TO_CHAR (LAST_ANALYZED,'mm-dd-yy hh24:mi:ss') last_analyzed_time

1 FROM USER_TABLES

2 WHERE TABLE_NAME = 'TEST01_4DDL_PKG'

3 /

 

Use the DBMS_DDL.ALTER_COMPILE procedure to compile the

created procedure.

SQL> BEGIN

1 DBMS_DDL.ALTER_COMPILE

('PROCEDURE','ISELF','TEST02_4DDL_PKG');

2 END;

3 /

 

Query the last ddl time from the USER_OBJECTS table for the

created procedure.

Check the difference from pervious query.

SQL> SELECT object_name,

to_char(last_ddl_time,'mm-dd-yy hh24:mi:ss') ddl_time

1 FROM user_objects

2 WHERE object_name = 'TEST02_4DDL_PKG'

3 /

 

 

 
 
Google
 
Web web site