Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read Long Raw Data from Oracle database and write into flat file.

Status
Not open for further replies.

skuthe

Programmer
Sep 10, 2002
33
0
0
US
Hi,
I want to read the long raw data from oracle and write it out to a flat file which will then be printed.
I would like to know how to read the long raw data from oracle 8.0.5 database and write it into the flat file.

Pl. advise ASAP as this it critical for my project.

Pl. note that I am using oracl 8.0.5 and it DOES NOT have the to_lob functionality !!.

Thanking you in advance,
Skuthe.
 
I'm not sure if this will help, I started with version 8 last year and ran into a similar problem. We're on ver 8i now but the large data type fields still pose difficulties at times. I can't help you with writing out to a flat file because I haven't done that from Oracle. Anyhow....

FUNCTION GET_LONGRAW(p_val IN LONG RAW) RETURN VARCHAR2 AS

v_result VARCHAR2(8000); --Don't think you need to go larger than this

BEGIN

v_result := utl_raw.cast_to_varchar2(p_val);
RETURN v_result;

END GET_LONGRAW;

utl_raw was a package installed either from CD or downloaded from the Oracle web site. I would set the size of v_result to what you think the max string size would be. At most 8000 would be rather large for your flat file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top