Extract BLOB-Data with DatabaseExampleSource

VD
VD New Altair Community Member
edited November 2024 in Community Q&A
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
Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • land
    land New Altair Community Member
    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
  • VD
    VD New Altair Community Member
    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


  • keith
    keith New Altair Community Member
    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.
  • land
    land New Altair Community Member
    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

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.