Extract BLOB-Data with DatabaseExampleSource
VD
New Altair Community Member
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"/>
<parameter key="username" value="XXXX"/>
<parameter key="password" value="XXXX"/>
<parameter key="query" value="SELECT "ID_MM", "MODUL_DATA" FROM "MES_AUMM""/>
</operator>
</operator>
What should I do?
Thanks for your help
Best Regards
VD
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"/>
<parameter key="username" value="XXXX"/>
<parameter key="password" value="XXXX"/>
<parameter key="query" value="SELECT "ID_MM", "MODUL_DATA" FROM "MES_AUMM""/>
</operator>
</operator>
What should I do?
Thanks for your help
Best Regards
VD
Tagged:
0
Answers
-
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,
Sebastian0 -
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
0 -
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.
0 -
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,
Sebastian0