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

Single Piece Write Operation

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

Dim buffer() as byte

ReDim buffer(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

PartImage.Offset = 1000

FNum = FreeFile

Open "PartImage.Dat" For Binary As #FNum

Get #FNum, , buffer

Part.Edit

amount_written = PartImage.Write(buffer)

Part.Update

Close FNum

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

Part.Edit

PartImage.CopyFromFile "PartImage.dat" , 10000, 1000

Part.Update


 
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