Oracle Objects for OLE
Release 8.1.7

Part Number A85257-01

Library

Product

Contents

Single Piece Read Operation

The entire contents of a buffer can be read in a single piece in one network round trip. The following example reads 10k of data from the part_image column at an offset of 1000 to the local file image.dat.

Dim buffer as Variant

Dim buf() As Byte

chunksize = 10000

Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

Set InvDb = OO4OSession.OpenDatabase("INVDB", "scott/tiger", 0)

Set Part = InvDb.CreateDynaset("select * from part", 0&)

Set PartImage = Part.Fields("part_image").Value

FNum = FreeFile

Open "image.dat" For Binary As #FNum

PartImage.Offset = 1000

amount_read = PartImage.Read(buffer,10000)

buf = buffer

Put #FNum, , buf

Close FNum

The CopyToFile (OraLob/BFILE) method writes data directly to a local file from a LOB. The following code is functionally the same as the previous code:

PartImage.CopyToFile "image.dat" , 10000, 1000


 
Oracle
Copyright copy; 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents