Loads or copies a portion or all of a local file to the internal LOB value of this object.
OraBlob.CopyFromFile "blob.bmp" amount, offset, chunksize OraClob.CopyFromFile "clob.txt" amount, offset, chunksize
The arguments for the method are:
||A string specifying the absolute name and path for the file to be read.|
Obtain either a row-level lock or object-level lock before calling this method.
The file should be in the same format as the
Note:When manipulating LOBs using LOB methods, such as
CopyFromFile, the LOB object is not automatically trimmed if the length of the new data is smaller than the old data. Use the
Trim(OraLOB) method to shrink the LOB object to the size of the new data.
This example demonstrates the use of the
Be sure that you have the
PART table in the database with valid LOB data in it. Also, be sure that you have installed the OraLOB Schema Objects as described in "Schema Objects Used in LOB Data Type Examples" .
Dim OraSession As OraSession Dim OraDatabase As OraDatabase Dim PartImage as OraBLOB '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&) 'Create a Dynaset containing a BLOB and a CLOB column set part = OraDatabase.CreateDynaset ("select * from part where" & _ "part_id = 1234",0) set PartImage = part.Fields("part_image").Value 'copy the entire content of partimage.jpg file to LOBS part.Edit PartImage.CopyFromFile "partimage.jpg" part.Update
See Also:Trim (OraLOB) Method