Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Example: Using GetChunkByteEx with ASP

'This example is for use with ASP (Active Server Pages)

<%@ LANGUAGE = VBScript %>

<%Response.ContentType = "image/JPEG"%>

<%

Dim OraDatabase, Oradynaset

Dim Chunksize, BytesRead, CurChunkEx

'This assumes a pool of database connections have been created in the global.asa

Set OraDatabase = OraSession.getDatabaseFromPool(10)

'This assumes a table called "art_gallery" and

'displays JPEG images stored in the table

Set OraDynaset = OraDatabase.CreateDynaset("select art from art_gallery where artist = 'Picasso'", 0)

BytesRead = 0

'Reading in 32K chunks

ChunkSize= 32768

Do

BytesRead = OraDynaset.Fields("picture").GetChunkByteEx(CurChunkEx,

i * ChunkSize, ChunkSize)

if BytesRead > 0 then

Response.BinaryWrite CurChunkEx

end if

Loop Until BytesRead < ChunkSize

'Cleanup, remove all local references

Set OraDynaset = Nothing

Set Oradatabase = Nothing

%>