Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Inserting NULL into BLOB / LONG RAW

RE: Inserting NULL into BLOB / LONG RAW

From: Steve Orr <sorr_at_arzoo.com>
Date: Mon, 6 Nov 2000 16:07:04 -0800
Message-Id: <10672.121263@fatcity.com>


You can also set the default value for the column as empty_blob() when you create the table. This takes care of the problem once and for all so you don't have to worry about it anymore. This is a built-in Oracle function. See page 4-33 of the SQL Reference. You may want to alter the table to add this default for the blob columns then initialize them with the empty_blob() "value."

Steve Orr

-----Original Message-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Jack C. Applewhite
Sent: Monday, November 06, 2000 3:46 PM
To: Multiple recipients of list ORACLE-L Subject: Re: Inserting NULL into BLOB / LONG RAW

Helmut Daiminger wrote:

> Hi!
>
> Is it a problem inserting NULL into BLOB or LONG RAW columns? The colums
were
> defined to allow NULL values. We are experiencing difficulties inserting
into a
> table after the colum has been changed vom LONG RAW to BLOB.
>
> Are NULLs handled differently in those data types? This is 8.1.6
>
> Thanks,
> Helmut

You can initialize a LOB to Null, but it causes problems later if you try to use
the DBMS_LOB package to populate the LOB column(s). Below is from Chapter 2 of
the 8.1.6. "Oracle8i Application Developer's Guide - Large Objects (LOBs)":




...
Initializing Internal LOBs to NULL or Empty

You can set an internal LOB -- that is, a LOB column in a table, or a LOB attribute in an object type defined by you-- to be NULL or empty:

Setting an Internal LOB to NULL: A LOB set to NULL has no locator. A NULL value
is stored in the row in the table, not a locator. This is the same process as for
all other datatypes.

Setting an Internal LOB to Empty: By contrast, an empty LOB stored in a table is
a LOB of zero length that has a locator. So, if you SELECT from an empty LOB column or attribute, you get back a locator which you can use to populate the LOB
with data via one of the six programmatic environments, such as OCI or PL/SQL(DBMS_LOB). See Chapter 3, "LOB Programmatic Environments". ...


Hope this helps.

Jack

--
Jack C. Applewhite
Senior Consultant, OCP Oracle8 DBA
Stonebridge Technologies, Inc.
...The Fast Track to e-Business.
  (visit us at www.sbti.com)
Austin, Texas
1.512.502.3337


--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Jack C. Applewhite
  INET: Jack.Applewhite_at_sbti.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Mon Nov 06 2000 - 18:07:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US