Extracting Blob data

Good morning,
I have a table with the following:
Name Null? Type
DRILLING_REPORT_S VARCHAR2(19)
ROW_CREATE_DATE DATE
ROW_CREATOR VARCHAR2(40)
REPORT_DATE DATE
WELL_S VARCHAR2(19)
TYPICAL_ACT_NAME VARCHAR2(40)
DESCRIPTION VARCHAR2(2000)
DOCUMENT_SPEC_ID VARCHAR2(40)
CMPS_DOC_SPEC_S VARCHAR2(19)
INFORMATION_CNTN_S VARCHAR2(19)
TYP_DOC_SPEC_ID VARCHAR2(40)
WELL_ID VARCHAR2(40)
RIG_ID VARCHAR2(40)
BSASC_SOURCE VARCHAR2(40)
CONTENT                                            LONG RAW
CONTENT_LENGTH NUMBER(10)
BASE_DEPTH NUMBER(10)
TOP_DEPTH NUMBER(10)
FILE_FORMAT VARCHAR2(20)
LAST_UPDATE_DATE DATE
LAST_UPDATED_BY VARCHAR2(40)
CONTAINING_ACT_S VARCHAR2(19)
CONTAINING_ACT_T VARCHAR2(16)
DOCUMENT_STATUS VARCHAR2(40)
START_TIME DATE
END_TIME DATE
The content column which is of a long raw format, has Blob data in it (Excel files, Word Docs and PDF).
How do I extract the Blob data so that I can get the actual files (i.e the Excel, Word and PDF documents)
Would appreciate any assistance with this.
Thanks in advance
Michelle

