TOracleQuery.Parse fails for Oracle 7

Sonique

Member²
In TOracleQuery.Parse (3.3.1), the following code is executed when connected to Oracle 7:

oparse(CDA, PChar(ParsedSQL), -1, 1, 2);
// Parsed successfully, set functiontype
FFunctionType := CDA.ft;

Unfortunately, as the the second last parameter to oparse is requesting a deferred parse, FFunctionType is invalid, so calling TOracleQuery.Describe doesn't allow you to determine the type of statement under ORacle 7!
 
Deferred parsing generally leads to the best performance, because it will be processed locally. The function type is not invalid, it is limited. It is known at this point if the statement is a select statement or not. After the statement is executed, the function type is known.

Note that the goal of the Describe function is to obtain the field list, not to obtain the function type. We can change this of course, or define a new function that will perform a non-deferred parse. Note that DDL statements would immediately be executed for a non-deferred parse.

------------------
Marco Kalter
Allround Automations
 
I agree that in most cases it makes sense to defer the parse, but in my particular case I need to know if the statement is a PL/SQL Block or not. Perhaps what is required is an parameter in TOracleQuery. Describe to force the parse. ie:

Describe(True); // Force the parse
Describe(); // Current behaviour
 
Yes, either an extra parameter, or an extra function.

------------------
Marco Kalter
Allround Automations
 
Back
Top