Oracle Objects for OLE
Release 9.2

Part Number A95895-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

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

%>


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback