Writing a long raw to Oracle does not work in 5.2 (same code works in 4.0).
This is the code:
Code: Select all
..
Long String: lsFileBlob
..
If NOT SalFileOpen( hFile, sFileName, OF_Binary | OF_Read )
Return ....error
Set nFileLength = VisFileGetSize( sFileName )
Set nLengthRead = SalFileRead( hFile, lsFileBlob, nFileLength )
If nLengthRead != nFileLength
Return ...error
Call SalFileClose( hFile )
Set sSqlCommand = "
INSERT INTO F_EMAIL_MESSAGE_ATTACHMENT
( MESSAGE_NO, MESSAGE_ATTACHMENT, ... )
VALUES
( :nMessageNo, :lsFileBlob, ... )"
If NOT SqlPrepare( hSqlMain, sSqlCommand )
Return FALSE
Call SqlSetLongBindDatatype( 2, 23 )
If NOT SqlExecute( hSqlMain )
....
The file length is about 120K, and it reads the correct length. However, the file written to the database is only 64k. (exactly 65,536 bytes). If I try larger files it always writes the same 64K.
I have
longbuffer=10000000
in my sql.ini.
Thanks for any assistance.