Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Import blob through SAS from ORACLE DB

3030448Sep 12 2015 — edited Sep 14 2015

Good time of a day to everyone. I face with a huge problem during my work on previous week. Here ia the deal:

I need to download xml file (blob) from ORACLE database through SAS. I am using:

  1. First step i need to get data from oracle. I used the construction (blob file is nearly 100kb):
    proc sql; connect to oracle; create table SASTBL as select * from connection to oracle ( select dbms_lob.substr(myblobfield,1,32767) as blob_1, dbms_lob.substr(myblobfield,32768,32767) as blob_2, dbms_lob.substr(myblobfield,65535,32767) as blob_3, dbms_lob.substr(myblobfield,97302,32767) as blob_4  from my_tbl; ); quit;

And the result is:

  blob_1 = 70020202020202...02 blob_2 = 02020202020...02 blob_3 = 02020202...02

I do not understand why the field consists from "02"(the whole file)

And the length of any variable in sas is 1024 (instead of 37767) $HEX2024 format. If I ll take:

dbms_lob.substr(my_blob_field,2000,900) from the same object the result will mush more similar to the truth: blob = "A234ABC4536AE7...."

The question is: 1. how can i get binary data from blob field correctly trough SAS? What is my mistake?

Thank you.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2015
Added on Sep 12 2015
4 comments
724 views