Re: Help Accessing V7 BLOBS via OCI/Pro*C

From: Chuck Fetters <cfetters_at_iac.net>
Date: 27 Sep 1994 20:55:27 -0400
Message-ID: <36aetv$9i5_at_great-miami.iac.net>


Just last week, I wrote a Pro*C program that used blobs, so it's still pretty fresh in my mind. In the Pro*C manual, check out example program 4. It gave an example of using a blob. Basically you have to use "datatype equivalencing" to tell ORACLE that some C typedef is the same as a LONG. Unfortunately, it only works well if the blob data in each row is of the same length. If that works for your data then it's pretty simple.

However, ever blob I work with is a different length. So I added a length column to my table. FIrst I select the length. Then allocate the space for the blob. Then select the blob using "method 4" (dynamic SQL). That lets me indicate dynamically how big the host variable is. I'm not sure yet about how good the response time will be since I'm doing two selects. It works great on a small DB on a machine with only a couple developers on it. I'm hoping that production won't be too bad considering that the second select is going after data that's probably still in the SGA.

Good luck.
Carol Fetters
cfetters_at_iac.net Received on Wed Sep 28 1994 - 01:55:27 CET

Original text of this message