FilterSQL with bind variables works after the second open
Posted: Wed 27 Aug 2008 14:21
Hi,
since 6.50.0.37 21-Aug-08, I have a problem with TORATABLE and FILTERSQL with the use of bind variables. After the first open the table isempty. Following I Close the Table, set the value of the bind variables, open the table again and it works. Therefore I use the following workaround.
Example:
..
torasession.option.useunicode := true
..
..
//BEGIN-WORKAROUND
// Workaround des Fehlers, dass bei FilterSQL mit Bindvariablen der
// 1. Open von TOraTable die Datenmenge leer bleibt.
if TableSchaden.FilterSQL = '' then
begin
TableSchaden.FilterSQL := 'rownum 0 then
begin
TableSchaden.FilterSQL := 'IDKUN = :IDKUN and IDVER = :IDVER' + GetSQLLoginFilterString;
TableSchaden.prepare;
TableSchaden.ParamByName('IDKUN').asinteger := aIdKun;
TableSchaden.ParamByName('IDVER').asinteger := aIdVer;
end
else
begin
TableSchaden.FilterSQL := 'IDKUN = :IDKUN' + GetSQLLoginFilterString;
TableSchaden.prepare;
TableSchaden.ParamByName('IDKUN').asinteger := aIdKun;
end;
tableschaden.open;
I hope you can reproduce this situation.
Thank you
Edmund Pfundstein
since 6.50.0.37 21-Aug-08, I have a problem with TORATABLE and FILTERSQL with the use of bind variables. After the first open the table isempty. Following I Close the Table, set the value of the bind variables, open the table again and it works. Therefore I use the following workaround.
Example:
..
torasession.option.useunicode := true
..
..
//BEGIN-WORKAROUND
// Workaround des Fehlers, dass bei FilterSQL mit Bindvariablen der
// 1. Open von TOraTable die Datenmenge leer bleibt.
if TableSchaden.FilterSQL = '' then
begin
TableSchaden.FilterSQL := 'rownum 0 then
begin
TableSchaden.FilterSQL := 'IDKUN = :IDKUN and IDVER = :IDVER' + GetSQLLoginFilterString;
TableSchaden.prepare;
TableSchaden.ParamByName('IDKUN').asinteger := aIdKun;
TableSchaden.ParamByName('IDVER').asinteger := aIdVer;
end
else
begin
TableSchaden.FilterSQL := 'IDKUN = :IDKUN' + GetSQLLoginFilterString;
TableSchaden.prepare;
TableSchaden.ParamByName('IDKUN').asinteger := aIdKun;
end;
tableschaden.open;
I hope you can reproduce this situation.
Thank you
Edmund Pfundstein