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: Accessing a LOB value

Schema Description

Dim OraSession As OraSession

Dim OraDatabase As OraDatabase

Dim OraDynaset As OraDynaset

Dim PartImage as OraBlob

Dim buffer As Variant

'Create the OraSession Object.

Set OraSession = CreateObject("OracleInProcServer.XOraSession")

'Create the OraDatabase Object by opening a connection to Oracle.

Set OraDatabase = OraSession.OpenDatabase("ExampleDb",

"scott/tiger", 0&)

execute the select statement

set OraDynaset = OraDatabase.CreateDynaset ("select * from part",0&)

'retrieve photo field from the dynaset

set PartImage = OraDynaset.Fields("part_image").Value

'read the entire LOB column in one piece into the buffer

amount_read = PartImage.Read(buffer, 10)

'use the buffer for internal processing