uploading binary file - ODBC (SapDB)

M.-A. Lemburg mal at lemburg.com
Fri Feb 21 08:21:25 EST 2003


Daniel Dittmar wrote:
>>into a long byte column. In this way I could upload the first 6 bytes:>
> 
> 'ELF'. But that's all. Any ideas?
> 
> How do you check the value? If you try to look at it in SQL Studio, then it
> might be that the data gets truncated on the first '\0'. If you read the
> LONG from a Python script (the example script does that), does the
> truncation happens there too? Please use sapdb.sql for reading, as I don't
> know what mxODBC is doing in that case, maybe you'll have to call
> .setoutputsizes () on the cursor.

FWIW, mxODBC passes whatever the driver provides to the Python
script. Embedded \0 chars are not a problem at all and you don't
need .setoutputsizes() for this to work. mxODBC will take care
of resizing buffers appropriately all by itself.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Feb 21 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
Python UK 2003, Oxford:                                     39 days left
EuroPython 2003, Charleroi, Belgium:                       123 days left






More information about the Python-list mailing list