here what I came up with
CREATE OR REPLACE PROCEDURE test_extractfile
IS
i1 BLOB;
len NUMBER;
my_vr RAW (10000);
i2 NUMBER;
i3 NUMBER := 10000;
outputstring UTL_FILE.file_type;
BEGIN
-- get the blob locator
SELECT content
INTO i1
FROM trinmar.drilling_report
WHERE drilling_report_s = 7462256;
-- find the length of the blob column
len := DBMS_LOB.getlength (i1);
DBMS_OUTPUT.put_line ('Column Length: ' || TO_CHAR (len));
-- Read 10000 bytes at a time
i2 := 1;
IF len < 10000
THEN
-- If the col length is < 10000
DBMS_LOB.READ (i1, len, i2, my_vr);
outputstring ('c:\temp\trinmar_extract.xls',
RAWTOHEX (my_vr),
'wb',
2 * len
-- You have to convert the data to rawtohex format.
-- Directly sending the buffer
-- data will not work
-- That is the reason why we are sending the length as
-- the double the size of the data read
DBMS_OUTPUT.put_line ('Read ' || TO_CHAR (len) || 'Bytes');
ELSE
-- If the col length is > 10000
DBMS_LOB.READ (i1, i3, i2, my_vr);
outputstring ('c:\temp\trinmar_extract.xls',
RAWTOHEX (my_vr),
'wb',
2 * i3
DBMS_OUTPUT.put_line ('Read ' || TO_CHAR (i3) || ' Bytes ');
END IF;
i2 := i2 + 10000;
WHILE (i2 < len)
LOOP
-- loop till entire data is fetched
DBMS_LOB.READ (i1, i3, i2, my_vr);
DBMS_OUTPUT.put_line ('Read ' || TO_CHAR (i3 + i2 - 1) || ' Bytes ');
outputstring ('c:\temp\trinmar_extract.xls',
RAWTOHEX (my_vr),
'ab',
2 * i3
i2 := i2 + 10000;
END LOOP;
END;
I'm getting 2 errors:
a) PLS-00385: type mismatch found at 'I1' in SELECT...INTO statement
b) PLS-00221: 'OUTPUTSTRING' is not a procedure or is undefined
Can anyone help?

Similar Messages

  • Extracting text from BLOB data

    Let me start by saying that I'm flying by the seat of my pants on this and I'm neither a CR expert nor can I write SQL. Short of a little basic back on my old Apple IIe (way back when,) my programming skills are essentially nil.
    That said, here's what I'm trying to acheive.
    I have created a report that uses an ODBC connection to an Oracle database. It works fine, all the tables are properly linked and it delivers a properly functioning report. I now need to extract some text from a BLOB field. I have all the necessary tables added to the report and I've linked them as well. However, when I add an SQL expression and paste in the  SQL string that uses the function, "getprop" to try to extract the necessary text from the BLOB data, I get the error: "missing expression"
    I notice that within the SQL Expression editor, the field for the BLOB data is not listed in the table in which it resides, though the non-BLOB fields are listed. That is, when I say: select getprop(sl.blobdata,'confirmCompany'), there is no sl.blobdata field which I believe is the source of the "missing expression" error.
    If I create a new blank report and simply paste the SQL in as a command in the Database Expert, it will deliver the expected results. I get the two fields I need. This means the SQL string is fine. But, of course, all the other columns I need are not available. As I mentioned above, I can't write SQL and I have a fully functional  report that has everything except the two columns i want to add from the BLOB field.
    However if I go back to my complete report and add the SQL as a command in the Database Expert, it then asks me to link the fields to the other tables already in the report and that just doesn't work.
    I apologize for any mucked up terminology and general concept confusing statements I've made above and hope someone will be able to help me out.
    Thanks in advance.
    ~m

    So, in this case you might create a subreport that has
    "the SQL in as a command in the Database Expert, it will deliver the expected results. I get the two fields I need. This means the SQL string is fine. But, of course, all the other columns I need are not available. As I mentioned above, I can't write SQL and I have a fully functional report that has everything except the two columns i want to add from the BLOB field. "
    of course, this will return all the results, every time it gets kicked off, this is why having something to link to is handy.
    You can filter the subreport data, based on main report parameters, if that will help.

  • How to extract blob from a table and save it as  a file?

    Dear All
    i have table employee (emp_id number , emp_name varchar2(60) emp_image blob)
    1 - i want to extract the emp_image of every employee into a operating system folder c:\images
    2 - the file name should be emp_id.gif or emp_id.jpg
    How can i do that?
    Thanks a lot in advance for your co-operation
    Regards
    Mohamed Hammed

    I want to put an XML in a table's column using BLOBs.
    I tried the following ways:
    Created a table:
    CREATE TABLE lob_table (id NUMBER, doc BLOB);
    Created a directory:
    create or replace directory XML_DIR as '\app\granite\rnd';
    Created a PL/SQL procedure:
    CREATE OR REPLACE
    PROCEDURE BLOB_PROCEDURE AS
    src_lob BFILE := BFILENAME('XML_DIR', '1.xml');
    dest_lob BLOB;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('1');
    INSERT INTO lob_table VALUES(1, EMPTY_BLOB())
    RETURNING doc INTO dest_lob;
    DBMS_OUTPUT.PUT_LINE('2');
    DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
    DBMS_OUTPUT.PUT_LINE('3');
    DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob,
    SRC_LOB => src_lob,
    AMOUNT => DBMS_LOB.GETLENGTH(src_lob) );
    DBMS_OUTPUT.PUT_LINE('Done');
    DBMS_LOB.CLOSE(src_lob);
    Exception
    when others then
    DBMS_OUTPUT.PUT_LINE('Exception');
    COMMIT;
    END BLOB_PROCEDURE;
    I am using Oracle SQL Developer.
    When I try to run the above procedure, it says:
    "Source does not have a runnable target."
    When I use Toad, the procedure executes properly, but there is no blob data in the table.
    Kindly help me in this regard.

  • How to use clob or blob data type in OWB

    how to use clob or blob data type in OWB?
    if OWB not surport these data type,how can i extract the large data type from data source

    The same question was asked just two days ago No Data Found: ORA-22992
    Nikolai Rochnik

  • Datas return from Blob data type in Sqlite

    i am using sqlitejdbc-v053.jar through get SQLITE BLOB data type data. But i cannot data return from Blob type.
    Error will be display from :
    not implemented by SQLite JDBC driver
    and point out error line
    blob = rs.getBlob("NGP_REPDATA");
    {try {
                   Class.forName("org.sqlite.JDBC");
                    conn = DriverManager.getConnection("jdbc:sqlite:test.DB");
                    stmt = conn.createStatement();
                    rs = stmt.executeQuery("SELECT * FROM sometable");
                    System.out.println("==============");
                    while(rs.next()) {
                         blob = rs.getBlob("blobDATA");//
                         is = blob.getBinaryStream();
              catch(SQLException e) {
                   e.printStackTrace();
              }}any sample or solution pls give
    sqlite with BLOB sample there pls give link                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    There explicitly tells you that the JDBC driver that you are using will not do the method that you are calling.
    Thus you cannot use that method.
    There is another way to extract blobs which involves using a stream. You can search for that.
    If your blobs are actually short and only have character data then you might be able to use getString() as well.

  • How to extract  Blob using java

    hai
    have a peace day.
    i want to extract the data from BLOB thro java
    i using getblob, but i don,t know properly
    please tell any ideas r give some sample codes
    thank u
    raja

    i want to extract the data from BLOB thro javaYou can use getBytes or getBinaryStream to extract the expected data stream to do more.

  • Can we extract blob objects from sql database to a human readable format?

    Hi All,
    I have question How can we extract
    blob objects from Sql database to human readable format ?
    Blob includes Images, text and docs.
    Thanks 
    Moug
    Best Regards Moug

    One thing you can do if its sql 2012 or later is to load the blob data to FileTable created in database. Then you would be able to physically browse to directory it points and see all files in its native format.
    see this for more details
    http://visakhm.blogspot.in/2012/07/working-with-filetables-in-sql-2012.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can I copy BLOB data between records

    I have a record that contains a BLOB field.
    I want to create a new record from this record, obviously changing other fields so there is not
    a duplicate key, etc. I do NOT want to have to
    extract the BLOB data into a file then re-insert
    it into the new record for obvious performance
    reasons.
    How can I copy the BLOB data from the original record to the record I am creating?

    Hi Bradley,
    Try to create a statement like: insert into myTable values("id","name",(select blob_value from mytable where id="theIdWithTheblob"));
    Hope this helps.
    - Kalle

  • Error while extracting the data in R/3 production system,

    Hi Team,
    We got the following error while extracting the data in R/3 production system,
    Error 7 When Sending an IDoc R3 3
    No Storage space available for extending the inter 44 R3 299
    No storage space available for extending the inter R3 299
    Error in Source System RSM 340
    Please guide us to fix the issue

    It´s very difficult to help you without knowing
    - what is going to be transferred
    - where you get this error
    - system configuration
    - actual memory usage
    - operating system
    - database and configuration etc. etc.etc. etc.
    I suggest you open an OSS call and let the support have a look on your system. It´s much easier if one has system access to find out the cause for that problem.
    Markus

  • Unable to extract the data from ECC 6.0 to PSA

    Hello,
    I'm trying to extract the data from ECC 6.0 data source name as 2LIS_11_VAHDR into BI 7.0
    When i try to load Full Load into PSA , I'm getting following error message
    Error Message: "DataSource 2LIS_11_VAHDR must be activated"
    Actually the data source already active , I look at the datasource using T-code LBWE it is active.
    In BI  on datasource(2LIS_11_VAHDR) when i right click selected "Manage"  system is giving throughing below error message
    "Invalid DataStore object name /BIC/B0000043: Reason: No valid entry in table RSTS"
    If anybody faced this error message please advise what i'm doing wrong?
    Advance thanks

    ECC 6.0 side
    Delete the setup tables
    Fill the data into setup tables
    Schedule the job
    I can see the data using RSA3 (2LIS_11_VAHDR) 1000 records
    BI7.0(Service Pack 15)
    Replicate the datasource in Production in Backgroud
    Migrate Datasource 3.5 to 7.0 in Development
    I did't migrate 3.5 to 7.0 in Production it's not allowing
    When i try to schedule the InfoPakage it's giving error message "Data Source is not active"
    I'm sure this problem relate to Data Source 3.5 to 7.0 convertion problem in production. In Development there is no problem because manually i convert the datasource 3.5 to 7.0
    Thanks

  • How to extract Slide data in 3rd part application from clipboard

    I need to be able to copy/paste or drag/drop from PowerPoint into another application (C# WPF). In my OnDrop method the DragEventArgs Data has these formats:
            [0]    "Preferred DropEffect"    string
            [1]    "InShellDragLoop"    string
            [2]    "PowerPoint 12.0 Internal Slides"    string
            [3]    "ActiveClipBoard"    string
            [4]    "PowerPoint 14.0 Slides Package"    string
            [5]    "Embedded Object"    string
            [6]    "Link Source"    string
            [7]    "Object Descriptor"    string
            [8]    "Link Source Descriptor"    string
            [9]    "PNG"    string
            [10]    "JFIF"    string
            [11]    "GIF"    string
            [12]    "Bitmap"    string
            [13]    "System.Drawing.Bitmap"    string
            [14]    "System.Windows.Media.Imaging.BitmapSource"    string
            [15]    "EnhancedMetafile"    string
            [16]    "System.Drawing.Imaging.Metafile"    string
            [17]    "MetaFilePict"    string
            [18]    "PowerPoint 12.0 Internal Theme"    string
            [19]    "PowerPoint 12.0 Internal Color Scheme"    string
    The "PowerPoint 14.0 Slides Package" is a byte array... can this be converted into Slides?
    If not how would I go about getting high-resolution images + slide text from a drag/drop?
    [Originally posted here: http://answers.microsoft.com/en-us/office/forum/office_2013_release-powerpoint/how-to-extract-slide-data-in-3rd-part-application/a0b5ed64-eb77-49bb-bf44-e0732e23a5eb]

    What I'd like to do:
    Open PowerPoint
    In PPT open a presentation
    In PPT select a slide
    Drag it to my 3rd party WPF application
    In the 3rd party WPF application drop handler get the slide data (text, background image, etc...).
    When I do this I get the DragEventArgs Data (the clipboard data) and it has the 20 supported formats I listed in the 1st post. From these formats #4 seemed like it could have some useful info.
    WPF
    <Window x:Class="PowerPointDropSlide.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525" AllowDrop="True" Drop="UIElement_OnDrop" DragOver="UIElement_OnDragOver">
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="LightBlue">
    <TextBlock Text="Drop something here!"/>
    </Grid>
    </Window>
    Handlers:
    public void UIElement_OnDragOver(object sender, DragEventArgs e)
    public void UIElement_OnDrop(object sender, DragEventArgs e)
    string[] supportedFormats = e.Data.GetFormats();
    object pptSlidesPackage = e.Data.GetData("PowerPoint 14.0 Slides Package");

  • Not able to extract performance data from .ETL file using xperf commands. getting error "Events were lost in this trace. Data may be unreliable ..."

    Not able to extract  performance data from .ETL file using xperf commands.
    Xperf Commands:
    xperf –i C:\TempFolder\Test.etl -o C:\TempFolder\BootData.csv  –a process
    Getting following error after executing above command:
    "33288636 Events were lost
    in this trace. 
    Data may be unreliable
    This is usually caused
    by insufficient disk bandwidth for ETW lo
    gging.
    Please try increasing the minimum
    and maximum number of buffers
    and/or
                    the buffer size. 
    Doubling these values would be a good first at
    tempt.
    Please note, though, that
    this action increases the amount of me
    mory
                    reserved
    for ETW buffers, increasing memory pressure on your sce
    nario.
    See "xperf -help start"
    for the associated command line options."
    I changed page size file but its does not work for me.
    Any one have idea, how to solve this problem and extract ETL file data.

    I want to mention one point here. I have total 4 machines out of these 3 machines above
    commands working properly. Only one machine has this problem.<o:p></o:p>
    Hi,
    I consider that you can try to use xperf to collect the trace etl file and see if it can be extracted on this computer:
    Refer to following articles:
    start
    http://msdn.microsoft.com/en-us/library/windows/hardware/hh162977.aspx
    Using Xperf to take a Trace (updated)
    http://blogs.msdn.com/b/pigscanfly/archive/2008/02/16/using-xperf-to-take-a-trace.aspx
    Kate Li
    TechNet Community Support

  • How to extract authorization data to standart BW DSO's  from  SAP R/3 system

    Hi All,
    Does anyone have any experience about this topic? I want to use SAP R/3 as a source system and after i extracted the data to business content DSO's in BW  ,i will generate authorization objects from DSO 's.
    I am using standar BC DSO 's
    0TCA_DS01 Authorization data - Values
    &#149; 0TCA_DS02 Authorization data - Hierarchies
    &#149; 0TCA_DS03 Descriptive Text Authorizations
    &#149; 0TCA_DS04 Assignment User Authorizations
    &#149; 0TCA_DS05 Generate users for Authorizations
    I have deep research but cant find anything.
    Best Regards
    Ozan

    Hi Ozan,
    You can go though thread provided by Suman, These DSO's will help to maintain Analysis Authorizations in BW automatically In-short you don't need to maintain it, it will come from R/3 and same will be configured in BW.
    Regards,
    Ganesh

  • How to extract Inventory data from SAP R/3  system

    Hi friends How to extract Inventory data from SAP R/3  system? What are report we may expect from the Inventory?

    Hi,
    Inventory management
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how%20to%20handle%20inventory%20management%20scenarios.pdf
    How to Handle Inventory Management Scenarios in BW (NW2004)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328
    Loading of Cube
    •• ref.to page 18 in "Upgrade and Migration Aspects for BI in SAP NetWeaver 2004s" paper
    http://www.sapfinug.fi/downloads/2007/bi02/BI_upgrade_migration.pdf
    Non-Cumulative Values / Stock Handling
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/93ed1695-0501-0010-b7a9-d4cc4ef26d31
    Non-Cumulatives
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/da1640dc88e769e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/1a62ebe07211d2acb80000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/80/1a62f8e07211d2acb80000e829fbfe/frameset.htm
    Here you will find all the Inventory Management BI Contents:
    http://help.sap.com/saphelp_nw70/helpdata/en/fb/64073c52619459e10000000a114084/frameset.htm
    2LIS_03_BX- Initial Stock/Material stock
    2LIS_03_BF - Material movements
    2LIS_03_UM - Revaluations/Find the price of the stock
    The first DataSource (2LIS_03_BX) is used to extract an opening stock balance on a
    detailed level (material, plant, storage location and so on). At this moment, the opening
    stock is the operative stock in the source system. "At this moment" is the point in time at
    which the statistical setup ran for DataSource 2LIS_03_BX. (This is because no
    documents are to be posted during this run and so the stock does not change during this
    run, as we will see below). It is not possible to choose a key date freely.
    The second DataSource (2LIS_03_BF) is used to extract the material movements into
    the BW system. This DataSource provides the data as material documents (MCMSEG
    structure).
    The third of the above DataSources (2LIS_03_UM) contains data from valuated
    revaluations in Financial Accounting (document BSEG). This data is required to update
    valuated stock changes for the calculated stock balance in the BW. This information is
    not required in many situations as it is often only the quantities that are of importance.
    This DataSource only describes financial accounting processes, not logistical ones. In
    other words, only the stock value is changed here, no changes are made to the
    quantities. Everything that is subsequently mentioned here about the upload sequence
    and compression regarding DataSource 2LIS_03_BF also applies to this DataSource.
    This means a detailed description is not required for the revaluation DataSource.
    http://help.sap.com/saphelp_bw32/helpdata/en/05/c69480c357354a8846cc61f7b6e085/content.htm
    http://help.sap.com/saphelp_bw33/helpdata/en/ed/16c29a27db6e4d81a015be8673eb80/content.htm
    These are the standard data sources used for Inventory extraction.
    Hope this helps.
    Thanks,
    JituK

  • How to extract PS data from sap r/3 to bw

    Hi,
    How to extract PS data from sap r/3 to bw
    PS data like plans,budget,accurals&commitmnets
    can any one help me regarding this..
    Thanks in Advance,
    Shankar.

    HI sankar,
    you can refer the belkow link to find the details on the relevant extractors and infoproviders
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/17/416d030524064cb2b8d58ffb306f3a/frameset.htm
    Regards,
    Sathya

Maybe you are looking for

  • Doesn't recognize the power adapter. Have replaced battery and PRAM.

    Howdy, I'm having a devil of a time with my Powerbook. It won't recognize a power adapter. It won't charge my battery. Won't run when plugged into the power adapter. The only way it works is for me to charge my battery in my girlfriend's Powerbook an

  • Where to find and which subwoofer ?

    Hello, I bought a i-trigue-2200 set 4 months ago. I notice on the back of the main speaker a port to plug a subwoofer. 1) which model ? (I have heard about P50 ) 2) where can I found such a device ? (I live near to Paris, France). Thank you for your

  • Target cost in COR3

    Hi All, In COR3 --> Costing Analysis how is the target cost and target quantity. The variances are calculated and the order is TECO. We are having a huge variance between Target/Actual and unable to find. Rewards for the correct answer. -- Syed Abid

  • Multiple hierarchies

    Could any one tell me how we deal with Multiple hierarchies of data in XI without BPM OR with BPM? how we solve Multiple hierarchies of IDOC problems for that should we use AS2 or  module?

  • Challenges for enterprise management of drivers, etc. t4xx

    so i am subscribed to the lenovo driver updates for t410s model that we are rolling out company wide. already deployed 30+ issues i see regarding keeping them updated for the corporate environment; 1. no previous drivers version available on site? fo