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: Modifying LOB value

Schema Description

Dim OraSession As OraSession

Dim OraDatabase As OraDatabase

Dim OraDynaset As OraDynaset

Dim PartDesc as OraClob

Dim buffer As String

'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&)

set PartDesc = OraDynaset.Fields("part_desc").Value

' To get a free file number

FNum = FreeFile

'Open the file for reading

Open "partdesc.dat" For Binary As #FNum

'Allocate buffer to the size of file FNum and read the entire file

buffer = String$(LOF(FNum), 32)

Get #FNum, , buffer

'lock the row for write operation

OraDynaset.Edit

amount_written = PartDesc.Write(buffer)

'commit the operation and release the lock

OraDynaset.Update

Close FNum