Writing thumbnail to blob column

hi i am taking bufferedinputstream as parameter and create thumbnail frm it and stored in blob column but when i retrive that blob column i get blank (black) image as thumbnail plz help me out i have given code here.
public int addThumbnailDtl(BufferedInputStream localbuf,InputStream inputlocal , String cvdplNo,String fileName,String folderName,String empCode,String prjName,String ext1)
throws Exception{
               System.out.println("addThumbnailDtl");
     ConnectionPool ovPool               = null;
          Connection ovCon               = null;     
          Statement ovStmt               = null;
          ResultSet ovResultSet          = null;
     ResultSet ovResultSet1          = null;
          String          sqlStr               = null;
          String          salQuery     = null;
          String          sqlStrUpdate     = null;
          int rowCount =0;
          int chunkSize;
byte[] binaryBuffer;
long position                    =1;
          long                    position1 = 1;
int bytesRead = 0;
          int                    bytesRead1                    = 0;
int bytesWritten = 0;
int totbytesRead = 0;
int totbytesWritten = 0;
          String                    tableName                    = null;
          String                    t_fileValue                    = null;
          String                    t_fileName                    = null;
          String                    vId=null;
          //String size=String.valueOf(fileSize);
          oracle.sql.BLOB image = null;
          BufferedImage thumb = null;
          BufferedOutputStream outputFileOutputStream = null; // newly added 1
          File ImgFile = null;                                        // newly added 3
          // BufferedImage buffimg = null;                              // newly added 4
          String thumbimg               = null;                         // newly added.
          BufferedInputStream inputLocalBuf1     =null;
          binaryBuffer =new byte[8192];
          t_fileValue = "V_FILE_CONTENTS";
               try{
               ovPool = new ConnectionPool();
                    ovCon = ovPool.createConnection();
                    ovCon.setAutoCommit(false);
                    ovStmt = ovCon.createStatement();
                    System.out.println("1");
                    salQuery="SELECT V_ID FROM FILEMANAGER_MST "+
                    "WHERE V_PRJ_NAME='"+prjName+"' AND V_CVDPLNO='"+cvdplNo+"'AND V_FILE_NAME='"+fileName+"'";
                    System.out.println("2 Query--"+salQuery);
                    ovResultSet= ovStmt.executeQuery(salQuery);
                    ovResultSet.next();
                    vId=ovResultSet.getString(1);
                    System.out.println("3 Vid --- "+vId);
               sqlStr = "INSERT INTO FILE_THUMBNAIL VALUES('"+vId+"','"+fileName+"','"+folderName+"','111',EMPTY_BLOB(),'"+ext1+"')";
               //sqlStr = "INSERT INTO FILEMANAGER_DATA VALUES('"+vId+"','"+fileName+"','"+folderName+"','111',EMPTY_BLOB(),'"+ext1+"')";
                    System.out.println(sqlStr);
                    ovStmt.executeUpdate(sqlStr);
                    System.out.println("Successfully Inserted Record...."+cvdplNo);
                    sqlStrUpdate = " SELECT "+t_fileValue+" FROM FILE_THUMBNAIL WHERE V_ID = '"+vId+"' FOR UPDATE";
                    System.out.println("sqlStrUpdate=> "+sqlStrUpdate);
                    ovResultSet1=ovStmt.executeQuery(sqlStrUpdate);
                    System.out.println("Successful Get Record for Update");
                    if(ovResultSet1 != null){
                         System.out.println("In If Satement");
                         while(ovResultSet1.next()) {
                              System.out.println("In While Loop");
                              image = (oracle.sql.BLOB) ovResultSet1.getBlob (t_fileValue);
                              //oracle.sql.BLOB image = ((OracleResultSet)ovResultSet).getBLOB(t_fileValue);
                              System.out.println("Transfer into BLOB data");
                              chunkSize = image.getChunkSize();
                              System.out.println("1");
                              binaryBuffer = new byte[chunkSize];
                              System.out.println("2");
                              position = 1;
                              System.out.println("3");
                              if(inputlocal==null)
                                   System.out.println("blank inputlocal");
                              BufferedInputStream bInp=new BufferedInputStream(localbuf);
                              BufferedImage im = ImageIO.read(localbuf);
                              System.out.println("11");
                              int tw = 100;//im.getWidth()/5;
                              System.out.println("12");
                              int th = 100;//im.getHeight()/5;
                              System.out.println("5 "+tw+" Height "+th);
                              thumb = new BufferedImage(tw,th,BufferedImage.TYPE_INT_RGB);
                              Graphics2D gScaledImg = thumb.createGraphics();
                              gScaledImg.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                              BufferedImage img = ImageIO.read(localbuf); // taking inputlocalbuf
                              gScaledImg.drawImage(img, 0, 0, 100, 100, null);
                              ByteArrayOutputStream out = new ByteArrayOutputStream();
                              ImageIO.write(thumb,"jpeg",out);
                              byte[] buf = out.toByteArray();
                              ByteArrayInputStream inStream = new ByteArrayInputStream(buf);
                              while ((bytesRead = inStream.read(binaryBuffer)) != -1)
                                   System.out.println("OOOOOOOOOOOOOOOOOOOOOOOOOO");
                                   bytesWritten = image.putBytes(position, binaryBuffer, bytesRead);
                                   position += bytesRead;
                                   totbytesRead += bytesRead;
                                   totbytesWritten += bytesWritten;
                              System.out.println("7 "+position1);
               }catch(SQLException sqlEx){
                              //System.out.println("SQLException sqlstr=>"+sqlStr);
                              int errCode = sqlEx.getErrorCode();
                              String sqlMessage = sqlEx.getMessage();
                              String sqlState = sqlEx.getSQLState();
                              System.err.println("Message: " + sqlMessage);
                              System.err.println("SQL state: " + sqlState);
                              System.err.println("Error code: " + errCode);
                    }catch(Exception e){
                         System.out.println("Exception sqlstr "+e.getMessage());
                    }finally{
               try{
                    ovCon.setAutoCommit(true);
                    ovCon.commit();
                    if(ovResultSet != null)
ovResultSet.close();
ovResultSet = null;
               if(ovResultSet1 != null)
ovResultSet1.close();
ovResultSet1 = null;
                    if(ovStmt != null)
ovStmt.close();
                         ovStmt = null;
                    ovPool.close(ovCon);
                    ovCon = null;
                    ovPool = null;
               catch(Exception err){
                    System.out.println("Already Closing the connection / statement / resultset");
return 0;
}

First, what is a blob column, second, use the code tags

Similar Messages

  • Getting errors while writing to a BLOB column using PrepareStatement

    Hello,
    I am getting the following errors when I am trying to insert in a BLOB in the oracle 9i database:
    java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1 ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 205 ORA-22297: warning: Open LOBs exist at transaction commit time
    It gets inserted into the BLOB column correctly even after throwing exception.I am using the following code:
    String outputXML = outputXML //Some huge string having a length of 52k
    String pKey = "DATA-WORKATTACH-URL MELLONFINCORP-GSS-CPG E-444!20061130T211932.030 GMT";
    String createDateTime = "20061212T145931.448 GMT";
    String createOpName = "Haque, Nadeem";
    String createOperator = "ADCDTB6";
    String createSystemID = "WFE";
    String insName = "TESt INS";
    String objClass = "Data-WorkAttach-Note";
    String updateDateTime = "20061207T191900.510 GMT";
    String updateOpName = "Haque, Nadeem";
    String updateOperator = "ADCDTB6";
    String updateSystemID = "WFE";
    String label = "This is a test for label";
    String attachDate = "20061207T191900.510 GMT";
    String attachedBy = "Nadeem";
    String attachName = "Nadeem Haque";
    String note = "This is a test note";
    String refObjectKey = "E-438!20061130T211932.030";
    String replicationDate = "20061207T191900.510 GMT";
    try{
    java.sql.PreparedStatement pstmt = null;
    java.sql.Statement stmt = null;
    java.io.OutputStream tempBlobOStream = null;
    oracle.sql.BLOB tempBlob = null;
    javax.naming.Context ctx = new javax.naming.InitialContext();
    tools.findPage("tempWorkPage").putString ("testctx", ctx.toString());     
    javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("jdbc/gswWorkflowReportingData");
    tools.findPage("tempWorkPage").putString ("testds", ds.toString());
    java.sql.Connection conn = ds.getConnection();
    tools.findPage("tempWorkPage").putString ("testconn", conn.toString());
    java.sql.ResultSet lobDetails = null;
         try{
              byte [] ba = outputXML.getBytes();
              String query = "INSERT INTO GSW06U.pc_data_workattach(PZINSKEY,PXCREATEDATETIME,ATTACHDATE,PXUPDATEDATETIME,PXCREATEOPNAME,PXCREATEOPERATOR,PXCREATESYSTEMID,PXINSNAME,PXOBJCLASS,PXUPDATEOPNAME,PXUPDATEOPERATOR,PXUPDATESYSTEMID,PYLABEL,ATTACHEDBY,ATTACHNAME,NOTE,REFOBJECTKEY,ATTACHSTREAM) values(?,to_date(concat(substr(?,1,8),substr(?,10,6)),'YYYYMMDDHH24MISS'),to_date(concat(substr(?,1,8),substr(?,10,6)),'YYYYMMDDHH24MISS'),to_date(concat(substr(?,1,8),substr(?,10,6)),'YYYYMMDDHH24MISS'),?,?,?,?,?,?,?,?,?,?,?,?,?,EMPTY_BLOB())";
              tools.findPage("tempWorkPage").putString ("query", query);
              pstmt = conn.prepareStatement(query);
              pstmt.setString(1, pKey); // Bind PZINSKEY
              pstmt.setString(2, createDateTime); // Bind PZINSKEY
              pstmt.setString(3, createDateTime);
              pstmt.setString(4, attachDate);
              pstmt.setString(5, attachDate);
              pstmt.setString(6, updateDateTime);
              pstmt.setString(7, updateDateTime);
              pstmt.setString(8, createOpName);
              pstmt.setString(9, createOperator);
              pstmt.setString(10, createSystemID);
              pstmt.setString(11, insName);
              pstmt.setString(12, objClass);
              pstmt.setString(13, updateOpName);
              pstmt.setString(14, updateOperator);
              pstmt.setString(15, updateSystemID);
              pstmt.setString(16, label);
              pstmt.setString(17, attachedBy);
              pstmt.setString(18, attachName);
              pstmt.setString(19, note);
              pstmt.setString(20, refObjectKey);
              pstmt.execute(); // Execute SQL statement
              // Retrieve the row just inserted, and lock it for insertion of the LOB columns
              stmt = conn.createStatement();
              lobDetails = stmt.executeQuery("SELECT AttachStream FROM GSW06U.pc_data_workattach WHERE PZINSKEY = '" + pKey + "' FOR UPDATE");
              tools.findPage("tempWorkPage").putString ("idvalue", pKey);
              // Retrieve Blob streams for AttachStream column and load the sample XML
              if( lobDetails.next()) {
              //Get the CLOB from the resultset
              tempBlob = (oracle.sql.BLOB)lobDetails.getBlob(1);
              tools.findPage("tempWorkPage").putString ("pos1", "at pos1");
              // Open the temporary CLOB in readwrite mode, to enable writing
              tempBlob.open(oracle.sql.BLOB.MODE_READWRITE);
              tools.findPage("tempWorkPage").putString ("pos2", "at pos2");
              // Get the output stream to write
              tempBlobOStream = tempBlob.getBinaryOutputStream();
              tools.findPage("tempWorkPage").putString ("pos3", "at pos3");
              // Write the data into the temporary CLOB from the byte array
              tempBlobOStream.write(ba);
              // Flush and close the stream
              tempBlobOStream.flush();
              conn.commit();
              //Close everything
    tempBlobOStream.close();
              tempBlobOStream = null;
              tempBlob.close();
              tempBlob =null;
              lobDetails.close();
              lobDetails = null;
              stmt.close();
              stmt = null;
              pstmt.close();
              pstmt = null;
              conn.close(); // Return to connection pool
              conn = null; // Make sure we don't close it twice
         catch(java.sql.SQLException sqlexp) {
                   tempBlob.freeTemporary();
                   sqlexp.printStackTrace();
                   tools.findPage("tempWorkPage").putString ("SQLException", sqlexp.toString());
         catch(java.lang.Exception exp) {
                   tempBlob.freeTemporary();
                   tools.findPage("tempWorkPage").putString ("InnerException", exp.toString());
                   exp.printStackTrace();
         finally
              if (lobDetails != null) {
              try { lobDetails.close(); } catch (java.sql.SQLException e) { System.out.println(" Error while Freeing Result sets" + e.toString()); }
              lobDetails = null;
              if (stmt != null) {
              try { stmt.close(); } catch (java.sql.SQLException e) {System.out.println(" Error while Freeing java Statement" + e.toString()); }
              stmt = null;
              if (pstmt != null) {
              try { pstmt.close(); } catch (java.sql.SQLException e) {System.out.println(" Error while Freeing java PrepareStatement" + e.toString()); }
              pstmt = null;
              try{
              if (tempBlob != null) {
         // If the BLOB is open, close it
         if (tempBlob.isOpen()) {
         tempBlob.close();
         // Free the memory used by this BLOB
         tempBlob.freeTemporary();
              tempBlob = null;
              catch (Exception ex) { // Trap errors
              System.out.println(" Error while Freeing LOBs : " + ex.toString());
              if (conn != null) {
              try { conn.close(); } catch (java.sql.SQLException e) { System.out.println(" Error while Freeing Connection" + e.toString()); }
              conn = null;
    catch(java.lang.Exception e)
         tools.findPage("tempWorkPage").putString ("LangException", e.toString());
         e.printStackTrace();
    }

    Hello,
    I am getting the following errors when I am trying to
    insert in a BLOB in the oracle 9i database:
    java.sql.SQLException: ORA-00604: error occurred
    at recursive SQL level 1 ORA-06502: PL/SQL: numeric
    or value error ORA-06512: at line 205 ORA-22297:
    warning: Open LOBs exist at transaction commit
    time
    You're doing exactly what the error says, that is committing with an open LOB. Look at the following piece of code: you write in the LOB, you flush it and then commit. There is no closing of the LOB stream before committing.
    Try putting the tempBlobOStream.close() instruction before the commit.
    // Write the data into the temporary CLOB from the
    he byte array
              tempBlobOStream.write(ba);
              // Flush and close the stream
              tempBlobOStream.flush();
    nn.commit();
              //Close everything
    tempBlobOStream.close();

  • Writing BLOB column into a csv or txt or sql  files

    Hi All,
    I am having a requirement where i have to upload a file from user desktop and place that file into a unix directory. For this i am picking that file into a table using APEX and then writing that file in unix directory using UTL_FILE.
    The problem which i am facing is that after this every line in my file is having ^M character at the end.
    For this i modified my BLOB column into a CLOB column and then also i am facing the same problem.
    Is there any way to get rid of this as i have to upload these csv or txt files into tables using sql loader programs. i can;t write any shell script to remove ^M character before uploading as this program will be merge with existing programs and then it will require lots of code change.
    Kindly Help.
    Thanks
    Aryan

    Hi Helios,
    Thanks again buddy for your reply and providing me different ways.... but still the situation is i can;t write any shell script for removing the ^M. I will be writing into a file from CLOB column.
    Actually the scenrio is when i am writing a simple VARCHAR columns with 'W' mode then it is working fine, but i have a BLOB column which stores the data in binary format so i am converting that column into CLOB and then writing it into file with 'W' mode but then i am getting ^M characters. As per your suggestion i have to then again run a program for removing ^M or i have to modify all my previous programs for removing ^M logic.
    I want to avoid all these, and just wanted a way so that while writing into a file itself it should not have ^M. Else i have to go for a java stored procedure for running a shell script from sql, and in this still i am having some problem.
    Thanks Again Helios for your time and help.
    Regards
    Aryan

  • Reading and Writing to blob column is very slow

    Hi
    I want to write a serialized java object called 'engine' to a database table called javaObjectsDB. The serialized object could be of sizes anywhere between 20MB to 4GB. I am using the following code to write this 'engine' object
                   * Write java object to BLOB in DB - Start
                   Connection conn=null;
                   conn = Util.getConnectionFromDS();
              PreparedStatement ps=null;
              String sql=null;
                   Engine.startWatch();
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   Engine.endWatch("Time for ByteArrayOutputStream");
                   Engine.startWatch();
                   ObjectOutputStream oos = new ObjectOutputStream(baos);
                   Engine.endWatch("Time for ObjectOutputStream");
                   Engine.startWatch();
                   oos.writeObject(this.engine_);
                   Engine.endWatch("Time for oos.writeObject");
                   oos.flush();
                   Engine.startWatch();
                   byte[] data = baos.toByteArray(); // in case of using ByteArrayOutputStream
                   Engine.endWatch("Time for toByteArray");
                   Engine.startWatch();
         sql="insert into javaObjectsDB values (?)";
         ps=conn.prepareStatement(sql);
         ps.setObject(1, data); // in case of using ByteArrayOutputStream
         ps.executeUpdate();
         Engine.endWatch("Time for prepare statement and insert");
                   * Write java object to BLOB in DB - End
    To read from database BLOB column back to the engine object I use the following code:
    try {
                   String readBlob = "SELECT javaObject FROM javaObjectsDB ";
                   Statement readBlobStmt = conn.createStatement();
                   ResultSet resultSet = readBlobStmt.executeQuery(readBlob);
                   while (resultSet.next()) {
                        * ByteArrayStream *** Start
                        Engine.startWatch();
                        Blob blob = resultSet.getBlob(1);
                        Engine.endWatch("loadPlan::Time for getBlob");
                        Engine.startWatch();               
                        byte [] data = blob.getBytes(1,(int)blob.length());
                        Engine.endWatch("loadPlan::Time for getBytes");                    
                        Engine.startWatch();
                   ByteArrayInputStream bais = new ByteArrayInputStream(data);               
                   Engine.endWatch("loadPlan::Time for ByteArrayInputStream");
                   Engine.startWatch();
                   ObjectInputStream oin = new ObjectInputStream(bais);
                   Engine.endWatch("loadPlan::Time for ObjectInputStream");
                   Engine.startWatch();
                   engine_ = (Engine)oin.readObject();     
                   Engine.endWatch("loadPlan::Time for oin.readObject");
                   System.out.println("engine object prepared");
                        * ByteArrayStream *** End
                   } //while of result Set
    The time taken to write and read for a engine object of size 124MB are:
    write - 41secs
    read - 28secs
    For a engine object of size 340MB
    write - 3minutes
    read - 1minute
    This is a lot of time for such small object size, and since we are expecting sizes of 4GB, I need to have better performance. Please suggest what I can do to improve performance for read and write.
    One thing I tried was using cached lobs but not of much use.

    Welcome to the forum!
    Unfortunately this is an Oracle forum and your question should be posted in the Java JDBC forum.
    https://forums.oracle.com/forums/category.jspa?categoryID=288
    Please create a question on the JDBC forum, post a link to that new question here, in this forum, and mark this question answered.
    That way anyone seeing this question can followup with you in the other forum.
    Thanks.

  • Writing BLOB column from Cobol

    Hi,
    I´m using the Pro*Cobol pre-compile to execute SQL statements into programs Cobol Net Express.
    I need two helps.
    1 - How can do to the Pro*Cobol cut the blanks on the right into PIC X Varying hosts variables ?
    For example :
    ..... LastName VARCHAR(20)
    ..... 05 LASTNAME PIC X(20) VARYING.
    The Pro*Cobol documentation say that precompile transform the elementary item LASTNAME to the group item bellow :
    05 LASTNAME.
    10 LASTNAME-LEN PIC S9(04) COMP.
    10 LASTNAME-ARR PIC X(20).
    When a string less than 20 is moved to LASTNAME-ARR, the exact string lenght is moved to the LASTNAME-LEN and the string is writen
    into DB without blanks on right.
    When a string is red from DB, the precompile write into LASTNAME-LEN the exact string lenght and the LASTNAME-ARR receive the
    string value without blanks on write.
    Occurs that when I compile the program the Pro*Cobol/Micro Focus don´t recognize LASTNAME-LEN and LASTNAME-ARR.
    Am I correct ? May I use any directive that resolve that ?
    2 - I need to check these step-by-step to write a text file generated from cobol into a BLOB column.
    The LOAD FROM FILE statement receive SQLCODE -22275 : Invalid LOB locator specified.
    Assumptions :
    MAG-RELAT-BFILE SQL-BFILE.
    MAG-RELAT-BLOB SQL-BLOB.
    The fiel R1401 exists in D:\Petros\NE\
    Source Code :
    MOVE 'D:\Petros\NE\' TO ALIAS
    MOVE 13 TO ALIAS-L
    MOVE 5 TO FILENAME-L
    MOVE 'R1401' TO FILENAME
    EXEC SQL
    ALLOCATE :IMAG-RELAT-BFILE
    END-EXEC.
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO ALLOCATE' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BFILE' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    EXEC SQL
    LOB FILE SET :IMAG-RELAT-BFILE
    DIRECTORY = :ALIAS,
    FILENAME = :FILENAME
    END-EXEC.
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO LOB FILE SET' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BFILE' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    EXEC SQL
    ALLOCATE :IMAG-RELAT-BLOB
    END-EXEC
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO ALLOCATE' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BLOB' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    EXEC SQL
    LOB LOAD :TOTAL-BYTES
    FROM FILE :IMAG-RELAT-BFILE
    INTO :IMAG-RELAT-BLOB
    END-EXEC.
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO LOAD FFOM FILE' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BFILE, IMAG-RELAT-BLOB' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    Thanks,

    907466 wrote:
    Hi,
    I´m using the Pro*Cobol pre-compile to execute SQL statements into programs Cobol Net Express.
    I started my career as a cobol programmer in 1981, and the last project I worked on before transitioning to DBA was implementing MF Cobol. It's been a number of years but ...
    I need two helps.
    1 - How can do to the Pro*Cobol cut the blanks on the right into PIC X Varying hosts variables ?
    For example :
    ..... LastName VARCHAR(20)
    ..... 05 LASTNAME PIC X(20) VARYING.
    The Pro*Cobol documentation say that precompile transform the elementary item LASTNAME to the group item bellow :
    05 LASTNAME.
    10 LASTNAME-LEN PIC S9(04) COMP.
    10 LASTNAME-ARR PIC X(20).
    When a string less than 20 is moved to LASTNAME-ARR, the exact string lenght is moved to the LASTNAME-LEN and the string is writen
    into DB without blanks on right.
    When a string is red from DB, the precompile write into LASTNAME-LEN the exact string lenght and the LASTNAME-ARR receive the
    string value without blanks on write.
    Occurs that when I compile the program the Pro*Cobol/Micro Focus don´t recognize LASTNAME-LEN and LASTNAME-ARR.
    Am I correct ? May I use any directive that resolve that ?
    I don't know if you are correct or not. Is the pre-compiler or compiler step throwing an error message? If you are correct, there should be an error message that you should share with us.
    2 - I need to check these step-by-step to write a text file generated from cobol into a BLOB column.
    The LOAD FROM FILE statement receive SQLCODE -22275 : Invalid LOB locator specified.
    Assumptions :
    MAG-RELAT-BFILE SQL-BFILE.
    MAG-RELAT-BLOB SQL-BLOB.
    The fiel R1401 exists in D:\Petros\NE\
    Source Code :
    MOVE 'D:\Petros\NE\' TO ALIAS
    MOVE 13 TO ALIAS-L
    MOVE 5 TO FILENAME-L
    MOVE 'R1401' TO FILENAME
    EXEC SQL
    ALLOCATE :IMAG-RELAT-BFILE
    END-EXEC.
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO ALLOCATE' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BFILE' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    EXEC SQL
    LOB FILE SET :IMAG-RELAT-BFILE
    DIRECTORY = :ALIAS,
    FILENAME = :FILENAME
    END-EXEC.
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO LOB FILE SET' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BFILE' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    EXEC SQL
    ALLOCATE :IMAG-RELAT-BLOB
    END-EXEC
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO ALLOCATE' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BLOB' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    EXEC SQL
    LOB LOAD :TOTAL-BYTES
    FROM FILE :IMAG-RELAT-BFILE
    INTO :IMAG-RELAT-BLOB
    END-EXEC.
    IF SQLCODE NOT EQUAL +0
    MOVE 'ERRO COMANDO LOAD FFOM FILE' TO WW-CA-MENSAGEM
    MOVE 'IMAG-RELAT-BFILE, IMAG-RELAT-BLOB' TO WW-CA-ARQUIVO
    MOVE SQLCODE TO WW-ST-ARQUIVO
    MOVE 08 TO RETURNO-CODE
    PERFORM 999-TRATA-ERRO THRU 999-FIM
    END-IF.
    Thanks,So far you haven't shown us any symptoms, errors, etc. Just a description of what you are doing and a statement that you assume it won't work. Your executable code has a lot of reference to host variables that we can only assume a spelled correctly to match to variables you've declared in your data division. Are you going straight from submitting precompile to run-time, or are you using the very excellent interactive source-level debugger that is a prime feature of MF Cobol?

  • Writing BLOB column into a file (NT/WinWord)

    I need to create
    a file on NT and extract the contents of a BLOB
    column and put it in the file. It's a WORD-document
    and I'm using 8.1.7 on NT4SP5. I'm thinking some
    combination of the LOB package and UTL_FILE, but
    some far no luck. Example code would help me.
    Thanks in advance
    Dannys

    dbms_lob, utl_lob is not supported by oracle, written by an in-
    house analyst to demonstrate a concept.

  • How to display the content of a BLOB column in a ADF/BC pages ?

    How to display the content of a BLOB column in a ADF/BC pages ?
    There is some image in database table blog column. And we want to display image on the screeen.
    There is some example about upload and dowload blog columns.
    (steve not yet document example page etc...)
    But We want to display blog picture in a image component...
    is there any basic way to do it ?
    Thanks a lot...

    Ali,
    You could just download the sample app... but... here is the servlet code from the demo (look at it just for technique - you'll obviously have to change it for your needs)...
    John
    package oracle.fodemo.storefront.servlet;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import oracle.jbo.domain.DBSequence;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.ViewObjectImpl;
    public class ImageServlet
      extends HttpServlet
      private static final String CONTENT_TYPE =
        "image/jpg; charset=windows-1252";
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        response.setContentType(CONTENT_TYPE);
        response.setContentType(CONTENT_TYPE);
        String detailProductId = request.getParameter("detail");
        String thumbnailProductId = request.getParameter("thumbnail");
        boolean thumbnail = true;
        String productId = null;
        OutputStream os = response.getOutputStream();
        String amDef = "oracle.fodemo.storefront.store.service.StoreServiceAM";
        String config = "StoreServiceAMLocal";
        ApplicationModule am =
          Configuration.createRootApplicationModule(amDef, config);
        ViewObjectImpl vo =
          (ViewObjectImpl) am.findViewObject("ProductImages"); // get view object (the same as used in the table)
        if (detailProductId != null)
          productId = detailProductId;
          thumbnail = false;
        else
          productId = thumbnailProductId;
        vo.defineNamedWhereClauseParam("paramThumbnail", null, null);
        vo.defineNamedWhereClauseParam("paramProductId", null, null);
        vo.setWhereClause("DEFAULT_VIEW_FLAG = :paramThumbnail AND PRODUCT_ID = :paramProductId");
        vo.setNamedWhereClauseParam("paramThumbnail", (thumbnail? "Y": "N"));
        vo.setNamedWhereClauseParam("paramProductId", productId);
        vo.executeQuery();
        Row product = vo.first();
        BlobDomain image = (BlobDomain) product.getAttribute("Image");
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[10 * 1024];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
        os.close();
        vo.setWhereClause(null);
        vo.removeNamedWhereClauseParam("paramProductId");
        vo.removeNamedWhereClauseParam("paramThumbnail");
        Configuration.releaseRootApplicationModule(am, false);
    }

  • BLOB column says undefined

    Hi .
    when i create a BLOB column in the table and describe the structure it says undefined. how do i fix that. also if someone can let me know how to update a RTF content from a VB to the BLOB column in the oracle table?? Tons of thanks in advance

    You can write a BLOB- VB to Oracle database using ADO function in VB. Search in MSDN for help on BLOB function. They have a ready eg.
    Just in case you don't find it.
    Here it is:
    Just copy paste this in a form with text boxes for all ODBC parameters.
    I think you cannot read directly from a BLOB column. Don't forget to initiate a BLOB column like:
    /*LOB table for storing files*/
    Drop table FileColumn;
    Create table FileColumn
    ( REPQUE_ID NUMBER(10) NOT NULL ,
    RepText_blob BLOB default empty_blob()
    Storage (initial 50K next 50K pctincrease 0)
    tablespace TEST31ORA
    lob(RepText_blob) store as
    (tablespace ACCOUNT4
    Storage (initial 100k next 100k pctincrease 0)
    chunk 16k pctversion 10 nocache logging);
    /*initialize LOB locator by making it not null, use empty lob, this will
    insert the locator value in that column
    I did this initialize in create table script, so that I can do the bulk insert
    One can do bulk inserts if there are no rows before
    insert into FileColumn
    values(1, empty_blob()); */
    Option Explicit
    Const BlockSize = 32768
    ' FUNCTION: ReadBLOB()
    ' PURPOSE:
    ' Reads a BLOB from a disk file and stores the contents in the
    ' specified table and field.
    ' PREREQUISITES:
    ' The specified table with the OLE object field to contain the
    ' binary data must be opened in Visual Basic code (Access Basic
    ' code in Microsoft Access 2.0 and earlier) and the correct record
    ' navigated to prior to calling the ReadBLOB() function.
    ' ARGUMENTS:
    ' Source - The path and filename of the binary information
    ' to be read and stored.
    ' T - The table object to store the data in.
    ' Field - The OLE object field in table T to store the data in.
    ' RETURN:
    ' The number of bytes read from the Source file.
    Function ReadBLOB(Source As String, T As Recordset, _
    sField As String)
    Dim NumBlocks As Integer, SourceFile As Integer, i As Integer
    Dim FileLength As Long, LeftOver As Long
    Dim FileData As String
    Dim RetVal As Variant
    On Error GoTo Err_ReadBLOB
    ' Open the source file.
    SourceFile = FreeFile
    Source = "c:\blob_file_folder\G63JR557.doc"
    T = mwebRepOutput
    sField = RepOut_Content
    Open Source For Binary Access Read As SourceFile
    ' Get the length of the file.
    FileLength = LOF(SourceFile)
    If FileLength = 0 Then
    ReadBLOB = 0
    Exit Function
    End If
    ' Calculate the number of blocks to read and leftover bytes.
    NumBlocks = FileLength \ BlockSize
    LeftOver = FileLength Mod BlockSize
    ' SysCmd is used to manipulate status bar meter.
    RetVal = SysCmd(acSysCmdInitMeter, "Reading BLOB", _
    FileLength \ 1000)
    ' Put first record in edit mode.
    T.MoveFirst
    T.Edit
    ' Read the leftover data, writing it to the table.
    FileData = String$(LeftOver, 32)
    Get SourceFile, , FileData
    T(sField).AppendChunk (FileData)
    RetVal = SysCmd(acSysCmdUpdateMeter, LeftOver / 1000)
    ' Read the remaining blocks of data, writing them to the table.
    FileData = String$(BlockSize, 32)
    For i = 1 To NumBlocks
    Get SourceFile, , FileData
    T(sField).AppendChunk (FileData)
    RetVal = SysCmd(acSysCmdUpdateMeter, BlockSize * i / 1000)
    Next i
    ' Update the record and terminate function.
    T.Update
    RetVal = SysCmd(acSysCmdRemoveMeter)
    Close SourceFile
    ReadBLOB = FileLength
    Exit Function
    Err_ReadBLOB:
    ReadBLOB = -Err
    Exit Function
    End Function
    null

  • Persist document in BLOB column problem

    Hi all,
    I'm having problem with persisting document in BLOB column.
    Using debuger I checked that document.doc contains correctly uploaded file before persist. There are other attributes of document and they are persisted correctly, but when I check blob size in database it size is 1byte which is incorrect.
    After I persist second file, first one get his correct size value, and size of second one is 1byte.
    If I stop weblogic server, second value will never be populated. If I only restart application without restarting server, and then upload third document, size of second one will be corrected.
    Oracle JDeveloper 11g R1 11.1.1.2.0
    Oracle DataBase 10gR2
    Using ADF 11g RC & EJB
    I set id manually.
    Entity Document.java:...
    @Entity
    @NamedQueries({
      @NamedQuery(name = "Document.findAll", query = "select o from Document o")
    public class Document implements Serializable {
        @Id
        private Long id;
        @Lob
        private byte[] doc;
        private String title;
        private String type;
    }Here is persistence.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
      <persistence-unit name="Model">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/FileUDS</jta-data-source>
        <class>fu.model.entity.Document</class>
        <properties>
          <property name="eclipselink.target-server" value="WebLogic_10"/>
          <property name="javax.persistence.jtaDataSource" value="jdbc/FileUDS"/>
        </properties>
      </persistence-unit>
    </persistence>Here is sample project with DDL for document table:[url http://uploading.com/files/52m65757/TestFileUpload.zip]TestFileUpload.zip

    Finest log when it doesn't work:
    [EL Finest]: 2010-09-22 15:01:12.732--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin deploying Persistence Unit Model; state Predeployed; factoryCount 1
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin weaver class transformer processing class [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Weaved persistence (PersistenceEntity) [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Weaved change tracking (ChangeTracker) [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Weaved fetch groups (FetchGroupTracker) [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--End weaver class transformer processing class [fu.model.entity.Dummy].
    [EL Finer]: 2010-09-22 15:01:12.794--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-database; value=Oracle10g; translated value=org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Finest]: 2010-09-22 15:01:12.826--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=javax.persistence.jtaDataSource; value=jdbc/OracleTextDS
    [EL Finest]: 2010-09-22 15:01:12.841--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.cache.shared.default; value=false; translated value=false
    [EL Finest]: 2010-09-22 15:01:12.841--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.jdbc.native-sql; value=true
    [EL Info]: 2010-09-22 15:01:12.873--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 1.2.0.v20091016-r5565
    [EL Info]: 2010-09-22 15:01:12.873--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Server: WebLogic Server 10.3.2.0  Tue Oct 20 12:16:15 PDT 2009 1267925
    [EL Config]: 2010-09-22 15:01:12.888--ServerSession(32436700)--Connection(25502890)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:01:12.951--ServerSession(32436700)--Connection(31684552)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Config]: 2010-09-22 15:01:12.966--ServerSession(32436700)--Connection(13432760)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:01:12.966--ServerSession(32436700)--Connection(10190221)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Info]: 2010-09-22 15:01:13.576--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model login successful
    [EL Finest]: 2010-09-22 15:01:13.591--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The applicationName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload]
    [EL Finest]: 2010-09-22 15:01:13.591--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The moduleName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload-ViewController-context-root]
    [EL Finest]: 2010-09-22 15:01:13.591--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--End deploying Persistence Unit Model; state Deployed; factoryCount 1
    [EL Finer]: 2010-09-22 15:01:13.623--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client acquired
    [EL Finer]: 2010-09-22 15:01:13.623--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX binding to tx mgr, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:01:13.623--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--PERSIST operation called on: fu.model.entity.Document@d52347.
    [EL Finer]: 2010-09-22 15:01:13.638--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beforeCompletion callback, status=STATUS_ACTIVE
    [EL Finer]: 2010-09-22 15:01:13.638--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--begin unit of work commit
    [EL Finer]: 2010-09-22 15:01:13.654--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beginTransaction, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:01:13.669--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query InsertObjectQuery(fu.model.entity.Document@d52347)
    [EL Finest]: 2010-09-22 15:01:13.685--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--reconnecting to external connection pool
    [EL Fine]: 2010-09-22 15:01:13.685--ClientSession(22623994)--Connection(6662457)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO DOCUMENT (ID, TITLE, DOC, TYPE) VALUES (?, ?, ?, ?)
         bind => [106, Oracle Text 106, [B@b48094, DOC]
    [EL Fine]: 2010-09-22 15:01:13.732--ClientSession(22623994)--Connection(6662457)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT DOC FROM DOCUMENT WHERE (ID = ?) FOR UPDATE
         bind => [106]
    [EL Finest]: 2010-09-22 15:01:13.873--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Writing BLOB value(size = 152,064 bytes) through the locator to the table field: DOC
    [EL Finer]: 2010-09-22 15:01:13.888--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX afterCompletion callback, status=COMMITTED
    [EL Finer]: 2010-09-22 15:01:13.888--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--end unit of work commit
    [EL Finer]: 2010-09-22 15:01:13.888--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--release unit of work
    [EL Finer]: 2010-09-22 15:01:13.888--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client releasedFinest log when it works:
    [EL Finest]: 2010-09-22 15:09:29.741--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin deploying Persistence Unit Model; state Predeployed; factoryCount 1
    [EL Finer]: 2010-09-22 15:09:29.787--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-database; value=Oracle10g; translated value=org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Finest]: 2010-09-22 15:09:29.834--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=javax.persistence.jtaDataSource; value=jdbc/OracleTextDS
    [EL Finest]: 2010-09-22 15:09:29.834--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.cache.shared.default; value=false; translated value=false
    [EL Finest]: 2010-09-22 15:09:29.834--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.jdbc.native-sql; value=true
    [EL Info]: 2010-09-22 15:09:29.866--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 1.2.0.v20091016-r5565
    [EL Info]: 2010-09-22 15:09:29.866--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Server: WebLogic Server 10.3.2.0  Tue Oct 20 12:16:15 PDT 2009 1267925
    [EL Config]: 2010-09-22 15:09:29.881--ServerSession(29669964)--Connection(16935504)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:09:29.944--ServerSession(29669964)--Connection(32957960)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Config]: 2010-09-22 15:09:29.944--ServerSession(29669964)--Connection(7874461)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:09:29.944--ServerSession(29669964)--Connection(7387593)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Info]: 2010-09-22 15:09:30.428--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model login successful
    [EL Finest]: 2010-09-22 15:09:30.444--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The applicationName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload]
    [EL Finest]: 2010-09-22 15:09:30.444--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The moduleName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload-ViewController-context-root]
    [EL Finest]: 2010-09-22 15:09:30.444--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--End deploying Persistence Unit Model; state Deployed; factoryCount 1
    [EL Finer]: 2010-09-22 15:09:30.475--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client acquired
    [EL Finer]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX binding to tx mgr, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--PERSIST operation called on: fu.model.entity.Document@1b12136.
    [EL Finest]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--PERSIST operation called on: fu.model.entity.Dummy@1fc0ac1.
    [EL Finer]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beforeCompletion callback, status=STATUS_ACTIVE
    [EL Finer]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--begin unit of work commit
    [EL Finer]: 2010-09-22 15:09:30.506--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beginTransaction, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:09:30.537--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query InsertObjectQuery(fu.model.entity.Document@1b12136)
    [EL Finest]: 2010-09-22 15:09:30.553--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--reconnecting to external connection pool
    [EL Fine]: 2010-09-22 15:09:30.553--ClientSession(3813659)--Connection(31488401)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO DOCUMENT (ID, TITLE, DOC, TYPE) VALUES (?, ?, ?, ?)
         bind => [107, Oracle Text 107, [B@88e6ad, DOC]
    [EL Fine]: 2010-09-22 15:09:30.584--ClientSession(3813659)--Connection(31488401)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT DOC FROM DOCUMENT WHERE (ID = ?) FOR UPDATE
         bind => [107]
    [EL Finest]: 2010-09-22 15:09:30.725--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Writing BLOB value(size = 152,064 bytes) through the locator to the table field: DOC
    [EL Finest]: 2010-09-22 15:09:30.725--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query InsertObjectQuery(fu.model.entity.Dummy@1fc0ac1)
    [EL Fine]: 2010-09-22 15:09:30.725--ClientSession(3813659)--Connection(31488401)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO DUMMY (ID, DUMMYCOLUMN, DOCUMENT_ID) VALUES (?, ?, ?)
         bind => [107, null, null]
    [EL Finer]: 2010-09-22 15:09:30.772--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX afterCompletion callback, status=COMMITTED
    [EL Finer]: 2010-09-22 15:09:30.772--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--end unit of work commit
    [EL Finer]: 2010-09-22 15:09:30.772--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--release unit of work
    [EL Finer]: 2010-09-22 15:09:30.772--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client releasedRegards,
    Alexandar

  • Image stored in BLOB column crashes report's engine

    Hi,
    I have a report where I display logos stored in a BLOB column on the DB.
    The report is generated as RTF.
    When images have sizes of 624x168 or 423x324 everything is OK. One image, 1221x224, is crashig the report with a dr. Watson error.
    Any idea why?
    The size of the "bad" image file is 38K, and the "good" ones are about 300K.
    Monica

    Sajjad wrote:
    I altered student table to store photoes of students. For this I added STIMG as blob, MIMETYPE,FILENAME,IMAGE_LAST_UPDATE COLUMNS to studentadmitted table. Image stored and displayed in report very nicely. With the following query
    select "ROWID",
    "ST_ID",
    "FIRST_NAME",
    "LAST_NAME",
    "FFIRST_NAME",
    "FLAST_NAME",
    "COURSE_ID",
    "SESSION_ID",
    "CONTACT#" "CONTACT_H",nvl(dbms_lob.getlength(STIMG),0) IMAGE
    from "#OWNER#"."STUDENTADMITTED"
    Images are displayed in column but they have different sizes.Stick to declarative BLOB images as above. They can be resized in reports using CSS. Add a style sheet in the page Inline CSS property:
    td[headers="IMAGE"] img {
      display: block;
      width: 75px;
      border: 1px solid #999;
      padding: 6px;
      background: #f6f6f6;
    }where the <tt>IMAGE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, if the original images are large then scaling them in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. Downloading megapixel images and then reducing them to thumbnail size results in pointlessly pushing millions of bytes that will never be seen.
    For improved performance and image quality, and where you require image-specific scaling the best approach is to use the database ORDImage object to produce thumbnail and preview versions automatically. Note that this is not possible in Oracle XE as Multimedia is not included

  • How to transfer data within blob column to server

    Hi,
    I have the following requirement where i have a table which has a blob column that holds the files that are attached to a page using front end. I need to fetch these files and import them to server. How do i go about in achieving this?
    Any in\puts would be of great help.
    Thanks In Advance.

    876841 wrote:
    Hi,
    I have the following requirement where i have a table which has a blob column that holds the files that are attached to a page using front end. I need to fetch these files and import them to server. How do i go about in achieving this?
    Any in\puts would be of great help.Well, if the blob data is stored in columns on the database then it already resides on the server. If you need to save that data as files on the server then it's just a case of writing out the data to a file in the appropriate directory location.
    Example code... (untested)...
    As sys user:
    CREATE OR REPLACE DIRECTORY MY_FILES AS 'c:\myfiles';
    GRANT READ,WRITE ON DIRECTORY MY_FILES TO myuser;As myuser:
    DECLARE
       -- Data Variables
       v_blob             BLOB;
       v_data_length      NUMBER;
       -- Loop Control Variables
       v_offset           NUMBER := 1;
       v_chunk   CONSTANT NUMBER := 32767; -- maximum chunk size
       -- UTL_FILE variables
       fh                 UTL_FILE.file_type;
    BEGIN
       v_blob := ... populate the blob variable here
       v_data_length := DBMS_LOB.getlength (v_blob);
       -- Open the file
       fh := UTL_FILE.fopen ('MY_FILES', 'myfile.dat', 'wb', v_chunk);
       LOOP
          -- Exit when our file offset is bigger than our file
          EXIT WHEN v_offset > v_data_length;
          -- Write the output chunk by chunk
          UTL_FILE.put_raw (fh, DBMS_LOB.SUBSTR (v_blob, v_chunk, v_offset), TRUE);
          -- Increment the offset by the amount written
          v_offset := v_offset + v_chunk;
       END LOOP;
       -- Close the file
       UTL_FILE.fclose (fh);
    END;

  • Conver BLOB column value to XML

    Oracle 10G
    My table has BLOB column my requirement is BLOB values needs to be populated in sequence file
    right now am using Java code to convert into XML then ETL tool to extrcat in to sequence file
    is is possible to pull directly into sequence file??
    Thanks in advance
    Edited by: Kalinga on Dec 8, 2009 9:19 PM

    The thread's subject refers to converting a BLOB to a XML, and you're posting mentions converting it to a sequence file...
    Not sure what you define a sequence file to be? Or what the intention is...
    BLOBs are used to store binary data. CLOBs are used to store character data.
    If the data is to be extracted as is into a file for a tool to use, the UTL_FILE can be used to read the contents of the BLOB/CLOB and write it to file.
    In other words, if you have a XML CLOB and an external tool needs the data as a file, there is no data conversion as such required. Only data dumping. Reading that CLOB (without conversion to other data types) and writing it to a file.
    If the CLOB data (in XML format) do needs to be processed as a XML DOM, then the SQL function XMLTYPE() can be used to convert that XML in the CLOB to a XML data type that can be processed using XML functions.
    If the CLOB data is in a non-XML format and it needs to be converted into XML and then spooled to a file, you need to write a parser that extracts that CLOB data into a SQL structure (e.g. a global temporary table), and then make use of XML functions and SQL to convert that data into a XML DOM.
    Once that is done, the XML DOM contents can be saved as a CLOB and written to an external file for external tools to use.
    If you can be more specific about what the actual problem is, and what (4 digit) Oracle version you are using, the forum can supply more detailed responses - instead of trying to guess what you are trying to achieve and what the meaning is of terms like "+sequence file+".

  • Error when inserting  file 4KB in a BLOB column.

    Hello,
    I am getting the following error when I am trying to insert a file > 4KB in a
    BLOB column.
    ORA-01461: can bind a LONG value only for insert into a LONG column.
    We are using Weblogic5.1.0 sp10, Oracle 8.0.5 with WL OCI driver.
    There is no change even after setting the following property weblogic.oci.min_bind_size=660
    Please can anyone help?
    Thanks.

    Hello,
    I tried using the following sql stmts to override the NLS_LANG setting on both
    server and client for a session.
    ALTER SESSION SET NLS_LANGUAGE = AMERICAN;
    ALTER SESSION SET NLS_TERRITORY = AMERICA;
    It still gave the same error.
    I tried the same using Oracle thin driver.Even then the same problem.
    As I mentioned earlier, we are using oracle 8.0.5.
    and here is the code I am using for writing BLOB data
    java.sql.PreparedStatement prepstmt = conn.prepareStatement("Update TEST_BLOB
    set BLOBATTACH = ? where IDX =1");
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    ObjectOutputStream p = new ObjectOutputStream(ostream);
    p.writeObject(data);
    prepstmt.setBinaryStream(1, new ByteArrayInputStream(ostream.toByteArray()), ostream.size());
    prepstmt.executeUpdate();
    prepstmt.close();
    Any suggestions ?
    Thanks.
    "Slava Imeshev" <[email protected]> wrote:
    Latha,
    You need to make sure you have the same NLS_LANG setting both for the
    client
    and the server.
    Regards,
    Slava Imeshev
    "Latha Pusapaty" <[email protected]> wrote in message
    news:[email protected]...
    I Tried that. But still getting the same exception.
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insertinto a
    LONG column
    at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:230)
    at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:980)
    atweblogic.jdbc20.pool.PreparedStatement.executeUpdate(PreparedStatement.java:
    47)
    atweblogic.jdbc20.rmi.internal.PreparedStatementImpl.executeUpdate(PreparedSta
    tementImpl.java:54)
    atweblogic.jdbc20.rmi.SerialPreparedStatement.executeUpdate(SerialPreparedStat
    ement.java:55)
    at fictx.TRServlet.doPost(TRServlet.java, Compiled Code)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, CompiledCode)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, CompiledCode)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    Compiled Code)
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java,
    Compiled Code)
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java,
    Compiled Code)
    atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java,
    Compiled Code)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,Compiled
    Code)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,Compiled
    Code)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    Same code is working fine for files less than 4000 bytes.
    Oracle table has only one BLOB column.
    I have set weblogic.oci.selectBlobChunkSize=1200 .
    Where could be the problem?
    Andreas Bittorf <[email protected]> wrote:
    We resolved the problem as following:
    ps = con.prepareStatement
    ("update tq_businessmodel set
    businessmodel=?,lastupdate=?
    "WHERE taskid=?");
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    ObjectOutputStream p = new ObjectOutputStream(ostream);
    p.writeObject(businessModel);
    ps.setBinaryStream(1, newByteArrayInputStream(ostream.toByteArray()),
    ostream.size());
    ps.setTimestamp(2,new Timestamp(System.currentTimeMillis()));
    ps.setLong(3,taskid);
    ps.executeUpdate();

  • Processing OrdImage data into a BLOB column

    Hi,
    I am importing 30Mb Tiff images into an ordsys.ordimage column within an image table. All is fine with the import part. I now want to populate a blob column in the same table with a jpeg generated from the tiff. I have tried many variations of the .process and .processcopy functions but I'm getting nowhere. Can anyone help?

    You will need to tell us more about what "getting nowhere" means. Are you getting errors? Or do you just not know where to begin? I'll assume the latter.
    First of all, you definitely want to use the processCopy() method. process() will overwrite your original TIFF image. If you want the JPEG in a separate column, you must use processCopy to keep the original and create a new copy. Does your JPEG image have to be in a BLOB column? Why don't you store this in an ORDImage column as well? If you store it in an ORDImage column, you can use the processCopy method. If you must use a BLOB column, you need to look at the processCopy procedure of the relational interface.
    The interMedia Quick Start Guide for the Object Interface (there is also one for the relational interface if you really must use a BLOB column for your JPEG image column), has a good example of using the processCopy method to create a JPEG thumbnail. You can find it here:
    http://www.oracle.com/technology/sample_code/products/intermedia/files/quickstart_guides/intermedia_qs_image.pdf
    See the section on Creating Thumbnails and Changing Formats.
    If you have selected the source image into an ORDImage variable imgSrc, and the destination image into a variable imgDst, the process command to create a similar JPEG image is:
    imgSrc.processCopy('fileformat=jfif', imgDst);

  • Error while importing a table with BLOB column

    Hi,
    I am having a table with BLOB column. When I export such a table it gets exported correctly, but when I import the same in different schema having different tablespace it throws error
    IMP-00017: following statement failed with ORACLE error 959:
    "CREATE TABLE "CMM_PARTY_DOC" ("PDOC_DOC_ID" VARCHAR2(10), "PDOC_PTY_ID" VAR"
    "CHAR2(10), "PDOC_DOCDTL_ID" VARCHAR2(10), "PDOC_DOC_DESC" VARCHAR2(100), "P"
    "DOC_DOC_DTL_DESC" VARCHAR2(100), "PDOC_RCVD_YN" VARCHAR2(1), "PDOC_UPLOAD_D"
    "ATA" BLOB, "PDOC_UPD_USER" VARCHAR2(10), "PDOC_UPD_DATE" DATE, "PDOC_CRE_US"
    "ER" VARCHAR2(10) NOT NULL ENABLE, "PDOC_CRE_DATE" DATE NOT NULL ENABLE) PC"
    "TFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS"
    " 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TS_AGIMSAPPOLOLIVE030"
    "4" LOGGING NOCOMPRESS LOB ("PDOC_UPLOAD_DATA") STORE AS (TABLESPACE "TS_AG"
    "IMSAPPOLOLIVE0304" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE L"
    "OGGING STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEF"
    "AULT))"
    IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'TS_AGIMSAPPOLOLIVE0304' does not exist
    I used the import command as follows :
    imp <user/pwd@conn> file=<dmpfile.dmp> fromuser=<fromuser> touser=<touser> log=<logfile.log>
    What can I do so that this table gets imported correctly?
    Also tell me "whether the BLOB is stored in different tablespace than the default tablespace of the user?"
    Thanks in advance.

    Hello,
    U can either
    1) create a tablespace with the same name in destination where you are trying to import.
    2) get the ddl of the table, modify the tablespace name to reflect the existing tablespace name in destination and run the ddl in the destination database, and run your import command with option ignore=y--> which will ignore all the create errors.
    Regards,
    Vinay

Maybe you are looking for