473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP - Reading blob from Oracle to ASP

2
Hi,

I am having serious trouble retreiving a blob from a oracle table.
The pictures are stored in the database and I need to retreive the pictures and display it on a page.

Can anyone help me please.

Thanks
Ajit.P
Feb 3 '06 #1
5 10728
Niheel
2,460 Expert Mod 2GB
* moved thread to database help
Feb 3 '06 #2
Niheel
2,460 Expert Mod 2GB
Are you having a hard time with the writing the query? or are you getting error messages with a query you already wrote.

If you have written code; please paste in here using the CODE tags.
Feb 3 '06 #3
ajitp
2
Are you having a hard time with the writing the query? or are you getting error messages with a query you already wrote.

If you have written code; please paste in here using the CODE tags.
The following is the procedure i have written to retrieve the blob
The procedure prints out the blob if i execute in oracle.

The table structure is an id (number) and theblob (blob)

I need to know how to pass the output of the procedure to an asp page.


Expand|Select|Wrap|Line Numbers
  1.  CREATE OR REPLACE PROCEDURE Read_Text_From_BLOB ( 
  2. p_id IN NUMBER)
  3. IS
  4.  
  5.  
  6. l_amt number default 30;
  7. l_off number default 1;
  8. l_raw raw(4096);     
  9. lob_loc BLOB;
  10.  
  11. BEGIN
  12.  
  13.  
  14.  
  15.  
  16. SELECT theblob INTO lob_loc
  17. FROM a1
  18. WHERE id = p_id;
  19.  
  20.  
  21. owa_util.mime_header( 'image/gif' );
  22.  
  23.  
  24.     begin
  25. loop
  26. dbms_lob.read( lob_loc, l_amt, l_off, l_raw );
  27.  
  28. htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
  29. l_off := l_off+l_amt;
  30. l_amt := 4096;
  31. end loop;
  32.  
  33. exception
  34. when no_data_found then 
  35. NULL;
  36. end;
  37.  
  38. DBMS_OUTPUT.PUT_LINE( 
  39. UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(lob_loc, 200, 1))
  40. );
  41.  
  42.  
  43. END;
  44. /
  45.  
Feb 6 '06 #4
i have the same problem with regular asp 3.0 vbscript code.
How asp page can get the Blob type data from oracle

Thanks for any help

The following is the procedure i have written to retrieve the blob
The procedure prints out the blob if i execute in oracle.

The table structure is an id (number) and theblob (blob)

I need to know how to pass the output of the procedure to an asp page.


Expand|Select|Wrap|Line Numbers
  1.  CREATE OR REPLACE PROCEDURE Read_Text_From_BLOB ( 
  2. p_id IN NUMBER)
  3. IS
  4.  
  5.  
  6. l_amt number default 30;
  7. l_off number default 1;
  8. l_raw raw(4096);     
  9. lob_loc BLOB;
  10.  
  11. BEGIN
  12.  
  13.  
  14.  
  15.  
  16. SELECT theblob INTO lob_loc
  17. FROM a1
  18. WHERE id = p_id;
  19.  
  20.  
  21. owa_util.mime_header( 'image/gif' );
  22.  
  23.  
  24.     begin
  25. loop
  26. dbms_lob.read( lob_loc, l_amt, l_off, l_raw );
  27.  
  28. htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
  29. l_off := l_off+l_amt;
  30. l_amt := 4096;
  31. end loop;
  32.  
  33. exception
  34. when no_data_found then 
  35. NULL;
  36. end;
  37.  
  38. DBMS_OUTPUT.PUT_LINE( 
  39. UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(lob_loc, 200, 1))
  40. );
  41.  
  42.  
  43. END;
  44. /
  45.  
Nov 14 '06 #5
Has anyone answered your request or have you found the solution?
Jul 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ramesh | last post by:
How to read a BLOB from oracle 8i using OleDb
2
by: Niraj | last post by:
Hi, I am trying to do bulk insert of binary data (array of bytes) in an Oracle table. The data type of the table is BLOB. I am using Oracle Objects for OLE (OO4O) in C++. The binary data that I...
11
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
1
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it...
0
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it...
2
by: Chenna Sudarsan | last post by:
Hello, I am connecting to Oracle9.2 database from VB6.0 using MSDAORA provider. I am using ADO2.5. When I try to access a blob column of oracle I am getting the below mentioned error. ...
11
by: Peter Afonin | last post by:
Hello, I have Word documents stored in the Oracle database in the BLOB field that I need to retrieve. I've found the way of doing it: While dr.Read sName = dr("TE_PM_ATTACH_NAME") bLob =...
0
by: Biztalk Migration | last post by:
I am new to using BLOB with oracle stored proc. I dont knw how to set the size of the buffer which seems to overflow no matter what i used to pass it. I am getting an error ...
9
by: matt | last post by:
hello, im doing my first ASP.NET app that inserts & retrieves files from Oracle (no need for a discussion on *that*!). i learned first-hand of the somewhat awkward technique for inserting...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.