05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 15 ■ DATA LOADING AND UNLOADING 677<br />

To load a LOB into an ORDIMAGE type column, we must underst<strong>and</strong> a little more about the<br />

structure of the ORDIMAGE type. Using a table we want to load into, <strong>and</strong> a DESCRIBE on that table<br />

in SQL*Plus, we can discover that we have a column called IMAGE of type ORDSYS.ORDIMAGE,<br />

which we want to ultimately load into IMAGE.SOURCE.LOCALDATA. The following examples<br />

will work only if you have interMedia installed <strong>and</strong> configured; otherwise, the datatype<br />

ORDSYS.ORDIMAGE will be an unknown type:<br />

ops$tkyte@ORA10G> create table image_load(<br />

2 id number,<br />

3 name varchar2(255),<br />

4 image ordsys.ordimage<br />

5 )<br />

6 /<br />

Table created.<br />

ops$tkyte@ORA10G> desc image_load<br />

Name Null? Type<br />

---------------------------------------- -------- ----------------------------<br />

ID<br />

NUMBER<br />

NAME<br />

VARCHAR2(255)<br />

IMAGE<br />

ORDSYS.ORDIMAGE<br />

ops$tkyte@ORA10G> desc ordsys.ordimage<br />

Name Null? Type<br />

---------------------------------------- -------- ----------------------------<br />

SOURCE<br />

ORDSYS.ORDSOURCE<br />

HEIGHT<br />

NUMBER(38)<br />

WIDTH<br />

NUMBER(38)<br />

CONTENTLENGTH<br />

NUMBER(38)<br />

...<br />

ops$tkyte@ORA10G> desc ordsys.ordsource<br />

Name Null? Type<br />

---------------------------------------- -------- ----------------------------<br />

LOCALDATA<br />

BLOB<br />

SRCTYPE<br />

VARCHAR2(4000)<br />

SRCLOCATION<br />

VARCHAR2(4000)<br />

...<br />

■Note You could issue SET DESC DEPTH ALL or SET DESC DEPTH in SQL*Plus to have the entire<br />

hierarchy displayed at once. Given that the output for the ORDSYS.ORDIMAGE would have been many pages<br />

long, I chose to do it piece by piece.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!