Re: VW --> Bianary file into CLOB or BLOB
- From: Alan Knight <knight@xxxxxxx>
- Date: Sun, 23 Jul 2006 13:00:47 -0500
MSCP1252String stands for a string which is encoded using Microsoft's Code
Page 1252 encoding, which is normal Windows encoding for Western European
alphabets. You probably want a statement more like
stream := 'mynew.pdf' asFilename readStream.
stream binary.
stream contents.
stream close.
rather than reading in the contents as if it were characters, and then
converting to binary using an arbitrary character encoding (which will be
different between operating systems).
maarten <maarten.mostert@xxxxxxxxxx> wrote in
news:44c19ff9$0$892$ba4acef3@xxxxxxxxxxxxxx:
In fact the remaining poblem I have is not in transferring the BLOB to
the database as I manage this on both PostgreSQL, Oracle and ODBC
following the documentation.
Having said that, only PostgreSQL does big-blobs out of the Glorp box.
Oracle prefers updating a small blob to a big one using a proxy but
ODBC only accepts bindings and doesn't support updates obliging you to
create a new index for the blob you only want to update.
My outstanding problem was to create a valid ByteArray from no matter
what file as I previously used the ByteArray coming from ImageReader.
The following statement however seems to give me a ByteArray through
an MSCP1252String (I don't know where that stands for though and
inspect gives me lots of black squared characters, but I try of from
here).
'mynew.pdf' asFilename contentsOfEntireFile asByteArrayEncoding:
#default
PS I did somewhere expect somebody to say do this with XML,..........
Alan Knight a écrit :
It shouldn't be very difficult. You probably want to use binding (at
least if you're on Oracle, the VW Postgresql driver doesn't really do
binding in a meaningful way, so you're actually better off without
it). You can just bind a ByteArray to the statement. There is some
discussion in the Database Application Developer's Guide, page 141
for Oracle and 152 for ODBC.
"Joachim Geidel" <joachim.geidel@xxxxxxxxxxxx> wrote in
news:1153494544.912400.267300@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
Hi Maarten,
I am using VW and I would like to read some binary file and load ityou could have a look at how Store stores LOBs, starting at
in and of from a database through CLOB or BLOB.
myByteArray:='myFirstSong.mp3' asFilename
doSomeUnknownActionOnFullContents.
Store.Blob>>installMultipleChunks. You would have to load the Store
support for your target database to see the necessary code. The
PostgreSQLEXDI, the OracleEXDI and probably other support BLOBs, but
how to do it is not documented in the Database Application
Developers Guide, and the comments in the code are, hmm, sparse.
HTH,
Joachim Geidel
--
Alan Knight [|], Cincom Smalltalk Development
knight@xxxxxxx
aknight@xxxxxxxxxx
http://www.cincom.com/smalltalk
"The Static Typing Philosophy: Make it fast. Make it right. Make it run." -
Niall Ross
.
- Follow-Ups:
- Re: VW --> Bianary file into CLOB or BLOB
- From: maarten
- Re: VW --> Bianary file into CLOB or BLOB
- References:
- VW --> Bianary file into CLOB or BLOB
- From: maarten
- Re: VW --> Bianary file into CLOB or BLOB
- From: Joachim Geidel
- Re: VW --> Bianary file into CLOB or BLOB
- From: Alan Knight
- Re: VW --> Bianary file into CLOB or BLOB
- From: maarten
- VW --> Bianary file into CLOB or BLOB
- Prev by Date: Re: New Smalltalk Blog
- Next by Date: Re: Viewing a bitmap Oracle Blob without writing it to file
- Previous by thread: Re: VW --> Bianary file into CLOB or BLOB
- Next by thread: Re: VW --> Bianary file into CLOB or BLOB
- Index(es):
Relevant Pages
|