
July 7th, 2006, 02:38 PM
|
|
Registered User
|
|
Join Date: Jul 2006
Posts: 1
Time spent in forums: 27 m 51 sec
Reputation Power: 0
|
|
|
C/C++ character pointers vs. character arrays and using OPARSE
Hi Everyone.
I have a pretty complex C++ application that makes many calls to an oracle database using the OCI functions.
I have a question around how oparse works and using character pointers or character arrays to hold the SQL statement I want to parse.
Basically we set up the SQL stmt, open the oracle cursor, parse the statement and execute it. The cursor is left open and used multiple times throughout the application.
NOW, how does oparse handle saving the SQL statement? Does it just save the memory address or does it actually make a copy and save in its own memory space?
My problem is when I use a character array (char[]) to save the stmt it seems to get garbage later on when I want to use it again. If I use the char* it seems to be fine, or if I declare it as static char[] it also works.
Any insight, comments, or whatever on using oparse and statements going out of scope??
If I am using a static cursor should i ALWAYS be making my SQL statements static?
Thanks,
Alex
|