in reply to DBD::Oracle - RAW datatypes
I always used ORA_BLOB for images, and I've never used the ORA_RAW datatype, but I'll take a stab since nobody else has yet.
ORA_RAW, I think, is limited to 255 bytes column size, and ORA_LONGRAW is much bigger (2 gigs?). You can't fit a 20K gif in 255 bytes. Try using ORA_LONGRAW instead.
There could be other problems, but that seems like the most obvious potential issue. It might explain why your images seem truncated/corrupted when you select them out.
Re: Re: DBD::Oracle - RAW datatypes
by Anonymous Monk on Oct 19, 2001 at 05:24 UTC
|
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body>
Thanks for your response. The Oracle documentation states that RAW datatypes
can be up to 2KB
in size. The .GIF's I'm trying to insert are:
IPP_0002.GIF 1518b
IPP_0003.GIF 899b
IPP_0004.GIF 895b
IPP_0005.GIF 255b
IPP_0012.GIF 1265b
IPP_0015.GIF 902b
When I select them out of the database and write them to my cwd, I get:
IPP_0002.GIF 3036b
IPP_0003.GIF 1798b
IPP_0004.GIF 1790b
IPP_0005.GIF 510b
IPP_0012.GIF 2530b
IPP_0015.GIF 1804b
The gif's aren't being truncated, they're expanding!... ?
I can successfully insert/select BLOB's, CLOB's, LONG's. But I also need
to be able to do
RAW's. I work in a test environment and my current task is to provide test
cases for all of the
datatypes for the product my company is working on...
</body>
</html>
| [reply] |
|
Oh, that's weird. You're getting exactly double the number of bytes. What does your table definition look like? Do you have more than one binary object in the table? Have you tried using bind_param_inout and specifying ora_field along with ora_type?
| [reply] |
|
</head>
<body>
The table has 3 columns:
VARCHAR2(20)
NUMBER(10)
RAW(2000)
I inserted 6 rows, so there are 6 RAW's in the table when I do my select
- 1 RAW per row...
I haven't tried using bind_param_inout or ora_field. BTW - what exactly
does ora_field refer to? The column name?...
</body>
</html>
| [reply] |
|
|
|