Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: TOCIStatement.Describe/ParseErrorOffset
TOCIStatement.Describe/ParseErrorOffset
Posted: 2003/03/19 10:20
 
hi,
made that the ParseErrorOffset is set.

procedure TOCIStatement.Describe(AService: TOCIService);
var
res: sb4;
begin
DbgOut(tfStmt, 'Describe');
FService := AService;
FService.UpdateNonBlockingMode;
try {GMT}

repeat
res := NCOci.OCIStmtExecute(FService.FHandle, FHandle, Error.FHandle,
0, 0, nil, nil, OCI_DESCRIBE_ONLY);
case res of
OCI_STILL_EXECUTING:
FService.DoYield;
OCI_NO_DATA, OCI_NEED_DATA, OCI_SUCCESS:
Check('OCIStmtExecute', OCI_SUCCESS);
else
Check('OCIStmtExecute', res);
end;
until (res <> OCI_NEED_DATA) and (res <> OCI_STILL_EXECUTING);


except {GMT ->}
on E: EOCINativeError do begin
if FOCIVersion >= cvOracle81000 then
E.FParseErrorOffset := PARSE_ERROR_OFFSET;
raise;
end;
end; {<- GMT}
end;
RE: TOCIStatement.Describe/ParseErrorOffset
Posted: 2003/04/04 07:29
 
BTW EOciNativeError.ParseErrorOffset is not initialized in event TOCIDatabase.OnError. It is assigned after this event is called. But one can get value of ParseErrorOffset in this away lke this:
if (ASender is TOCIStatementDataSet) // ancestor of TOCIQuery
and (TOCIStatementDataset(ASender).HStatement <> nil) then
ErorPos := TOCIStatementDataset(ASender).HStatement.PARSE_ERROR_OFFSET+1;
RE: TOCIStatement.Describe/ParseErrorOffset
Posted: 2003/04/04 07:32
 
Sorry for typo above, not "in this away lke this", but "in this event like this".