One of our developers has written a program to upload files into the database via 
perl.  The actual file contents are stored in a blob.

The table was created with the following script

CREATE TABLE BP_FILES
 (FILE_ID NUMBER(7,0) NOT NULL
 ,FILE_TYPE VARCHAR2(1) NOT NULL
 ,FILE_FORMAT VARCHAR2(1) NOT NULL
 ,FILE_NAME VARCHAR2(80) NOT NULL
 ,FILE_PRIVATE VARCHAR2(1) NOT NULL
 ,COMMENTS VARCHAR2(240)
 ,DATE_CREATED DATE NOT NULL
 ,CREATED_BY VARCHAR2(30) NOT NULL
 ,DATE_UPDATED DATE
 ,UPDATED_BY VARCHAR2(30)
 ,CONTENT_TYPE VARCHAR2(240)
 ,CONTENT_DISPOSITION VARCHAR2(240)
 ,FILE_DATA BLOB
 Lob(FILE_DATA) STORE AS babar_papers_lob 
 (TABLESPACE BABAR_PAPERS_DATA
 PCTVERSION 5
 ENABLE STORAGE IN ROW
 CHUNK 8192
 NOCACHE LOGGING)
/
----------------------------------------------------------------------------------------------
The owner of the table can perform inserts including BLOB  data without problems.  
Other users can insert rows which do not contain BLOB data without problems, but when 
they  try to insert a row which contains BLOB data the following error is issued ...

ORA-01031: insufficient privileges (DBD ERROR: OCILobTrim/OCILobWrite/LOB refetch) 


The statement involved is

insert into <owner>.BP_FILES ( file_id, file_type, file_format, file_name, 
file_private, comments, file_data, date_created, created_by, date_updated, updated_by, 
content_type, content_disposition ) VALUES ( ?, ?, ?, ?, ?, ?, ?, SYSDATE, ?, SYSDATE, 
?, ?, ? )

The question marks are place-holders for bind variables in Perl.


Ian MacGregor




-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: MacGregor, Ian A.
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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
also send the HELP command for other information (like subscribing).

Reply via email to