Subject | Re: Important RE: [IBO] IBOQuery and Refresh |
---|---|
Author | Carlos H. Cantu (TeamFB) |
Post date | 2007-10-02T13:49:11Z |
I was out in vacation since 22/Sept. Can someone tell me if the below
patch (posted by Helen at 20/Sept) is actually the most up to date to
solve the referred problem?
[]s
Cantu (Membro do TeamFB - FireBase)
http://www.warmboot.com.br
FireBase - http://www.FireBase.com.br
HB> At 04:59 PM 20/09/2007, Petr Hartman wrote:
HB> Declaration:
HB> function MakeLookupSQL( const SQL: string;
HB> const SQLSelect: string;
HB> const KeyLinks: TIB_StringList;
HB> var LookupSQL: string;
HB> var SelectParamCount: integer;
HB> const OldParamOrder: boolean ): integer;
HB> Implementation:
HB> function MakeLookupSQL( const SQL: string;
HB> const SQLSelect: string;
HB> const KeyLinks: TIB_StringList;
HB> var LookupSQL: string;
HB> var SelectParamCount: integer;
HB> const OldParamOrder: boolean ): integer;
HB> var
HB> ii: integer;
HB> OldWhere: string;
HB> NewWhere: string;
HB> tmpFrom: string;
HB> tmpSelect: string;
HB> tmpPrms: TIB_StringList;
HB> tmpLen: longint;
HB> BegPos,
HB> EndPos,
HB> UnionLevel: integer;
HB> begin
HB> NewWhere := '';
HB> OldWhere := '';
HB> LookupSQL := SQL;
HB> UnionLevel := -1;
HB> GetSQLSelect( SQL, tmpSelect, BegPos, EndPos, UnionLevel );
HB> SetSQLSelect( LookupSQL, SQLSelect, UnionLevel );
HB> SetSQLPlan( LookupSQL, '', UnionLevel );
HB> SetSQLOrder( LookupSQL, '' );
HB> SetSQLForUpdate( LookupSQL, '' );
HB> GetSQLWhere( LookupSQL, OldWhere, BegPos, EndPos, UnionLevel );
HB> for ii := 0 to KeyLinks.Count - 1 do
HB> begin
HB> if ii > 0 then
HB> NewWhere := NewWhere + IBO_AND;
HB> NewWhere := NewWhere + KeyLinks.IndexNames[ii] + '=?';
HB> end;
HB> AddWhereClauseHigh( OldWhere, NewWhere );
HB> SetSQLWhere( LookupSQL, OldWhere, UnionLevel );
HB> GetSQLFrom( LookupSQL, tmpFrom, BegPos, EndPos, UnionLevel );
HB> tmpPrms := TIB_StringList.Create;
HB> try
HB> MakeServerSQL( tmpFrom, tmpPrms, nil, nil, tmpFrom, #0, true, tmpLen,
HB> OldParamOrder );
HB> Result := tmpPrms.Count;
HB> MakeServerSQL( tmpSelect, tmpPrms, nil, nil, tmpSelect, #0, true, tmpLen,
HB> OldParamOrder );
HB> SelectParamCount := tmpPrms.Count;
HB> finally
HB> tmpPrms.Free;
HB> end;
HB> end;
HB> Contact me through list or privately for anything else that comes up missing.
HB> Helen
HB> ___________________________________________________________________________
HB> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
HB> without the need for BDE, ODBC or any other layer.
HB> ___________________________________________________________________________
HB> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
HB> keyword-searchable FAQ, community code contributions and more !
HB> Yahoo! Groups Links
patch (posted by Helen at 20/Sept) is actually the most up to date to
solve the referred problem?
[]s
Cantu (Membro do TeamFB - FireBase)
http://www.warmboot.com.br
FireBase - http://www.FireBase.com.br
HB> At 04:59 PM 20/09/2007, Petr Hartman wrote:
>> > FPrmCnt := MakeLookupSQL( ServerSQL,HB> Here's the revised function (in IB_Parse.pas):
>> > KeySQLSelect,
>> > KeyLinks,
>> > LookupSQL,
>> > SPrmCnt,
>> > tmpOldParamOrder );
HB> Declaration:
HB> function MakeLookupSQL( const SQL: string;
HB> const SQLSelect: string;
HB> const KeyLinks: TIB_StringList;
HB> var LookupSQL: string;
HB> var SelectParamCount: integer;
HB> const OldParamOrder: boolean ): integer;
HB> Implementation:
HB> function MakeLookupSQL( const SQL: string;
HB> const SQLSelect: string;
HB> const KeyLinks: TIB_StringList;
HB> var LookupSQL: string;
HB> var SelectParamCount: integer;
HB> const OldParamOrder: boolean ): integer;
HB> var
HB> ii: integer;
HB> OldWhere: string;
HB> NewWhere: string;
HB> tmpFrom: string;
HB> tmpSelect: string;
HB> tmpPrms: TIB_StringList;
HB> tmpLen: longint;
HB> BegPos,
HB> EndPos,
HB> UnionLevel: integer;
HB> begin
HB> NewWhere := '';
HB> OldWhere := '';
HB> LookupSQL := SQL;
HB> UnionLevel := -1;
HB> GetSQLSelect( SQL, tmpSelect, BegPos, EndPos, UnionLevel );
HB> SetSQLSelect( LookupSQL, SQLSelect, UnionLevel );
HB> SetSQLPlan( LookupSQL, '', UnionLevel );
HB> SetSQLOrder( LookupSQL, '' );
HB> SetSQLForUpdate( LookupSQL, '' );
HB> GetSQLWhere( LookupSQL, OldWhere, BegPos, EndPos, UnionLevel );
HB> for ii := 0 to KeyLinks.Count - 1 do
HB> begin
HB> if ii > 0 then
HB> NewWhere := NewWhere + IBO_AND;
HB> NewWhere := NewWhere + KeyLinks.IndexNames[ii] + '=?';
HB> end;
HB> AddWhereClauseHigh( OldWhere, NewWhere );
HB> SetSQLWhere( LookupSQL, OldWhere, UnionLevel );
HB> GetSQLFrom( LookupSQL, tmpFrom, BegPos, EndPos, UnionLevel );
HB> tmpPrms := TIB_StringList.Create;
HB> try
HB> MakeServerSQL( tmpFrom, tmpPrms, nil, nil, tmpFrom, #0, true, tmpLen,
HB> OldParamOrder );
HB> Result := tmpPrms.Count;
HB> MakeServerSQL( tmpSelect, tmpPrms, nil, nil, tmpSelect, #0, true, tmpLen,
HB> OldParamOrder );
HB> SelectParamCount := tmpPrms.Count;
HB> finally
HB> tmpPrms.Free;
HB> end;
HB> end;
HB> Contact me through list or privately for anything else that comes up missing.
HB> Helen
HB> ___________________________________________________________________________
HB> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
HB> without the need for BDE, ODBC or any other layer.
HB> ___________________________________________________________________________
HB> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
HB> keyword-searchable FAQ, community code contributions and more !
HB> Yahoo! Groups Links