Re: VW --> Bianary file into CLOB or BLOB



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 it
in and of from a database through CLOB or BLOB.

myByteArray:='myFirstSong.mp3' asFilename
doSomeUnknownActionOnFullContents.
you could have a look at how Store stores LOBs, starting at
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
.



Relevant Pages

  • Re: VW --> Bianary file into CLOB or BLOB
    ... Page 1252 encoding, which is normal Windows encoding for Western European alphabets. ... the database as I manage this on both PostgreSQL, Oracle and ODBC following the documentation. ... My outstanding problem was to create a valid ByteArray from no matter what file as I previously used the ByteArray coming from ImageReader. ...
    (comp.lang.smalltalk)
  • Re: utf8 encoding problem
    ... version/patches/Oracle client system enviornment etc. ... There were a large number of improvements in UTF encoding since 1.12 so my ... The UTF bug like this could be caused by the Oracle cleint or the Oracle ... > name and update the same in the database. ...
    (perl.dbi.users)
  • Re: utf8 encoding problem
    ... Oracle version/patches/Oracle client system enviornment etc. ... There were a large number of improvements in UTF encoding since 1.12 so my only sugestion is for you to install DBD::Oracle 1.19 locally on a seperate machine and then test to see if the bug continues. ... The UTF bug like this could be caused by the Oracle cleint or the Oracle DB as well and not just DBD::Oracle. ... name and update the same in the database. ...
    (perl.dbi.users)
  • Re: Convertion of Unicode to ASCII NIGHTMARE
    ... deal with Oracle, and I'm not looking for another adventure into ... applications and the database system. ... is to make sure that you know which encoding is used so that if you ... either get plain strings (ie. not Unicode objects) out of the database, ...
    (comp.lang.python)
  • Re: What so special about PostgreSQL and other RDBMS?
    ... That's exactly the link the licence agreement for the database points to when it ... comes to what wecan expect for paying support. ... > "Oracle may provide additional releases or versions of its programs ... If the requirements are volatile I'd do a long term contract detailing what ...
    (comp.lang.php)