Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> CLOBS

CLOBS

From: Iain William Wiseman <bibble_at_paradise.net.nz>
Date: Sun, 20 Aug 2006 23:41:22 +1200
Message-ID: <44e84a62@clear.net.nz>


Hi,

Written a test program to read a wav file into a database and back out so I could understand the mechanics of hope to do this. Basically used the examples provided.

I have come across a problem!

Platform
Linux on a x86 with Oracle 10.2
&
Solaris 9 on a v120 with Oracle 9i

If I read a file wav into a database and out to a file on Sun + oracle 9i it all works perfectly.

If I use linux to read the same file from the Sun database it all works fine.

If I use a database on a linux box to store the wav file and then read it back out if fails. The filesize is the same but the file contents are slightly different.

Example snippet of error is

Wrong 00000000: 52 49 46 46 02 3F 00 00 : 57 41 56 45 66 6D 74 20 RIFF.?..WAVEfmt
Correct 00000000: 52 49 46 46 02 A3 00 00 : 57 41 56 45 66 6D 74 20 RIFF....WAVEfmt

Wrong 00000010: 10 00 00 00 01 00 01 00 : 3F 56 00 00 3F 56 00 00 ........?V..?V..
Correct 00000010: 10 00 00 00 01 00 01 00 : EE 56 00 00 EE 56 00 00 .........V...V..

Not the 3F in place of the A3. I believe this is going to be encoding of some type but I am pretty lacking in knowledge on this.

Hopefully this is really easy and someone will be saying that's a UTF-8 problem.

Thanks for reading,
Iain

Here follows key functions of the program based on $ORACLE_HOME/rdbms/demo/cdemoplb.c

     checkerr(errhp, OCILobCreateTemporary(svchp,
                                           errhp,
                                           lobl,
                                           0,
                                           SQLCS_IMPLICIT,
                                           OCI_TEMP_CLOB,
                                           OCI_ATTR_NOCACHE,
                                           OCI_DURATION_SESSION));


         retval = OCILobWrite(svchp,
                              errhp,
                              lobl,
                              &amtp,
                              offset,

(dvoid *) bufp,
(ub4) MAXBUFLEN,
OCI_FIRST_PIECE,
(dvoid *)0,
(sb4 (*)(dvoid *, dvoid *, ub4 *, ub1 *)) 0,
(ub2) 0,
(ub1) SQLCS_IMPLICIT);
retval = OCILobRead(svchp, errhp, lobl, &amtp, offset, (dvoid *) bufp, (loblen < MAXBUFLEN ? loblen : MAXBUFLEN), (dvoid *)0, (sb4 (*)(dvoid *, const dvoid *, ub4, ub1)) 0, (ub2) 0, (ub1) SQLCS_IMPLICIT); if (OCIInitialize(init_mode, (dvoid *)0, (dvoid * (*)(dvoid *, size_t)) 0, (dvoid * (*)(dvoid *, dvoid *, size_t))0, (void (*)(dvoid *, dvoid *)) 0 )) { std::cout << "Failed to Initialize" << std::endl; return OCI_ERROR; } if (OCIEnvInit((OCIEnv **) envhp, (ub4) OCI_DEFAULT, (size_t) 0, (dvoid **) 0 )) { std::cout << "Failed to EnvInit" << std::endl; return OCI_ERROR; }
Received on Sun Aug 20 2006 - 06:41:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US