-->

04 June 2021

How to load images,sound clips and documents using SQL Loader

  Asp.Net CS By Example       04 June 2021
 How to load images,sound clips and documents using SQL Loader 
    In this post, we are learning about how to load images,sound clips and documents using SQL Loader. SQL*Loader can load data from a PDF (Primary Data File), SDF (Secondary Data file - for loading nested tables and VARRAYs) or LOBFILE. The LOBFILE method provides an easy way to load documents, photos, images and audio clips into BLOB and CLOB columns.


Look at this example:

  Create document table. 
   create table doc_table 
   (
        doc_id      number(10),
        doc_name    varchar2(25), 
        doc_data    BLOB
   );     



 example1.ctl (Control File)  
 OPTIONS (SKIP=1)
 LOAD DATA
 INFILE *
 INSERT into table doc_table
 field terminated by ","
 ( 
   doc_id   INTEGER(5),
   doc_name  CHAR(30),
   doc_data LOBFILE (doc_name) TERMINATED BY EOF 
  )
  BEGINDATA
  001,image1.gif
  002,image2.jpg
  003,image3.jpg
 



logoblog

Thanks for reading How to load images,sound clips and documents using SQL Loader

Newest
You are reading the newest post

No comments:

Post a Comment

Please do not enter any spam link in the comment box.