Re: Segfault on VARRAY fetch
[email protected] (Tim Bunce) Mon, 10 Sep 2001 10:40:05 +0100
| Newsgroups | perl.dbi.oracle-oci |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Sep 06, 2001 at 03:13:31PM -0500, John Gorkos wrote: > Help- > I am trying to read spatial data from a standard SDO structure, as shown in the readgeom.c example in > $ORACLE_HOME/md/demo/examples (8.1.7) > Using Oracle::OCI, I am able to connect and prepare the query, after describing the objects that > I want to pull back. However, when I execute the query, I get segfaults under both Solaris (with coredump) and Linux. > Here are some code snippets that are relevant (I'm assuming you're looking at readgeom.c > for the missing pieces). Commentary follows the code, before the DBI->trace dump. > > ... > > According to readgeom.c, I need ARRAY_SIZE (which is 32) as my 'iters' parameter in the OCIStmtExecute. > When I set this to 0 (zero), the code executes flawlessly, but OCI_ATTR_ROW_COUNT also returns zero > (but the column count always returns 2, which is correct for the query). > I suspect strongly that the error is in the OCIDefineObject statement. According to the OCI reference book, I need to be > allocating memory space for the statement to return the values into, but I just don't know how to do it. The keys are the 4th-7th > params of OCIDefineObject. I'm NOT a C programmer, meaning many of the arcane uses of pointers to pointers and the concept > of pointers pointing to arrays of pointers REALLY fogs my brain, and I don't know how to translate this to Perl. I suspect that if > I managed to get the right structures, it would all work. > Any thoughts? Please? Wow! I admire your bravery! You've charged in where angels might fear to tread. When I get a moment I'll take a look at readgeom.c. Chase me if you've not heard anything within a couple of days. Tim.