Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-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

Functions, 136 of 166


TO_LOB

Syntax

to_lob::=


Text description of functions105a.gif follows
Text description of to_lob

Purpose

TO_LOB converts LONG or LONG RAW values in the column long_column to LOB values. You can apply this function only to a LONG or LONG RAW column, and only in the SELECT list of a subquery in an INSERT statement.

Before using this function, you must create a LOB column to receive the converted LONG values. To convert LONGs, create a CLOB column. To convert LONG RAWs, create a BLOB column.

See Also:

  • the modify_column_options clause of ALTER TABLE for an alternative method of converting LONG columns to LOB

  • INSERT for information on the subquery of an INSERT statement

 

Example

The sample table pm.print_media has a column press_release of type LONG. This example re-creates part of the table, with LOB data in the print_media column:

CREATE TABLE new_print_media (
   product_id       NUMBER(6),
   ad_id            NUMBER(6),
   press_release    CLOB);

INSERT INTO new_print_media
   (SELECT p.product_id, p.ad_id, TO_LOB(p.press_release)
      FROM print_media p);

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