Multiple CLOB/BLOB

Hi there,
I'm looking for the way how to make multiple insert/update on a table with multiple CLOB/BLOB fields using Objects for OLE for C++. When I looked into samples, there is only single insert (of one CLOB). This, in turn, a provided sample will only over-write first inserted LOB with data that becomes to the last inserted row (and last column).
Thanks in advance for any comment back.
Nguyen Duy Hoa.

Hi,
See the sample BLOBs at the site http://www.geocities.com/oledbpro/docs/examples/blobs.htm, which tells you how to deal with multiple BLOBs/CLOBs etc within a rowset using OleDBPro.
Yuancai (Charlie) Ye
See 30 real well-tested advanced OLEDB samples
Use of free SocketPro for creating super client and server application with numerous samples
www.udaparts.com

Similar Messages

  • How to find out list of clob/blob tables in a schema

    Hi,
    I have tricky situation...i have 119 tables out of which 11 tables are clob/blob tables...is there any view where i can find out list of tables are clob/blob tables? (at schema level view means user_<>)
    -- Raman.

    USER_TAB_COLS includes the data type, column name, and table name for each column in each table in the system. You could query that looking for columns with a DATA_TYPE of CLOB or BLOB. If some tables have multiple LOB columns and you want them to appear only once, you'd have to throw a DISTINCT on the table name.
    Justin

  • Performance problem querying multiple CLOBS

    We are running Oracle 8.1.6 Standard Edition on Sun E420r, 2 X 450Mhz processors, 2 Gb memory
    Solaris 7. I have created an Oracle Text indexes on several columns in a large table, including varchar2 and CLOB. I am simulating search engine queries where the user chooses to find matches on the exact phrase, all of the words (AND) and any of the words (OR). I am hitting performance problems when querying on multiple CLOBs using the OR, e.g.
    select count(*) from articles
    where contains (abstract , 'matter OR dark OR detection') > 0
    or contains (subject , 'matter OR dark OR detection') > 0
    Columns abstract and subject are CLOBs. However, this query works fine for AND;
    select count(*) from articles
    where contains (abstract , 'matter AND dark AND detection') > 0
    or contains (subject , 'matter AND dark AND detection') > 0
    The explain plan gives a cost of 2157 for OR and 14.3 for AND.
    I realise that multiple contains are not a good thing, but the AND returns sub-second, and the OR is taking minutes! The indexes are created thus:
    create index article_abstract_search on article(abstract)
    INDEXTYPE IS ctxsys.context parameters ('STORAGE mystore memory 52428800');
    The data and index tables are on separate tablespaces.
    Can anyone suggest what is going on here, and any alternatives?
    Many thanks,
    Geoff Robinson

    Thanks for your reply, Omar.
    I have read the performance FAQ already, and it points out single CONTAINS clauses are preferred, but I need to check 2 columns. Also, I don't just want a count(*), I will need to select field values. As you can see from my 2 queries, the first has multiple CLOB columns using OR, and the second AND, with the second taking that much longer. Even with only a single CONTAINS, the cost estimate is 5 times more for OR than for AND.
    Add an extra CONTAINS and it becomes 300 times more costly!
    The root table is 3 million rows, the 2 token tables have 6.5 and 3 million rows respectively. All tables have been fully analyzed.
    Regards
    Geoff

  • Extracting clob/blob/long datatypes in delimited file

    I have a few tables in database that have clob/blob/long datatypes. I need to unload this data into delimited file and reload the data into another database. I don't want to use export/import.
    Currently the code that i have can handle varchar2, number, date datatypes quite easily using sqlloader.
    The tables are not too big (hundred to 10k rows approximately) and performance is important but not crucial. The script can run for a few minutes unloading data, that is fine. Code maintenance is of higher priority with pl/sql being the preferred scripting language.
    From the sqlloader manual, i glean that use of special delimiter is important, something like <startlob> and <endlob> .
    I need ideas on how to do this.

    Hi Buddy.
    I am having same kind of Problem. I am using very similar procedure Instead of PUT_RAW I am using put line.
    Writing is not a problem after writing the image into a file I cannot open that. That means Image got corrupted. If you find out some solutions for your problem please help me
    My email id is [email protected]
    Thanks
    AJI

  • CMP EJB CLOB/BLOB retrieval issues from Oracle through JBoss

    I have some EJB 2.0 CMP Entity Beans, deployed on a JBoss 3.07 application server.
    In some of my beans I have Strings that I would like to map to a CLOB in my database as the Strings could easily be more than 4000 characters, and some byte arrays that I would like to map to a BLOB in my database to store files.
    When I use PostgreSQL as my datastore in JBoss I can store and retrieve data from my CLOBs and BLOBs just fine.
    However when I use an Oracle 9i (9.0.1) database for my datastore, I can write the information to the CLOB/BLOB fields (I can see it when I manually check the tables), but for some reason I cannot retrieve the information when I load my beans. The fields that map to the CLOB/BLOB are null, and eventually resave themselves overwriting the data in the database.
    When I test using LONG RAW as a type it works perfectly, but LONG RAW is not a standard SQL type. I do not want to convert my beans to BMP, and also do not want to have any Oracle specific code in my beans to store retrieve my information. I need my beans to be completely database independant.
    Does anyone have any ideas what could be causing my retrieval problem and what I could do to fix it?

    I solved my problem.
    I am using XDoclet to generate my bean interfaces and xml files etc., and it generates the jbosscmp-jdbc.xml file for me.
    I forgot to add @jboss tags to my beans so that the jbosscmp-jdbc.xml file includes tags to overwrite the default cmp mapping (string to varchar) to be from string to clob for those specific long string fields that i want.

  • BLOB-- CLOB-- BLOB conversion reducing length of BLOB

    Hi,
    I am using the following BLOB-->CLOB and CLOB-->BLOB conversion functions :
    CREATE OR REPLACE FUNCTION blob_to_clob (blob_in IN BLOB)
    RETURN CLOB
    AS
         v_clob CLOB;
         v_varchar RAW(32001);
         v_varchar1 VARCHAR2(32001);
         v_start     INTEGER := 1;
         v_buffer INTEGER := 32001;
    BEGIN
         DBMS_LOB.CREATETEMPORARY(v_clob, TRUE);
         FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer)
         LOOP
         DBMS_LOB.READ(blob_in,v_buffer,v_start,v_varchar);
    DBMS_LOB.WRITEAPPEND(v_clob, utl_raw.length(v_varchar), v_varchar);
         v_start := v_start + v_buffer;
         END LOOP;
    RETURN v_clob;
    END blob_to_clob;
    CREATE OR REPLACE FUNCTION clob_to_blob (clob_in IN CLOB)
    RETURN BLOB
    AS
         v_blob BLOB;
         v_varchar RAW(32001);
         v_varchar1 RAW(32001);
         v_start     INTEGER := 1;
         v_buffer INTEGER := 32001;
    BEGIN
         DBMS_LOB.CREATETEMPORARY(v_blob, TRUE);
         FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(clob_in) / v_buffer)
         LOOP
         DBMS_LOB.READ(clob_in,v_buffer,v_start,v_varchar);
    DBMS_LOB.WRITEAPPEND(v_blob, utl_raw.length(v_varchar), v_varchar);
              v_start := v_start + v_buffer;
         END LOOP;
    RETURN v_blob;
    END clob_to_blob;
    I am using these functions to convert image files, stored as BLOB to CLOB for intermediate storage, and then converting them back to BLOB. In this process, I see a loss of information when the image is converted from CLOB to BLOB ...which is seen by using dbms_lob.getlength() .Using the following sql query:
    select dbms_lob.getlength(file_body),
    dbms_lob.getlength(blob_to_clob(file_body)),
         dbms_lob.getlength(clob_to_blob(blob_to_clob(file_body)))
    from my_table where image_id in (8819)
    i see that returned length is usually half in the 3rd column, i.e. for dbms_lob.getlength(clob_to_blob(blob_to_clob(file_body))). There is no change in length for 1st and 2nd columns. Could you please let me know why length is getting lost in the CLOB to BLOB conversion ? Thanks.

    Thanks for replying.
    This is required because we have to store images in ldt files using FNDLOAD, whiich only supports CLOB, not BLOB. I understand that images stored in binary formats should be stored in BLOB only, but I am exploring the possibility of converting BLOB format to CLOB and then back to BLOB without loss of information. Any pointers in this regard are appreciated. Thanks !

  • Issue with Oracle datatypes like RAW,CLOB&BLOB

    Hello,
    I have developed an windows application using c#
    My requirement is to display data which having datatypes as RAW,CLOB,BLOB etc:
    But i am not able to bind these datatypes to gridview in my application.
    Pleasse ,suggest me way how to fix this.

    You'll need to provide some more details such as a short code snippet of what you are doing?
    What is your expectation as to how a RAW or BLOB should be displayed in a GridView?

  • How to improve Oracle Veridata Compair pair performance with tables that have big (30-40MB)CLOB/BLOB fileds ?

    How to improve Oracle Veridata Compair pair performance with tables that have big (30-40MB)CLOB/BLOB fileds ?

    Can you use insert .. returning .. so you do not have to select the empty_clob back out.
    [I have a similar problem but I do not know the primary key to select on, I am really looking for an atomic insert and fill clob mechanism, somone said you can create a clob fill it and use that in the insert, but I have not seen an example yet.]

  • Retrieving multiple CLOBs?

    Dealing with text values over 32K is a bit of a nuisance. I've followed the example here, which populates a collection with the value you're trying to retrieve and uses Javascript to retrieve the value. This example, however, only works with a single CLOB. It says that it's possible to do this with multiple CLOBs, but never goes into detail. How can this mechanism be used to retrieve the values of, say, two CLOBS?
    UPDATE: Sorry, forgot the link to Carl Backstrom's blog: [New Stuff (4) Hit you over the head with a CLOB!|http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html]
    Edited by: eaolson on May 29, 2009 2:07 PM

    Larry Linnemeyer wrote:
    Not sure what example you are referring too, but...Well, following Carl's example, you create a collection called CLOB_CONTENT and populate the CLOB001 column. Then, in Javascript, create an instance of apex.ajax.clob and use the _get() method to retrieve the contents of the CLOB001 column and insert them into your page.
    His example says it's simple to extend this to multiple CLOBs. It's non-obvious to me how to go about doing that.

  • Multiple CLOB's/BLOB's in one SELECT

    Hi
    Is there a standard way to retrieve several
    CLOB fields from a resultset? I get an SQLException,
    Stream has already been closed if I do not select the
    fields out, one at a time. What is the correct
    way to deal with this? I'd love to be able to
    while(resultset.next())
    switch(resultsetmetadata.getColumnType(col))
    case java.sql.Types.LONGVARCHAR:
    InputStreamReader isr = new InputStreamReader...
    break;
    default:
    returnvector.addElement(set.getString(col));
    break;
    instead of having to create a new statement each time
    I encounter a CLOB in my resultset.
    Any help/pointers greatly appreciated.
    Morten
    null

    Make a backup copy of the file incase something goes wrong, then:
    Make sure the frames snap to the margins on all sides -- change the margins on the applied master page to achieve this, if necessary.
    Enable Layout Adjustment (Layout > Layout Adjustment...)
    On the master page change the margins to be the size you want the new text frame dimensions to be.
    If, for some strange reason, you don't want to use these margin settings in the layout, turn OFF layout adjustment and reset them on the master page again to what you want.

  • Multiple clobs in a single row of data

    I have several clobs in a single row of data and have created a procedure where I attempt to display the first 4k of each clob.
    using a for loop cursor I select all of the clobs in a row at the same time and then I use dbms_lob.read to get the first 4k of data.
    For the first lob of each row everything works fine but when I attempt to dbms_lob.read the second one I get an "ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275" and I'm not sure why?
    does anyone know of an example where two or more clobs are selected and then converted to 4K varchars?
    sample columns for the table:
    SPECIALREQUIREMENTSS     CLOB
    REFERENCERANGE     CLOB
    ALERTVALUE     CLOB
    REFERENCELAB     VARCHAR2(50 CHAR)
    TESTINCLUDES     CLOB
    LASTUPDATE     DATE
    sample code (I removed some code for clairity - this produces the same error):
    create or replace
    procedure test_lobs as
    v_lab_blob blob;
    v_lobamt binary_integer := 32767;
    v_lobpos pls_integer := 1;
    v_labrec labman.lab_testingdata%rowtype;
    v_buffer varchar2(32767) :='';
    v_start_left number;
    begin
    -- *** housekeeping
    dbms_lob.createtemporary(v_labrec.testincludes,TRUE);
    dbms_lob.createtemporary(v_labrec.specialrequirementss,TRUE);
    Plpdf.init;
    Plpdf.NewPage;
    Plpdf.SetColor4Drawing(66,66,66);
    Plpdf.SetColor4Filling(180,180,180);
    v_start_left := Plpdf.GetPageWidth-Plpdf.GetPageRightSpace;
    -- *** select the test name for shaded printing
    for x in (select indexnumber, test from labman.lab_testingdata where test like 'A%') loop
    -- *** select the test data for printing
    select * into v_labrec from labman.lab_testingdata where indexnumber = x.indexnumber;
    -- *** test includes
    if dbms_lob.getlength(v_labrec.testincludes) > 0 or v_labrec.testincludes is not null then
    Plpdf.SetPrintFont('Arial','B',8);
    Plpdf.LineBreak(.1);
    Plpdf.PrintCell(25,5,'Test Includes:',0,0,'R',0,null,0);
    Plpdf.SetPrintFont('Arial',null,8);
    if dbms_lob.getlength(v_labrec.testincludes) > 32767 then
    v_buffer := '*** error - text is greater than 32k ***';
    else
    v_lobamt := 32767;
    v_buffer := '';
    dbms_lob.read(v_labrec.testincludes,v_lobamt,v_lobpos,v_buffer);
    end if;
    Plpdf.SetLeftMargin(Plpdf.GetCurrentX);
    Plpdf.PrintFlowingText(5,v_buffer,null,0);
    Plpdf.SetLeftMargin(v_start_left);
    Plpdf.lineBreak;
    end if;
    -- *** special requirements
    Plpdf.SetPrintFont('Arial','B',8);
    Plpdf.LineBreak(.1);
    Plpdf.PrintCell(25,5,'Special Requirements:',0,0,'R',0,null,0);
    Plpdf.SetPrintFont('Arial',null,8);
    if dbms_lob.getlength(v_labrec.specialrequirementss) > 32767 then
    v_buffer := '*** error - text is greater than 32k ***';
    elsif dbms_lob.getlength(v_labrec.specialrequirementss) = 0 then
    v_buffer := '';
    else
    v_lobamt := 32767;
    v_buffer := '';
    dbms_lob.read(v_labrec.specialrequirementss,v_lobamt,v_lobpos,v_buffer);
    end if;
    Plpdf.SetLeftMargin(Plpdf.GetCurrentX);
    Plpdf.PrintFlowingText(5,v_buffer,null,0);
    Plpdf.SetLeftMargin(v_start_left);
    Plpdf.lineBreak;
    commit;
    end loop;
    Plpdf.SendDoc(v_lab_blob);
    -- store the PDF document
    delete from store_blob;
    commit;
    INSERT INTO STORE_BLOB (blob_file, created_date)
    VALUES (v_lab_blob, SYSDATE);
    COMMIT;
    end test_lobs;

    didn't think that checking for a length of zero and null would produce two different results - should have known better.
    Thanks for your help!
    elsif dbms_lob.getlength(v_labrec.specialrequirementss) = 0
    or v_labrec.specialrequirementss is null then

  • How to display clob/blob in the web layout using Reports9i

    Hi,
    I've created a report that selects both a clob and blob datatype in the query. However, when I run the report using the 'Run Web Layout' tool no data is displayed for these columns. Does the <rw:field> tag support such datatypes ?.
    Regards,
    Chris

    Hi Chris,
    Reports9i supports both BLOB and CLOB in both paper as well as web layout. Pl make sure that in the column properties that you want to display, you have selected the "File Format" correctly (to do this, go to data model > column > property inspector > file format). Eg, you can select "text", "image" etc depending on what you have stored in the column. Also, when you want to display an image in the web layout, you will have to write containsHtml="yes" inside your <re:field> tag.
    Navneet.

  • Java Derby with CLOB & BLOB

    Hello,
    i want to read an "OLE-Object (BLOB)" and Remarks data column from a MS Access database and must store these data into a Java Derby database. Must i convert these data types into CLOB and BLOB?
    Have somebody a code example for this?
    Thank you
    Tom

    Sorry, i mean "Text" datatype instead of Remarks in the MS Access database!
    Best regards
    Tom

  • Using TRUNCATE to free space used by CLOB/BLOB

    Hi ,
    Can we free the complete space used by a CLOB or BLOB by issuing a TRUNCATE command on the table containg these large objects?

    Sorry about my loose terminology - yes I did mean a sparse bundle. Yes if the backup is created on a local disk, it uses ordinary folders. If it is first created over a network, then it creates a sparse bundle. having created the sparse bundle, you can then connect the disk directly for speeding up the initial backup or a major restore, but also connect remotely for routine incremental backups or minor restores.
    It sounds like the type of sparse bundle created may depend on circumstances. In my case I am backing up from a laptop onto a partition on my desktop machine running Leopard 10.5.2 and when I grew the partition, although the Time Machine preference pane saw the extra space, when it came to a backup I got an error message saying there was not enough space and reporting the original size. Deleting and starting over again fixed this.
    It is possible that in other circumstances a disk attached to a Time Capsule or elsewhere might get a sparse bundle with different parameters.
    Incidentally, I tried copying my old backup sparse bundle onto another drive, deleting it and letting Time Machine create a new sparse bundle on my grown partition and copying the contents from the old one into the new one. Time Machine refused to work with it, so I lost my old backups.
    What we need is a Time Machine Utility to manipulate these files, copy them, move backups from direct folders to sparse bundles etc. Ideally Apple would produce this, but I would be willing to pay a shareware fee for that.

  • Closing clob/blob streams

    What do folks do regarding closing the streams gotten from a clob or blob. My thinking is don't mess with something you didn't create, and so i don't close them. What do you do?

    Am i the owner of the blob? or is the result set, via updateBinaryStream the owner?
    Probably this is some ByteArrayInputStream created by the driver that I write into. Perhaps in addition the driver puts some sort of header/trailer information before and after my data so that when it gets sent to the database, it will be easier to parse. If i close the thing bad things may happen.
    Then again, maybe not.

Maybe you are looking for

  • Problem in extended Transport control while setting up transport request.

    I created a BDC program which will create a database table upon executing.. The problem is the program worked well since yesterday, But today when i executed it , it is showing a information message when creating a new transport request . Extended tr

  • Html on Jlabel font size varies

    Hi, I am trying to put html text on JLabel with different font sizes. The font size reflected on JLabel is different from the font size on swing components. eg. Font size xx large on JLabel with html is looking very different from font size xx large

  • Is there a fine tip stylus that works on the iPad/iPhone?

    I am wanting to use the note pad and my finger does not have that fine of point and most of the stylus I have seen have the 5mm rubber head and that is not optimal for note taking / drawing items.  I am looking for something with a finer point.

  • Dynamic PDF/FDF question

    I need to way to display the contents of an ASP / HTML page in  PDF format. As of now I can display the static data, known number of fields for everyone like first name, last name, county..., but do not understand how to save the dynamic data. Since

  • Why does my monitors light dim on one side?

    my monitor is darker on the left side......sometimes flickers a bit....... any suggestions on what to do?