binding variables [message #57317] |
Thu, 05 June 2003 04:47 |
Sheila
Messages: 28 Registered: May 1998
|
Junior Member |
|
|
I have written an application in VC++ that has many DB query statements. for example, in one user request it has to run a simple SELECT query in a loop about 7000 times to produce a result.
I want to use the native ability of oracle call interface about variable binding. As you know, when oracle takes any DML or query, it looks for IDENTICAL parsed statements in cache. If it finds this statement, it will use it as pre-parsed; else it will reparse the statement. Since, parsing is very
|
|
|
binding variables [message #57318 is a reply to message #57317] |
Thu, 05 June 2003 04:50 |
Sheila
Messages: 28 Registered: May 1998
|
Junior Member |
|
|
I have written an application in VC++ that has many DB query statements. for example, in one user request it has to run a simple SELECT query in a loop about 7000 times to produce a result.
I want to use the native ability of oracle call interface about variable binding. As you know, when oracle takes any DML or query, it looks for IDENTICAL parsed statements in cache. If it finds this statement, it will use it as pre-parsed; else it will reparse the statement. Since, parsing is very expensive operation, I'd like to use this ability to make my application run faster.
I'll be really appreciated if you guide me? and if my problem isn't clear yet, please let me know that.
|
|
|
|
Re: binding variables [message #57354 is a reply to message #57322] |
Sun, 08 June 2003 01:10 |
Sheila
Messages: 28 Registered: May 1998
|
Junior Member |
|
|
I have many different types in my SQL statement; by the way, let me give an example:
const char* EXECUTED_PROJECT_QUERY = "SELECT Project.* FROM Project,TestStepExecResult WHERE TestStepExecResult.WSID = %s AND TeststepExecResult.BUILDID = %s";
CString strQuery;
while (some condition)
{
for(...){ //some new values are assigned to idWS and idB
strQuery.Format(EXECUTED_PROJECT_QUERY , idWS, idB);
} //end_for
}
====================
As you see this SQL statement has to be executed many times with some new values assigned to it each time; I'm looking for some ways to prevent the query statement to be reparsed each time.
|
|
|