Options

Extract BLOB-Data with DatabaseExampleSource

VDVD Member Posts: 7 Contributor II
edited November 2018 in Help
Hello,

I want to extract data from an Oracle-Database. It's possible to connect to the database and read all tables. However, for one data-type (BLOB = binary large objects) the table contains only '?'. What I would like to have is to see the data of the field MODUL_DATA as hex-string which I then can convert later ...

<operator name="Root" class="Process" expanded="yes">
    <operator name="DatabaseExampleSource (2)" class="DatabaseExampleSource">
        <parameter key="database_system" value="Oracle"/>
        <parameter key="database_url" value="jdbc:oracle:thin:@nu0xxxxxxxxxxxxxxxx"/&gt;
        <parameter key="username" value="XXXX"/>
        <parameter key="password" value="XXXX"/>
        <parameter key="query" value="SELECT &quot;ID_MM&quot;, &quot;MODUL_DATA&quot; FROM &quot;MES_AUMM&quot;"/>
    </operator>
</operator>

What should I do?

Thanks for your help

Best Regards

VD

Answers

  • Options
    landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    you might modify your select statement, so that it already delivers a hex representation using the TO_HEXDUMP function. If this don't work, I have no clue what to do, beside from writing some special code.

    Greetings,
      Sebastian
  • Options
    VDVD Member Posts: 7 Contributor II
    Hello Sebastian,

    Thanks for your reply.

    Do you mean something like

    SELECT TO_HEXDUMP("MODUL_DATA") FROM "MES_AUMM"

    ??

    this gives me the following error message: Error in: DatabaseExampleSource (2) (DatabaseExampleSource) Database error occurred: ORA-00904: "TO_HEXDUMP": invalid identifier.

    I was using google to search for '+select +to_hexdump' but could not find any helpful information. How should I add this converter ini RM?

    Best Regards

    VD


  • Options
    keithkeith Member Posts: 157 Maven
    You need to find the equivalent Oracle function to TO_HEXDUMP, since Oracle doesn't have a function of that name.  Something in the DBMS_LOB package looks promising, maybe DBMS_LOB.SUBSTR if your LOBs are <= 32k in length.  In any event, this is something that is database-specific, not RM-specific.  Once you can write a SELECT statement that returns what you want RM to analyze, you should be able use that query in DatabaseExampleSource.
  • Options
    landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi,
    if this will not work and you urgently need this feature, we might think of extending RapidMiner with that functionality as a last resort. The downside would be, that you would have to pay for this extension...

    Greetings,
      Sebastian
Sign In or Register to comment.