BLOB column datatype

Hi
I have one column which is of datatype BLOB.File was there in the blob column. File Contains the XML tags.My Requirement is need to extract the tag value.
EX:in XLM i need to extract <name>Rajesh</name>
Bottom line is Need to extract one tag value from BLOB dataype column which contains the file in which XML tags were there.
Plz Help

user12057782 wrote:
Hi
I have one column which is of datatype BLOB.File was there in the blob column. File Contains the XML tags.My Requirement is need to extract the tag value.
EX:in XLM i need to extract <name>Rajesh</name> That's not good. BLOB should store binary data. CLOB should store character based data. XML is character based, so you could end up corrupting the XML by storing it in a BLOB.
Oracle also has an XMLTYPE datatype specifically for storing XML data in, so why aren't you using that?
Bottom line is Need to extract one tag value from BLOB dataype column which contains the file in which XML tags were there.Here's a basic example of extracting XML from an XMLTYPE (you can easily convert CLOB to XMLTYPE using it's constructor method)...
SQL> ed
Wrote file afiedt.buf
  1  with t as (select XMLTYPE('<cube>
  2                                <dimension>
  3                                   <sourcename>A1</sourcename>
  4                                   <targetname>X1</targetname>
  5                                </dimension>
  6                                <dimension>
  7                                   <sourcename>B1</sourcename>
  8                                   <targetname>Y1</targetname>
  9                                </dimension>
10                                <dimension>
11                                   <sourcename>C1</sourcename>
12                                   <targetname>Z1</targetname>
13                                </dimension>
14                             </cube>
15                           ') as xml
16             from dual
17            )
18  -- end of test data
19  select x.*
20  from t
21      ,XMLTABLE('/cube/dimension'
22                PASSING t.xml
23                COLUMNS sourcename VARCHAR2(2) PATH '/dimension/sourcename'
24*                      ,targetname VARCHAR2(2) PATH '/dimension/targetname') x
SQL> /
SO TA
A1 X1
B1 Y1
C1 Z1
SQL>If that isn't quite what you want, provide more information with your database version, example data and expected output, as detailed in the FAQ: {message:id=9360002}
I'm surprised that as a member who's been here for 3 years+ and asked 32 questions, you still haven't understood how to ask a question so that people can help you. Perhaps that explains why you still have 27 question showing as unanswered.

Similar Messages

  • Need to create link to Word Doc in blob column in search results report

    I got the Oracle Text boolean search of word documents in a blob column of a table working.
    Now I need to be able to create a link in the results report.
    I know that Oracle creates a link for each document in the column when you attach a file, I just need to know what the link should be to allow users to open the document in the search results report.
    Right now the application is set to do a search in the attached word documents, and in the results window it shows the names of the people who match the search, but it won't allow me to create a link to their resume in the results report.
    the name of the table is CONTRACTOR_LIST and the blob column is RESUME.
    How would you go about creating a simple link to the word file in the results window?
    Here is the code for the query
    select score(1) relevance, Name, Resume
    from contractor_list
    where CONTAINS (resume, :P1_SEARCH, 1) > 0
    order by 1 desc
    That works, but I can't get it to link to the resume file.
    Here is the code I'm using for the link
    javascript:popupURL(&quot;#RESUMEL#&quot;)
    This just give me an error page and the the link is
    http://server-namer:8080/apex/[datatype]
    the error is
    Bad Request
    The HTTP client sent a request that this server could not understand.
    Thanks again!
    Edited by: gjones77 on Dec 2, 2008 6:14 AM
    Edited by: gjones77 on Dec 2, 2008 7:08 AM

    It is within the table I believe (I'm not a DBA or a developer) since I created a BLOB column and then used the file browse feature to allow users to attach a resume to the table in order to be able to perform a search of the attached documents.
    I'm just having a hard time pointing the link in the search results report to the document in the blob column.
    The information on that page is great if you're trying to create a link to the document on the initial report.
    But I created a query using Oracle Text to run a report that does a boolean search of the attached word documents in the table.
    When it displays the search results, it doesn't create a link to the document and I can't figure out how to do it.
    Here's a link the the instructions I used to create the initial search report with Oracle Text, mind you I only created the index and query, I didn't add in all the link data since they're using documents on websites and I'm using documents in a table.
    http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
    If you can help me with this I'd really appreciate it.
    Thanks again.
    Greg
    Edited by: gjones77 on Dec 2, 2008 8:14 AM

  • How to extract a csv registered in a BLOB column

    I've got a BLOB column where there is a CSV. How can I download the CSV?
    Oracle vers. 8i
    Thanks in advance!

    Mark1970 wrote:
    I've got a BLOB column where there is a CSV. How can I download the CSV?
    Oracle vers. 8i
    Thanks in advance!Your question is unclear.
    BLOB = large object storage for Binary data.
    CSV = Character seperated values, representing character based data.
    Download = terminology for transferring files or data from the internet to a local client computer.
    So, questions...
    Why are you storing character data in a binary datatype?
    What do you mean by "download"?
    and as an aside...
    Why are you using such an outdated and unsupported version of Oracle? Get it upgraded.

  • Blob Column in Data Template

    Below is simple Example I tried and output doesnot look right.
    Note: My Blob Database Column is "LOGO".
    Sample Data Template:
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <dataTemplate name="Employee_Listing" description="List of
    Employees">
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT EMPNO,ENAME,JOB,LOGO from
    EMP]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_EMP" source="Q1">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME"/>
    <element name="JOB" value="JOB" />
    <element name="LOGO" value="LOGO" />
    </group>
    </dataStructure>
    </dataTemplate>
    Sample Ouput Created
    <?xml version="1.0" encoding="UTF-8"?>
    <EMPLOYEE_LISTING>
    <LIST_G_EMP>
    <G_EMP>
    <EMPLOYEE_NUMBER>999</EMPLOYEE_NUMBER>
    <NAME>PILLAI</NAME>
    <JOB>MGR</JOB>
    <LOGO/>
    </G_EMP>
    </LIST_G_EMP>
    </EMPLOYEE_LISTING>
    My Question is :
    Does output should have only a TAG for Blob Column or it should have image data
    which can be rendered through Template using fo:instream tags.
    Am I hitting any bug which is preventing retrieving Blob data through XML data template

    I need to get data out of a BLOB column from a table in an Oracle 8i database and into a file that I can put into a MS Word template. The data in the BLOB column came from a MS Word document. What is the best way to proceed? We have a LOB datatype sample which shows how to save a blob from the DB to a local file at http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
    I'd save it to a temp file and then using word add it. You could also spawn wscript.exe to run a Windows VB Script to automate word from the java application.
    Rob

  • Unable to read BLOB column

    Hi,
    I want to read data in text format from the BLOB column
    XML_col is the column with BLOB datatype in TEST table.
    select BLOB2VARCHAR(XML_col) from TEST;
    I created BLOB2VARCHAR function to convert from BLOB to Varchar.
    CREATE OR REPLACE FUNCTION TEST_fnc (html IN BLOB)
    RETURN VARCHAR2
    IS
    tmpvar NUMBER;
    tmpchr VARCHAR2 (4000);
    BEGIN
    tmpchr := UTL_RAW.cast_to_varchar2 (DBMS_LOB.SUBSTR (html, 4000, 1));
    tmpchr := SUBSTR (tmpchr, 1, 4000);
    RETURN tmpchr;
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN NULL;
    END blob2varchar;
    I am getting output as ’
    Which i guess is wrong.

    Hi,
    This will print your output character by character
    Try this and let me know
    DECLARE
       v_read_bytes  BINARY_INTEGER;
       v_pos         INTEGER;
       v_blob_len    INTEGER;
       v_buffer      RAW(200);
       v_file_data   fnd_lobs.file_data%TYPE;
    BEGIN
             SELECT file_data
               INTO v_file_data
               FROM fnd_lobs
              WHERE file_id = 121708;
             v_blob_len    := DBMS_LOB.getLength (v_file_data);
             v_pos         := 0;
             v_read_bytes  := 1;
             WHILE v_pos <= v_blob_len
             LOOP
                v_pos         := v_pos +  1;
                DBMS_LOB.read (v_file_data, v_read_bytes, v_pos, v_buffer);
                DBMS_OUTPUT.PUt_line(utl_raw.cast_to_varchar2(v_buffer));
             END LOOP;
    END;

  • Column Datatype modify

    Hi,
    How can i modify a column datatype varchar2(100) into blob in a table.
    Regards,
    Fame

    create table x (y varchar2(100));
    insert into x values ('A');
    commit;
    alter table x rename column y to z;
    alter table x add (y clob);
    update x set y = z;
    commit;
    alter table x drop column z;
    Table dropped.
    Table created.
    1 row created.
    Commit complete.
    Table altered.
    Table altered.
    1 row updated.
    Commit complete.
    Table altered.
    drop table x purge;
    create table x (y varchar2(10));
    insert into x values ('A');
    commit;
    alter table x rename column y to z;
    alter table x add (y blob);
    update x set y = utl_raw.cast_to_raw (z);
    commit;
    select * from x;
    update x set y = (z);
    commit;
    select * from x;
    alter table x drop column z;
    Table dropped.
    Table created.
    1 row created.
    Commit complete.
    Table altered.
    Table altered.
    1 row updated.
    Commit complete.
    Z          Y
    A          A
    1 row selected.
    1 row updated.
    Commit complete.
    Z          Y
    A          
    1 row selected.
    Table altered.

  • What is wrong with adding a BLOB column?

    What is wrong with adding a BLOB column?
    SQL>  alter table employee_dp add photo(blob(3000000);
    alter table employee_dp add photo(blob(3000000)
    ERROR at line 1:
    ORA-00902: invalid datatype
    SQL> alter table employee_dp add photo bolob(3000000);
    alter table employee_dp add photo bolob(3000000)
    ERROR at line 1:
    ORA-01735: invalid ALTER TABLE option

    Hi jetq,
    Don't give length.
    SQL> alter table t add photo blob;
    Table altered.Regards
    Peter

  • Performance of LOB Segments for Blob Columns

    Hi,
    I am migrating 11,000 rows of tiff images from Informix to Oracle.In Informix the datatype for the image storage is Byte and Oracle we chose it to Blob.
    The Blob column is creating lob segment and lob index.
    When I do the migration I observe that the size of the lob segment object is increasing rather than the table object.
    So due to creation of this lob segment for the Blob column,will there be any performance issues while retrieval of images from the database and Inserting images into into the database.
    Can I get all the issues that can be encountered by storing data in blob column in terms of lob segment.
    This is very important information for us as the application has lot of SQL queries for retrieving and injecting images in the database.
    It will be really apprecialbe if you can provide Information about this.
    Thanks & Regards
    Ramanathan KrishnaMurthy

    I agree with D.Morgan that object type with 250 attributes is doubtful.
    I don't like object tables (tables with "row objects") too.
    But, your table is a relational table with object column ("column object").
    C.J.Date in An introduction to Database Systems (2004, page 885) says:
    "... object/relational systems ... are, or should be, basically just relational systems
    that support the relational domain concept (i.e., types) properly - in other words, true relational systems,
    meaning in particular systems that allow users to define their own types."
    1. How will Oracle store the data in the ADT column?...
    For some answers see:
    “OR(DBMS) or R(DBMS), That is the Question”
    http://www.quest-pipelines.com/pipelines/plsql/tips.htm#OCTOBER
    and (of course):
    "Oracle® Database Application Developer's Guide - Object-Relational Features" 10g Release 2 (10.2)
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14260/adobjadv.htm#i1006903
    Regards,
    Zlatko

  • ORA-03237 when creating table with BLOB columns on Oracle 9i

    I am playing with my new Oracle 9i database. I am trying to copy
    tables from my 8.1.6 db. Three tables won't create due to this
    new message. The 9i documentation says it's soemthing to do with
    freelist groups but my DBA says he hasn't set up any.
    The tablespace is one of these newfangled locally managed
    tablespaces (predetermined size 8k).
    I can create these tables if I change the BLOB column to datatype
    VARCHAR2(4000).
    I have raised this through the usual channels, but I thought I'd
    try this site as well.
    Cheers, APC

    victor_shostak wrote:
    Figured, Virtual Columns work only for Binary XML.They are only supported, currently, for Binary XML.

  • Error while inserting into blob column through PL/SQL

    Hi All,
    I am trying to insert into column having blob as datatype.
    INSERT INTO imagedb(image_name, content,description) VALUES ('logo.png',
    ?{file 'c:\logo.png'}, 'logo');
    it gives me error Unknown JDBC escape sequence:
    Is there anything wrong in above insert syntax for inserting into BLOB data type.
    Can any body please help me.
    Regards,
    Hiren

    It is not valid SQL as far as Oracle SQL is concerned. I assume that the file construct is suppose to replace that with the contents of the file?
    What happens when the file size exceeds the max length of the SQL command?
    And do you have any idea what will happen to the SQL Shared Pool on Oracle that needs to store the entire SQL command for every single SQL command passed to it? The whole purpose of the Shared Pool is for storing shared SQL. Not non-sharable SQL containing hardcoded values.
    Bind variable are to be used.. if you expect Oracle to perform like only Oracle can.
    And my bet is that you have not even bothered to read [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm]Oracle® Database Application Developer's Guide - Large Objects guide....

  • 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

  • How to view PDF files strored in a BLOB column

    Hi all,
    I want to display a PDF file, stored in a BLOB column, in a form or through a JavaBean.
    But the problem is more complicated then that. I do not want to retrieve the PDF file in the application server that show it through a browser.
    Actually, I do not want users to get the entire file, I just want them to see it or print it.
    I want, in fact, to display a "stream" of bytes through Oracle Forms. Not a file.
    This one, sounded to be a good solution, but actually not. When the file was too big (multiple pages), the application was blocked until the entire file was loaded. And when you try to print it, it wasn't printed right. The advantage of this solution is that it is open-source so we can add methods to connect to the DB, retrieve the content of the BLOB column and displays it without downloading the file.
    Here is a good solution. Really good, files are loaded quickly, the rendering is really good and the file is printed perfectly (as it was printed from Adobe Acrobat). The disadvantage of this solution is that it is not open-source and is really expansive.
    As you can see, both solutions uses PJC.
    So any help, any idea to solve my problem will be highly appreciated.
    Thanks to all of you,
    Amine
    PS : I am using F&R 11gR2

    Not entirely. At least we came to the conclusion it doesn't make (much) sense to block the save option of PDFs if you want to allow printing them
    Anyway; there is of course another possibilty: you could always write your own java bean PDF reader; there are plenty of java PDF libraries available:
    Open Source PDF Libraries in Java
    The easiest way would be to choose one which can open a PDF from a URL and render it; I would retrieve the image via mod_plsql using WPG_DOCLOAD and simply use the PDF library to render the PDF. No tempfiles anyway, and if you don't implement it there is also no save button.
    cheers

  • 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();

  • Index creation on Blob column

    I am new to InterMedia. I am trying to create an index on a blob column. I am getting a error -
    Can you please suggest me the solution of this problem.
    Thanks.......
    The following statement(s) failed to execute successfully.
    CREATE INDEX temp.ind1 ON temp.student(MOL) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('')
    ORA-29855: error occurered in the execution of ODCINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-50704: Net8 listener is not running or cannot start external procedures
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "CTXSYS.DRUE", line 122
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 34
    ORA-06512: at line 1
    null

    Listner problems probably. Please check the FAQ at http://technet.oracle.com/products/text/

  • How to read BLOB column from a table in SQL or PL/SQL

    I have table which is having one BLOB data type column . Ihave inserted few rows in that table . Now i want to see wheather BLOB column has been inserted properly or not . How to read that column through SQL or PL/SQL.
    Can anyone help me to do this.

    You can only manipulate LOBs in PL/SQL because you have to use the DBMS_LOB package.
    Check out the Oracle Developer's Guide

Maybe you are looking for

  • ITunes media folder on external HD issue...

    So I have a quick question... I've been using my external HD to house my iTunes library for over a year now. No issues, it's been working great. When I add new music to my library on my computer, it copies the files to my HD, or just reorganizes the

  • Can i delete my emails from the server using the default mail program in mountain lion?

    how can i delete emails from the server in mail on os 10.8.1?

  • How to include PL/SQL routines in a script

    I have some procedures in PL/SQL scripts (as libraries) and I need to use it in some other scripts. So I want to "include" the first ones in the seconds. Anything works ... PS : I use TOAD to update my database. Thanks for your help

  • JTable has two mouselistener?

    Hi, I have a JTable where one column is rendered by JCombobox and other column by JCheckbox. want to have this kind of functionality: I clicks several rows while ctrl is pressed (basic functionality) but when I click already selected row it becomes d

  • SEVERE Problem With Safari Bookmarks Sync

    Just thought I'd bring this one to people's attention (as well as submitting a bug report to Apple). I have my bookmarks synced across all devices (MacBook, iMac, iPhone) and recently I decided to tidy them up a bit. On the MacBook I started moving b