Oracle9i Application Developer's Guide - Large Objects (LOBs)
Release 1 (9.0.1)

Part Number A88879-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

External LOBs (BFILEs), 9 of 41


Creating a Table with a Nested Table Containing a BFILE

Figure 12-5 Use Case Diagram: Creating a Table with a Nested Table Containing a BFILE


Text description of adl12b28.gif follows This link takes you back to the External LOBs (BFILES) main diagram. This link takes you back to the Creating a Table mother diagram.
Text description of the illustration adl12b28.gif

See Also:

"Use Case Model: External LOBs (BFILEs)" for all basic operations of External LOBs (BFILES). 

Purpose

This procedure describes how to create a table with nested table containing a BFILE.

Usage Notes

As shown in the use case diagram, you must create the object type that contains BFILE attributes before you create a nested table that uses that object type.

Syntax

Use the following syntax references:

Scenario

In our example, Multimedia_tab contains a nested table Inseg_ntab that includes type InSeg_typ. This type makes use of two LOB datatypes -- a BFILE for audio recordings of the interviews, and a CLOB for transcripts of the recordings.

We have already described how to create a table with BFILE columns (see "Creating a Table Containing One or More BFILE Columns"), so here we only describe the SQL syntax for creating the underlying object type.

Examples

The following example is provided in SQL and applies to all programmatic environments:

SQL: Creating a Table with a Nested Table Containing a BFILE

Because you use SQL DDL directly to create a table, the DBMS_LOB package is not relevant.

CREATE TYPE InSeg_typ AS OBJECT
(  Segment            NUMBER,
   Interview_Date     DATE,
   Interviewer        VARCHAR2(30),
   Interviewee        VARCHAR2(30),
   Recording          BFILE,
   Transcript         CLOB
);

Embedding the nested table is accomplished when the structure of the containing table is defined. In our example, this is done by the following statement when Multimedia_tab is created:

NESTED TABLE InSeg_ntab STORE AS InSeg_nestedtab;


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback