Reusing SQLDA in Pro*C Method 4

From: Erik Domstad <d2domer_at_dtek.chalmers.se>
Date: 18 Jul 2003 07:39:23 -0700
Message-ID: <781128fe.0307180639.557216b3_at_posting.google.com>



I have a small application that executes dynamic sql statements usind "Method 4" , describing select and bind variables to get an SQLDA and using these descriptors when executing the statement.

Measurements have shown that for a lot of small querys, it takes about as long to describe as to fetch the data.

I have a limited set of statements stored in the database, each with a unique id. To improve performance I would like to store the desciptors for each statement only once. The next time I execute the same statement, I want to look up the predefined descriptors and reuse them since they should be identical as long as the query text is identical.

This does not seem to work however. As long as I allocate a new SQLDA for every statement it works, but each time I try to reuse a descriptor I get a memory fault and eventually a core dump. The memory fault occurs when the cursor is opened "USING" the old descriptor.

It it possible to reuse the descriptors for a different statement with identical SQL, or are they tied to a specific Pro*C statement?

/Erik Received on Fri Jul 18 2003 - 16:39:23 CEST

Original text of this message