ORA-01475 must reparse cursor to change bind variable datatype
ORA-01475 must reparse cursor to change bind variable datatype
Hi,
when executing follwing query i get this error.
Only with orale 8.1.7 not with oracle 9.2.
I'm using ODAC version 5.55.0.21.
Thanks for your help.
procedure TTransferProcess.SelectTransfers;
begin
with fQryHdlTrans do begin
Close;
Unprepare;
if Tag TagParsed then begin
SQL.Text :=
'SELECT A.* '+
' FROM VITSUSER.SFC_TRANSFERS A '+
' WHERE A.PROCESSID = :LOCKID ';
Tag := TagParsed;
end;
Prepare;
ParamByName('LOCKID').AsInteger := fProcessId;
Open;
end;
end;
when executing follwing query i get this error.
Only with orale 8.1.7 not with oracle 9.2.
I'm using ODAC version 5.55.0.21.
Thanks for your help.
procedure TTransferProcess.SelectTransfers;
begin
with fQryHdlTrans do begin
Close;
Unprepare;
if Tag TagParsed then begin
SQL.Text :=
'SELECT A.* '+
' FROM VITSUSER.SFC_TRANSFERS A '+
' WHERE A.PROCESSID = :LOCKID ';
Tag := TagParsed;
end;
Prepare;
ParamByName('LOCKID').AsInteger := fProcessId;
Open;
end;
end;
I have the same problem. Was a answer generated from this post ?
If so can you pleas post this?
In my case the SQl gets changed runtime so i dont even use parameters.
I have tryed to make this solution.
with dmkad.qukadsubjekt do
begin
Active := FALSE;
UnPrepare ;
SQL[5] := sql_string;
Prepare ;
Active := TRUE; // Reparse error here
end;
But its not working the strange this is that it works after the SQL has been opend once. Is there something i can call to make sure its reparsed ?
If so can you pleas post this?
In my case the SQl gets changed runtime so i dont even use parameters.
I have tryed to make this solution.
with dmkad.qukadsubjekt do
begin
Active := FALSE;
UnPrepare ;
SQL[5] := sql_string;
Prepare ;
Active := TRUE; // Reparse error here
end;
But its not working the strange this is that it works after the SQL has been opend once. Is there something i can call to make sure its reparsed ?
Btw the last error i got like this was couse of dynamic SQL and linked querys the masterdetail was cousing this.
This case its a master detail again so i gess i just need to look some more.
We need the dynamic SQL to change the data and tables used to present the detailed data. I hope you guys find the answer.
Please keep me informed to at pieter.valentijn(At)centric.nl
This case its a master detail again so i gess i just need to look some more.
We need the dynamic SQL to change the data and tables used to present the detailed data. I hope you guys find the answer.
Please keep me informed to at pieter.valentijn(At)centric.nl
I have reproduced your problem. It seems like this is Oracle 8.1.7 issue and doesn't appear on oracle servers of higher versions. The problem is in parameters' datatype binding. When you call Prepare for SQL with parameters of udefined types, ODAC assumes that their type is VARCHAR2 and binds them like parameters of this type. After preparing you implicitly change parameter's datatype to integer by calling "ParamByName('LOCKID').AsInteger := 10;" so when you open or execute SQL this parameter binds like an integer one. On execution Oracle returns an Ora - 01475 error because different parameter datatypes are used during preparation and execution.
The solution of this problem is to define parameter datatype before preparation i.e.
The solution of this problem is to define parameter datatype before preparation i.e.
Code: Select all
ParamByName('LOCKID').DataType := ftInteger;
Prepare;
ParamByName('LOCKID').AsInteger := 10;
Open;