Invalid empty lob operation

Sir,
Following code generates "INVALID EMPTY LOB OPERATION" when called through PL/SQL:
import javax.mail.*;
import javax.mail.internet.*;
import java.lang.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import oracle.jdbc.*;
import oracle.sql.*;
public class pmJava
public static void MailClient(String[] args){
if (args.length == 0) {
System.err.println(
"Usage: MailClient protocol://username:password@host:port/foldername msgNum");
return;
URLName server = new URLName(args[0]);
int msgNum = 1;
try {
Connection conn=DriverManager.getConnection("jdbc:default:connection");
Session session = Session.getDefaultInstance(new Properties(), null);
// Connect to the server and open the folder
Folder folder = session.getFolder(server);
if (folder == null) {
System.out.println("Folder " + server.getFile() + " not found.");
System.exit(1);
folder.open(Folder.READ_ONLY);
byte[] buffer = new byte[10*1024];
// Get the messages from the server
Message[] messages = folder.getMessages();
// for (int i = 0; i < messages.length; i++) {
for (int i = msgNum; i <=msgNum; i++) {
System.out.println("------------ Message " + (i+1)
+ " ------------");
InputStream is = messages.getInputStream();
if (!(is instanceof BufferedInputStream))
is = new BufferedInputStream(is);
int isIndex;
BLOB msgContent = BLOB.createTemporary(conn,false,BLOB.DURATION_SESSION);
msgContent = BLOB.empty_lob();
OutputStream os = msgContent.getBinaryOutputStream();
while ((isIndex = is.read(buffer)) != -1)
os.write(buffer);
os.close();
folder.close(false);
catch (Exception e) {
e.printStackTrace();
i want to store the message contents in BLOB variable and then want to insert into database field using JavaMail 1.3API.
Regards,
Manpreet Johal

I believe you will want to use oracle.sql.BLOB.createTemporary(java.sql.Connection conn, boolean cache, int _duration).
Refer to the API at:
http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/sql/BLOB.html

Similar Messages

  • Java.sql.SQLException: Invalid empty lob operation

    I have a java source based stored function in which I try
    to build a BLOB. Essential this is what I do:
    1: oracle.sql.BLOB result = oracle.sql.BLOB.empty_lob();
    2: byte[] bytes = new byte[ length ];
    3: bytes = do_something();
    4: result.putBytes( 1 , bytes )
    the java.sql.SQLException happens as a result of line 4.
    I have a wage understanding of what this exception is trying
    to say, but can someone tell me what I need to do????
    Btw.: What is the best reference documentation for the
    oracle.sql classes???
    :-) Roald

    I believe you will want to use oracle.sql.BLOB.createTemporary(java.sql.Connection conn, boolean cache, int _duration).
    Refer to the API at:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/sql/BLOB.html

  • ORA-22288: file or LOB operation FILEOPEN failed (The data is invalid)

    Dear All,
    I am trying to insert a image file (gif) to one of my field.
    1. Here is my table structure and trying to insert gif image file to PIC file.
    SQL> desc cis2.david_pic
    Name Null? Type
    ID VARCHAR2(5)
    PIC BLOB
    2. I using sql command to create directory and the path is pointing where the DB
    server was installed.
    SQL> create or replace directory MY_FILES as '\\hkqaa-db1\TEXT_IMPORT';
    3. Written a script to insert empty blob first and than trying to use the dbms_lob.fileopen
    to upload the gif file.
    SQL> declare
    2 l_blob blob;
    3 l_bfile bfile;
    4 begin
    5 insert into cis2.david_pic values ( '1', empty_blob())
    6 returning pic into l_blob;
    7 l_bfile := bfilename('MY_FILES', 'bess_signature.gif');
    8 dbms_lob.fileopen(l_bfile);
    9 dbms_lob.loadfromfile(l_blob, l_bfile, dbms_lob.getlength(l_bfile));
    10 dbms_lob.fileclose(l_bfile);
    11 end;
    12 /
    4. After I ran my script I got this error message.
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The data is invalid.
    ORA-06512: at "SYS.DBMS_LOB", line 475
    ORA-06512: at line 8
    Can any tell me what wrong? is this the way to insert image?
    Thanks

    Know this is an old post: (for sharing sake.)
    Please try avoiding
    1. the 'hyphen' in between the path (hkqaadb1 instead of hkqaa-db1)
    2. Give direct path like 'C:\TEXT_IMPORT' instead of network path.
    create or replace directory MY_FILES as '\\hkqaa-db1\TEXT_IMPORT'; -- Not working.
    create or replace directory MY_FILES as 'C:\hkqaadb1\TEXT_IMPORT'; -- Working.
    and this worked fine.
    Edited by: Arunan.KL on Mar 23, 2011 5:04 PM

  • Getting ORA-22288: file or LOB operation FILEOPEN failed in Windows XP

    Hi All,
    I am getting the error message
    ORA-22288: file or LOB operation FILEOPEN failed
    when I attempt to call a stored procedure containing the following code.
    bfile_in := BFILENAME( 'SP_IMPORT_NIF20_DIR', v_filename );
    /* Open the input file */
    DBMS_LOB.FILEOPEN(bfile_in);
    It works fine on UNIX but fails when running on my Windows XP Pro Oracle 9i install. I suspect that it has something do to with the file permissions. I can get this same error on UNIX if the file permissions are not set correctly. I get it every time on Windows XP Pro even though I think that the file permissions are
    set correctly. Perhaps the Windows XP Pro permissions are not as I think! or perhaps the Oracle instance needs to be granted access to the XP directories etc. I am not sure how this would be done.
    Any suggestions much appreciated.

    You have EXPLORER set to "Use Simple File Sharing". Uncheck that option for the folders and you will get the security tab.
    I am not sure why you can't run Oracle as a specific user. I do this all the time. In fact, I create an Oracle group and add a user called Oracle and then configure that user/group for all the permissions it needs (and none it doesn't), environment set up, etc. and then run the service as that user. Can you get a specific error message?
    As a side note, I am clueless why Oracle doesn't do this for you. They do on Unix installs.

  • Invalid property get operation; subform doesn't have property 'rawValue'

    Hello,
    I have a form where on the Submit button I'm putting JavaScript that checks each field and radio button set to ensure the user has filled something in. I have used this script before successfully, but this time it is not working and for the life of me I can't see what wrong. Also, I've not encountered this particular error message before. Here is the text I am seeing on clicking the Submit button:
    Acrobat JavaScript Debugger Functions Version 11.0
    Acrobat EScript Built-in Functions Version 11.0
    Acrobat SOAP 11.0
    Exception in line 5 of function top_level, script XFA:form1[0]:page2[0]:buttons[0]:Button1[0]:click
    GeneralError: Operation failed.
    XFAObject.rawValue:5:XFA:form1[0]:page2[0]:buttons[0]:Button1[0]:click
    Invalid property get operation; subform doesn't have property 'rawValue'
    I'm glad to share my script if that's helpful as well.
    Thanks in advance for your help,
    MDawn.

    Here's the script:
    var v1 = page1.firstPage.positioned.firstLine.reqType.rawValue;
    var v2 = page1.firstPage.positioned.firstLine.orderQuote.rawValue;
    var v3 = page1.firstPage.positioned.description.rawValue;
    var v4 = page1.firstPage.positioned.rentExempt.rawValue;
    var v5 = page1.firstPage.positioned.header.posSub.storeNbr.rawValue;
    var v6 = page1.firstPage.positioned.header.posSub.storeName.rawValue;
    var v7 = page1.firstPage.positioned.header.posSub.RadioButtonList.rawValue;
    var v8 = page1.firstPage.positioned.header.posSub.storeContact.rawValue;
    var v9 = page1.firstPage.positioned.header.posSub.email.rawValue;
    var v10 = page1.firstPage.positioned.header.posSub.contactsPhone.rawValue;
    var v11 = page1.firstPage.positioned.header.posSub.custName.rawValue;
    var v12 = page1.firstPage.positioned.header.posSub.custPhone.rawValue;
    var v13 = page1.firstPage.positioned.header.posSub.custEmail.rawValue;
    var v14 = page1.firstPage.positioned.dateNeeded.RadioButtonList.rawValue;
    var v15 = page1.firstPage.positioned.dateNeeded.addlInfo.DateTimeField2.rawValue;
    var v16 = page1.firstPage.positioned.dateNeeded.addlInfo.rushFees.rawValue;
    var v17 = page1.firstPage.positioned.dateNeeded.rushProcessingFees.rushFeePrices.rawValue;
    var v18 = page1.firstPage.positioned.dateNeeded.rushProcessingFees.RadioButtonList.rawValue;
    var v19 = page1.firstPage.positioned.chairsArtInfo.RadioButtonList.rawValue;
    var v20 = page2.personalization.header.RadioButtonList.rawValue;
    var v21 = page2.shipping.shipTo.RadioButtonList.rawValue;
    var v22 = page2.shipping.customerAddress.rawValue;
    var v23 = page2.shipping.rushOrders.RadioButtonList.rawValue;
    //REQUEST
    if ((v1 == "") || (v1 == null))
       xfa.host.messageBox( "Please select the type of request" );
       xfa.host.setFocus("page1.firstPage.positioned.firstLine.reqType");
    //ORDER_QUOTE
    } else {
    if ((v2 == "") || (v2 == null))
        xfa.host.messageBox( "Please indicate whether this is an order or quote" );
      xfa.host.setFocus ("page1.firstPage.positioned.firstLine.orderQuote");
    //DESCRIPTION
    } else {
      if (((v1 == "3")) && ((v3 == "" || v3 == null)))
      xfa.host.messageBox( "Please enter a description" );
      xfa.host.setFocus("page1.firstPage.positioned.description");
    //RENT EXEMPT
    } else {
      if (((v1 == "2")) && ((v4 == "" || v4 == null)))
      xfa.host.messageBox( "Please indicate if the order is rent exempt or royalty exempt" );
      xfa.host.setFocus("page1.firstPage.positioned.rentExempt");
    //STORE NUMBER
    } else {
      if ((v5 == "" || v5 == null))
         xfa.host.messageBox( "Please enter the store number" );
         xfa.host.setFocus("page1.firstPage.positioned.header.posSub.storeNbr");
    //SCHOOL'S NAME
    } else {
      if ((v6 == "" || v6 == null))
         xfa.host.messageBox( "Please enter the school's name" ); 
      xfa.host.setFocus ("page1.firstPage.positioned.header.posSub.storeName");
    //COUNTRY
    } else {
    if ((v7 == "") || (v7 == null))
      xfa.host.messageBox( "Please enter the store's country" );
      xfa.host.setFocus("page1.firstPage.positioned.header.posSub.RadioButtonList");
    //STORE CONTACT
    } else {
    if ((v8 == "") || (v8 == null))
      xfa.host.messageBox( "Please enter the name of the store's contact person" );
      xfa.host.setFocus("page1.firstPage.positioned.header.posSub.storeContact");
    //CONTACT'S EMAIL
    } else {
      if ((v9 == "" || v9 == null))
         xfa.host.messageBox( "Please enter the store contact's email address" );
         xfa.host.setFocus("page1.firstPage.positioned.header.posSub.email");
    //CONTACT'S PHONE
    } else {
    if ((v10 == "") || (v10 == null))
      xfa.host.messageBox( "Please enter the customer's telephone number" );
      xfa.host.setFocus("page1.firstPage.positioned.header.posSub.contactsPhone");
    //CUSTOMER NAME
    } else {
    if ((v11 == "") || (v11 == null))
      xfa.host.messageBox( "Please enter the customer's name" );
      xfa.host.setFocus("page1.firstPage.positioned.header.posSub.custName");
    //CUSTOMER PHONE
    } else {
      if ((v12 == "" || v12 == null))
         xfa.host.messageBox( "Please enter the customer's telephone number" );
         xfa.host.setFocus("page1.firstPage.positioned.header.posSub.custPhone");
    //CUSTOMER EMAIL
    } else {
    if ((v13 == "") || (v13 == null))
      xfa.host.messageBox( "Please the customer's email address" );
      xfa.host.setFocus("page1.firstPage.positioned.header.posSub.custEmail");
    //DATE NEEDED
    } else {
    if ((v15 == "") || (v15 == null))
      xfa.host.messageBox( "Please whether the order is needed by a specific date" );
      xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.RadioButtonList");
    //SPECIFIC DATE
    } else {
      if ((v16 == "" || v16 == null))
         xfa.host.messageBox( "Please enter date the order is needed" );
         xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.addlInfo.DateTimeField2");
    //RUSH FEES
    } else {
      if ((v17 == "" || v17 == null))
         xfa.host.messageBox( "Please indicate if rush fees are applicable" );
         xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.addlInfo.rushFees");
    //RUSH PROCESSING FEES
    } else {
      if ((v18 == "" || v18 == null))
         xfa.host.messageBox( "Please select the rush processing fee that is wanted" );
         xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.rushProcessingFees.RadioButtonLi st");
    //CHAIR ART INFORMATION
    } else {
      if ((v19 == "" || v1 == null))
         xfa.host.messageBox( "Please identify the format of the art for the chair" );
         xfa.host.setFocus("page1.firstPage.positioned.chairsArtInfo.RadioButtonList");
    //PERSONALIZATION
    } else {
      if ((v20 == "" || v20 == null))
         xfa.host.messageBox( "Please identify whether personalization is needed for this order" );
         xfa.host.setFocus("page2.personalization.header.RadioButtonList");
    //SHIPPING INFO
    } else {
      if ((v21 == "" || v21 == null))
         xfa.host.messageBox( "Please identify where the order will be shipped" );
      xfa.host.setFocus("page2.shipping.shipTo.RadioButtonList");
    //CUSTOMER'S ADDRESS
    } else {
      if ((v22 == "" || v22 == null))
         xfa.host.messageBox( "Please provide the customer's address" );
         xfa.host.setFocus("page2.shipping.customerAddress");
    //RUSH FEE
    } else {
      if ((v23 == "" || v23 == null))
         xfa.host.messageBox( "Please select the rush fee that the customer wants" );
         xfa.host.setFocus("page2.shipping.rushOrders.RadioButtonList");
    } else {
      Button2.execEvent("click");

  • Qosmio F50 - Webcam error - Invalid floating point operation

    Hi
    I have Qosmio F50 (4 Weeks old) problem is after two weeks webcam has stopped working *Invalid floating point operation*
    I have to close program via task manager, *Camera assistant software not responding*.
    Have tried following.
    Update all drivers, system restore
    Toshiba help line after all efforts suggested complete reinstall this is to aggressive for me as it would loose certain software on laptop that I had to transfer from old PC and had to plead with certain software companies to transfer (only one license etc).
    Has anybody else had this problem and is there a simple solution
    Will

    Hi,
    I have the same problem, Laptop Qosmio F50 is 4 weeks old and now the webcam stopped working.... it's quite annoying, whenever I start the application it says ' Invalid floating point operation'. To me this sounds as some issues in the software and the compatibility on vista, I think it could happen after putting the laptop to hibernate or suspension state and then when it comes back, the webcam stops working. so let's see if toshiba realeases a fix or new version quickly, otherwise I would be quite disspointed with such a good laptop.

  • Error - "Invalid floating point operation"

    I keep getting a message that says "invalid floating point operation" and the files that I am trying to read are scrambled.  They used to be ok.  Please advise....

    Hi,
    I have the same problem, Laptop Qosmio F50 is 4 weeks old and now the webcam stopped working.... it's quite annoying, whenever I start the application it says ' Invalid floating point operation'. To me this sounds as some issues in the software and the compatibility on vista, I think it could happen after putting the laptop to hibernate or suspension state and then when it comes back, the webcam stops working. so let's see if toshiba realeases a fix or new version quickly, otherwise I would be quite disspointed with such a good laptop.

  • Inserting image to table...ORA-22288: file or LOB operation FILEOPEN failed

    Good day!
    I'm just new with using databases, and i'm enjoying it.
    So I read that you can insert images to a table, and so i decided to try it... and here's where I'm at..
    *I made a directory
    CREATE directory image_dir as 'D:\Images';
    --Directory Created.
    *I created a table
    CREATE TABLE animages
    (aname VARCHAR2(40),
    breedno NUMBER(10),
    image_file BLOB,
    image_name VARCHAR2(40),
    CONSTRAINT aname_fk FOREIGN KEY (aname) REFERENCES clist(aname));
    --Table Created.
    *Then I made a procedure for inserting the images
    CREATE OR REPLACE PROCEDURE insert_image_file (p_aname VARCHAR2, p_breedno NUMBER, p_image_name IN VARCHAR2)
    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := BFILENAME('IMAGE_DIR', p_image_name);
    INSERT INTO animages
         (aname, breedno, image_file, image_name)
    VALUES (p_aname, p_breedno, EMPTY_BLOB(), p_image_name)
    RETURNING image_file
    INTO dst_file;
    SELECT image_file
    INTO dst_file
    FROM animages
    WHERE aname = p_aname AND image_name = p_image_name
    FOR UPDATE;
    DBMS_LOB.fileopen(src_file, DBMS_LOB.file_readonly);
    lgh_file := DBMS_LOB.getlength(src_file);
    DBMS_LOB.loadfromfile(dst_file, src_file, lgh_file);
    UPDATE animages
    SET image_file = dst_file
    WHERE aname = p_aname AND image_name = p_image_name;
    DBMS_LOB.fileclose(src_file);
    END;
    --Procedure Created.
    *So i was able to do those but when i was trying to execute the procedure i get this error..
    execute insert_image_file('African Elephant', 60, 'African_Elephant');
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    The device is not ready.
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SCOTT.INSERT_IMAGE_FILE", line 18
    ORA-06512: at line 1
    I've been looking for a solution for a day now, hope someone could help me, thanks.
    BTW, I got the code for the PROCEDURE from a user named Aparna16, just did some minor editing so it would fit my tables, thanks.
    And sorry if the post is too long.

    Hi;
    ORA-22288:Error:     ORA-22288
    Text:     file or LOB operation %s failed %s
    Cause:     The operation attempted on the file or LOB failed.
    Action:     See the next error message in the error stack for more detailed
         information. Also, verify that the file or LOB exists and that the
         necessary privileges are set for the specified operation. If the error
         still persists, report the error to the DBA.
    Regard
    Helios

  • ORA-22288: file or LOB operation FILEOPEN failed Permission denied

    I have installed Oracle XE (Universal) on Fedora Core 8
    I am trying to update Apex to 3.1.1. I have downloaded and extracted the zip file using unizp apex_3.1.1.zip
    I ran @apexins SYSAUX SYSAUX TEMP /i/
    and @apxchpwd
    Both were successful
    Now when I am executing this
    @apxldimg.sql /home/myuser
    I am getting
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    PL/SQL procedure successfully completed.
    old 1: create directory APEX_IMAGES as '&1/apex/images'
    new 1: create directory APEX_IMAGES as '/home/myuser/apex/images'
    Directory created.
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    Permission denied
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SYS.XMLTYPE", line 287
    ORA-06512: at line 15
    PL/SQL procedure successfully completed.
    Commit complete.
    timing for: Load Images
    Elapsed: 00:00:00.06
    Directory dropped.
    Kindly help.

    I had the same problem on centos (RHEL 5.2). It think maybe it is something to do with permissions with the folder to which you extract the software. I unziped apex download in the home for the super user /root then changed directory to /root/apex to do the install. In sqlplus connected as sys as sysdba the command @apxldimg.sql /root failed with ora-22288. My workaround was to copy the images to a different directory and then it worked. rm -rf /tmp/apex/images/ then mkdir -p /tmp/apex/images/ then cp -r /root/apex/images/* /tmp/apex/images/ then back in sqlplus @apxldimg.sql /tmp. This time it worked!

  • Invalid Location for operator while batch mapping

    Hi,
    I am using 10.2g version of OWB and while deploying the batch mapping, I am getting errors like:
    "VLD-1134: Invalid location for operator DATE_REF_SEQ_0.
    Configured location for operator does not exist or is not a valid location under the referenced module."
    The "DATE_REF" is one of the tables in the database. Similarly, I am getting error for many of these operators while i try to deploy the batch mapping. Could you please help us on how can we change the location of these operators in the design center/control center?
    Thanks,
    Vipul

    Hi ,
    VLD-1134 error comes when the location in configuration properties is not set or pointing to a different location.
    This generally happens when you migrate OWB code from 1 server to another or from 1 version to another.
    Goto your OWB 10.2 Designer .
    Towards right side you will find Connection Explorer
    Create new location pointing to your database ( If location is already available then note down the name )
    Now on your Source module set the metadata location and data location . You can do this by double clicking onto the module name .
    Do the same for your Target module .
    You need to set the location for Streams Administrator and Location from module Configuration .
    Thanks,
    Sutirtha

  • Installing Policy Agent gives Invalid empty password

    Hello All
    I am gettting this error when installing AM 2.2. I want to configure the Policy Agent with IBM WAS 6
    Copy agent.jar,amclientsdk.jar to
    /opt/IBM/WebSphere/AppServer/lib/ext...DONE.
    Creating directory layout and configuring AMAgent.properties file for
    agent_001 instance ...DONE.
    Reading data from file /opt/sun/policyagent/file/passwordfile and
    encrypting it ...
    *** ERROR: Installation failed due to the following error - (Invalid empty
    password specified.).
    The file exists in that path, and writeable (mod 777)
    The content of the file is "password."
    Does anyone have an idea why I am getting this error ??
    Thanks in advance

    I also am experiencing this error message when installing the AM v2.2 agent for WAS on linux. It looks like the Agent can't find the SUN security provider class and therefore can't run the encryption routine.
    The agentadmin logs show:
    EncryptionKeyGenerator.generateRandomNumber() : threw exception :
    java.security.NoSuchProviderException: no such provider: SUNWould adding "security.provider.SUN" to /opt/WebSphere/AppServer/java/jre/lib/security/java.security do the trick? I assume not by itself since the reference actually wouldn't be there.
    Thoughts?
    /Jed

  • OIP-04907: LOB operation failed. Error reading or writing to file'

    I wrote a VB program who read and write blob
    I received this error
    OIP-04907: LOB operation failed. Error reading or writing to file'
    do you have an idea why
    or
    where Can I find some info about this error (OIP)
    thanks

    Hello SteveMRG,
    What version of LabVIEW and NI DAQmx are you using? Does this error occur when the program is run from the development PC from the project? Can you create a debuggable executable and activate Highlight execution when the error occurs as to verify which state the program is in?
    Wear
    National Instruments
    Product Support Engineer

  • File or LOB operation FILEEXISTs failed

    When i executed the sqlcode to check the access i got an error
    DECLARE
    v_file BFILE := BFILENAME ('DATA_DIR', 'emp.dat');
    BEGIN
    IF DBMS_LOB.FILEEXISTS (v_file) = 1 THEN
    DBMS_OUTPUT.PUT_LINE ('File exists.');
    ELSIF DBMS_LOB.FILEEXISTS (v_file) = 0 THEN
    DBMS_OUTPUT.PUT_LINE ('File does not exist');
    ELSE
    DBMS_OUTPUT.PUT_LINE ('Unable to test existence');
    END IF;
    END;
    /ERROR at line 1:
    ORA-22288: file or LOB operation FILEEXISTs failed
    Permission denied
    ORA-06512: at "SYS.DBMS_LOB", line 504
    ORA-06512: at line 4
    server - Oracle 10.2.0.1.0 Enterprise edition
    Server OS- LINUX

    When accessing a file in the file system through the database there are two layers of permission.
    Layer 1) The database user needs the right to read (or write) from this directory. Your user probably has this, but you could check it by looking at the data dictionary view all_directories and all_tab_privs.
    Layer 2) The database itself needs access to this file. Database itself means the OS process runs with a specific user. Usually this OS-user is called oracle. The user oracle needs access to the OS folder and the file. If the file had been created by another user (e.g. root or user8731258) then somebody must give oracle the right to read this file (including folder).
    I guess your problem comes from this second layer.

  • UTL_SMPT ORA-22288: file or LOB operation GETLENGTH failed No such file or

    Hello Everyone!
    I am trying to write a script to send emails as an attachment(exists in the unix box) using utl_smtp
    i have my reports in the directory : /opt/local/application/orafin/applmgr/out/outfaud. File existing in the directory is S1759.zip
    i have created a directory as:
    create or replace directory
    REPORT_DIRECTORY
    as
    '/opt/local/application/orafin/applmgr/out/outfaud';
    when i use BFILENAME as select BFILENAME('/oracle/oradata/bfiles', 'S1759.zip') from dual
    output: REPORT_DIRECTORY//S1759.zip
    my code is something like this
    v_bfile:= BFILENAME(p_oracle_directory, p_file_name);
    v_file_length := DBMS_LOB.GETLENGTH(v_bfile);
    Error: ORA-22288: file or LOB operation GETLENGTH failed
    No such file or directory
    Could anyone please help me as im really struggling to fix this. Thanks!

    Thank you for the response..
    v_bfile:= BFILENAME(p_oracle_directory, p_file_name);
    -- Get the size of the file to be attached
    v_file_length := DBMS_LOB.GETLENGTH(v_bfile);
    -- Calculate the number of pieces the file will be split up into
    v_pieces := TRUNC(v_file_length / v_amt);
    -- Calculate the remainder after dividing the file into v_amt chunks
    v_modulo := MOD(v_file_length, v_amt);
    IF (v_modulo <> 0) THEN
    -- Since the file does not devide equally
    -- we need to go round the loop an extra time to write the last
    -- few bytes - so add one to the loop counter.
    v_pieces := v_pieces + 1;
    END IF;
    DBMS_LOB.FILEOPEN(v_bfile, DBMS_LOB.FILE_READONLY);
    FOR i IN 1 .. v_pieces LOOP
    -- we can read at the beginning of the loop as we have already calculated
    -- how many iterations we will take and so do not need to check
    -- end of file inside the loop.
    v_buf := NULL;
    DBMS_LOB.READ(v_bfile, v_amt, v_file_pos, v_buf);
    v_file_pos := I * v_amt + 1;
    UTL_SMTP.WRITE_RAW_DATA(p_conn, UTL_ENCODE.BASE64_ENCODE(v_buf));
    END LOOP;
    END;
    DBMS_LOB.FILECLOSE(v_bfile);
    end_attachment(p_conn => p_conn);
    this is the existing code..so you which part of the code should i be replacing? im sorry im new to these concepts. thanks!

  • INSERTING VIDEO : ORA-22288: file or LOB operation FILEOPEN failed

    Hi
    I'm trying to insert BFILE videos wih a procedure:
    CREATE OR REPLACE PROCEDURE "SYSTEM"."NEWVIDEO" (vid in number,
    descr in varchar2, name in varchar2)
    as
    videoOBJ ordsys.ordvideo;
    ctx RAW(4000) := null;
    begin
    select V.video into videoOBJ
    from video V
    where V.identifier = vid
    for update;
    videoOBJ.setDescription(descr);
    videoOBJ.setSource('file', 'VIDEO_DIR', name);
    videoOBJ.setProperties(ctx, true);
    update video V
    set V.video = videoOBJ
    where V.identifier = vid;
    commit;
    end;
    when execting in SQLplus
    SQL>create or replace directory VIDEO_DIR as '/bpmod61/VIDEOS';
    SQL>begin newvideo(26,'system video','BPR.AVI');end;
    I got this message:
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "ORDSYS.ORDVIDEO", line 1260
    ORA-22288: file or LOB operation FILEOPEN failed
    No such file or directory
    ORA-06512: at "SYSTEM.NEWVIDEO", line 12
    ORA-06512: at line 1
    I checked permission privilege for directory and file access: everything grant to everyone.

    Thank you for the reply Larry
    I tested my database using tutorial script viddemo.sql
    and i get the same message
    directory created and read granted on it to public
    OWNER DIRECTORY_NAME
    DIRECTORY_PATH
    SYS VIDDIR
    c:\video
    When i try
    SQL> DECLARE
    2 obj ORDSYS.ORDVideo;
    3 ctx RAW(4000) := NULL;
    4 BEGIN
    5 SELECT video into obj from T_VIDEO where id = 1 FOR UPDATE;
    6 -- set description
    7 obj.setDescription('Video from a BFILE');
    8 -- set mimetype
    9 obj.setMimeType('video/x-quicktime');
    10 -- set source
    11 obj.setSource('FILE', 'VIDDIR','Sample.mov');
    12 -- import data
    13 obj.import(ctx);
    14 -- set video attributes
    15 obj.setKnownAttributes('MOOV', 400, 300, 1024, 10, 3600,
    16 36000, 'NONE', 256, 28000);
    17 UPDATE T_VIDEO SET VIDEO=obj WHERE id=1;
    18 END;
    19 /
    DECLARE
    ERROR AT LINE 1 :
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "ORDSYS.ORDSOURCE", line 181
    ORA-22288: file or LOB operation FILEOPEN failed
    No such file or directory
    ORA-06512: at "ORDSYS.ORDVIDEO", line 517
    ORA-06512: at line 13
    Thank you for the help

Maybe you are looking for

  • WM interface to external system

    Have anybody ever configured WM interface to external system (t-code OMKY)? I have a question here and hope you can help: What's the naming rule when define Logical System, RFC destination, Port and Partner Profile? Should all be defined under one na

  • Workspace Time Out IN BPM 11.1.1.1.5

    Hi, Can anyone has any suggestion on how to increase the times out interval in BPM 11g. Regards, Shekhar

  • PDF Print - Numeric&bold Calibri font is printed not properly on Windows 7 (on XP - OK)

    In MS CRM 4.0 system I generate reports using Reporting Services (10.0.4067.0  - 2008 SP2 + MS12-070). Then I export them to PDF. Font which is used - Calibri. In PDF file everything is displayed properly. When I print that PDF in Adobe Reader (Windo

  • Column addition in Matrix through XML

    Hi all, I am unable to add columns in userdefined matrix in system form through XML. After loading the XML in the system form the matrix is appearing without columns.  SSPL_FUNCTIONS.Common.ReplaceUIDandLoadToB1("SSPL_FRM4_150", FormUID)     <item ui

  • Bug when exporting table data

    The exported columns name are still ordered as the table definition and the data are ordered as the table is diplayed in the explorer. If you change the order of the columns in the explorer and export the data in a csv file by example, the data are p