Blobs in Oracle databases
Maxime LABELLE <[email protected]> Mon, 31 Mar 2003 17:40:57 +0200
| Newsgroups | gmane.comp.windows.devel.oledb.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C2F79B.EBF97642
Content-Type: text/plain;
charset="iso-8859-1"
Hi all,
Has anyone successfully stored blobs in an Oracle table
using ISequentialStream. Here is how I have tried it:
1. First I insert a new record in the table, with all meaningful
information set, and the blob contents initialized to EMPTY_BLOB():
INSERT INTO MYTABLE (ID, CONTENTS) VALUES (:id, EMPTY_BLOB())
2. Then, I select the blob column using an SQL statement.
Before calling IRowset::GetData, I perform the binding
with the appropriate information:
a) wType = DBTYPE_UNKNOWN
b) dwPart = DBPART_VALUE | DBPART_STATUS
b) pObject->iid = __uuidof(ISequentialStream)
c) pObject->dwFlags = STGM_WRITE
SELECT CONTENTS FROM MYTABLE WHERE ID = :id
The GetData call succeeds and I have a valid ISequentialStream
pointer. But actually writing the data returns E_FAIL with no
precision to what failed whatsoever.
I have tried initializing the column to NULL and using dwFlags = STGM_CREATE
but that doesn't work either.
Has anyone some useful tips to share?
Cheers.
Maxime.
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
------_=_NextPart_001_01C2F79B.EBF97642
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>Blobs in Oracle databases</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">Hi all,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Has anyone successfully stored blobs in an Oracle table</FONT>
<BR><FONT SIZE=2 FACE="Arial">using ISequentialStream. Here is how I have tried it:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">1. First I insert a new record in the table, with all meaningful</FONT>
<BR><FONT SIZE=2 FACE="Arial"> information set, and the blob contents initialized to EMPTY_BLOB():</FONT>
<BR><FONT SIZE=2 FACE="Arial"> INSERT INTO MYTABLE (ID, CONTENTS) VALUES (:id, EMPTY_BLOB())</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">2. Then, I select the blob column using an SQL statement.</FONT>
<BR><FONT SIZE=2 FACE="Arial"> Before calling IRowset::GetData, I perform the binding</FONT>
<BR><FONT SIZE=2 FACE="Arial"> with the appropriate information:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> a) wType = DBTYPE_UNKNOWN</FONT>
<BR><FONT SIZE=2 FACE="Arial"> b) dwPart = DBPART_VALUE | DBPART_STATUS</FONT>
<BR><FONT SIZE=2 FACE="Arial"> b) pObject->iid = __uuidof(ISequentialStream) </FONT>
<BR><FONT SIZE=2 FACE="Arial"> c) pObject->dwFlags = STGM_WRITE</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> SELECT CONTENTS FROM MYTABLE WHERE ID = :id</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The GetData call succeeds and I have a valid ISequentialStream</FONT>
<BR><FONT SIZE=2 FACE="Arial">pointer. But actually writing the data returns E_FAIL with no</FONT>
<BR><FONT SIZE=2 FACE="Arial">precision to what failed whatsoever.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I have tried initializing the column to NULL and using dwFlags = STGM_CREATE</FONT>
<BR><FONT SIZE=2 FACE="Arial">but that doesn't work either.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Has anyone some useful tips to share?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Cheers.</FONT>
<BR><FONT SIZE=2 FACE="Arial">Maxime.</FONT>
</P>
<BR>
</BODY>
</HTML>
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
------_=_NextPart_001_01C2F79B.EBF97642--