Storing binary files in Oracle BLOB fields

[email protected] (Carl Meyer)
Newsgroups php.general
Message-ID <[email protected]>
I want to store JPEG images in an Oracle BLOB field (or a LONG RAW field,
whichever will work better) via PHP, but I'm having trouble getting my
INSERT statement to work.  So far I've been trying mostly with LONG RAW
because it seems simpler.  What's happening is that ora_parse() won't parse
my SQL statement containing the binary data to be inserted - it keeps giving
Oracle errors like 'missing right parenthesis' or 'SQL statement not
terminated correctly' - things I would normally trace to a special character
not escaped within a string in the SQL statement.  But I've tried just about
every possible combination of addslashes($binary_string) and
ereg_replace("'", "''", $binary_string) that I can think of, and it keeps
giving me the same errors.  I haven't yet been able to store a file
successfully.  Has anybody done this who could show me how it's done?  I'm
using PHP 3.0.12.

TIA,

Carl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.