Subject | Re: [IBO] Filter |
---|---|
Author | tgtecchio |
Post date | 2007-09-19T14:37:43Z |
I'm applying the filter like this:
qrForm.Filtered := False;
qrForm.Filter := 'upper(cli.NOME) LIKE ' + QuotedStr('TIAGO%');
qrForm.Filtered := True;
IBO raises an exception. If it helps, here goes the MadExcept call stack:
exception class : EIB_Error
exception message : Sintaxe inválida: parêntese sobrando ou faltando:
( upper ( cli.NOME ) LIKE 'TIAGO%' ).
main thread ($460):
006881d0 +1ac prERP2.exe IB_Components 27203 +54
TIB_Dataset.ProcessSQLWhereStrings
006874e8 +280 prERP2.exe IB_Components 26938 +49
TIB_Dataset.SysFinishRawSQL
0067d118 +0a0 prERP2.exe IB_Components 22009 +6
TIB_Statement.SysGetRawSQL
0067cb2b +0fb prERP2.exe IB_Components 21869 +20
TIB_Statement.SysExecPrepare
00687da8 +008 prERP2.exe IB_Components 27101 +1
TIB_Dataset.SysExecPrepare
0067c962 +02e prERP2.exe IB_Components 21802 +7 TIB_Statement.SysPrepare
00686f96 +08a prERP2.exe IB_Components 26820 +11 TIB_Dataset.SysPrepare
006bfd1c +048 prERP2.exe IBODataset 8234 +9
TIBOInternalDataset.SysPrepare
0067da3f +037 prERP2.exe IB_Components 22284 +3 TIB_Statement.SysExecute
0068646f +063 prERP2.exe IB_Components 26532 +7 TIB_Dataset.SysExecute
00685be6 +116 prERP2.exe IB_Components 26319 +23 TIB_Dataset.SysOpen
00685f67 +2c3 prERP2.exe IB_Components 26430 +81 TIB_Dataset.SysRefresh
006c0660 +04c prERP2.exe IBODataset 8488 +6
TIBOInternalDataset.SysRefresh
006857ee +056 prERP2.exe IB_Components 26175 +12 TIB_Dataset.RefreshAll
00685790 +000 prERP2.exe IB_Components 26159 +0 TIB_Dataset.Refresh
00695805 +1a5 prERP2.exe IB_Components 31960 +0 TIB_BDataset.SetFiltered
006bb3dc +084 prERP2.exe IBODataset 5727 +9 TIBODataset.SetFiltered
qrForm.Filtered := False;
qrForm.Filter := 'upper(cli.NOME) LIKE ' + QuotedStr('TIAGO%');
qrForm.Filtered := True;
IBO raises an exception. If it helps, here goes the MadExcept call stack:
exception class : EIB_Error
exception message : Sintaxe inválida: parêntese sobrando ou faltando:
( upper ( cli.NOME ) LIKE 'TIAGO%' ).
main thread ($460):
006881d0 +1ac prERP2.exe IB_Components 27203 +54
TIB_Dataset.ProcessSQLWhereStrings
006874e8 +280 prERP2.exe IB_Components 26938 +49
TIB_Dataset.SysFinishRawSQL
0067d118 +0a0 prERP2.exe IB_Components 22009 +6
TIB_Statement.SysGetRawSQL
0067cb2b +0fb prERP2.exe IB_Components 21869 +20
TIB_Statement.SysExecPrepare
00687da8 +008 prERP2.exe IB_Components 27101 +1
TIB_Dataset.SysExecPrepare
0067c962 +02e prERP2.exe IB_Components 21802 +7 TIB_Statement.SysPrepare
00686f96 +08a prERP2.exe IB_Components 26820 +11 TIB_Dataset.SysPrepare
006bfd1c +048 prERP2.exe IBODataset 8234 +9
TIBOInternalDataset.SysPrepare
0067da3f +037 prERP2.exe IB_Components 22284 +3 TIB_Statement.SysExecute
0068646f +063 prERP2.exe IB_Components 26532 +7 TIB_Dataset.SysExecute
00685be6 +116 prERP2.exe IB_Components 26319 +23 TIB_Dataset.SysOpen
00685f67 +2c3 prERP2.exe IB_Components 26430 +81 TIB_Dataset.SysRefresh
006c0660 +04c prERP2.exe IBODataset 8488 +6
TIBOInternalDataset.SysRefresh
006857ee +056 prERP2.exe IB_Components 26175 +12 TIB_Dataset.RefreshAll
00685790 +000 prERP2.exe IB_Components 26159 +0 TIB_Dataset.Refresh
00695805 +1a5 prERP2.exe IB_Components 31960 +0 TIB_BDataset.SetFiltered
006bb3dc +084 prERP2.exe IBODataset 5727 +9 TIBODataset.SetFiltered
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 11:54 PM 19/09/2007, you wrote:
> >Hi, here goes the original SQL (with monitor output), after I aplied
> >the filter:
>
> I meant, apply the original filter (without the extra parens) but
> with the qualifier correction.
>
> So - apply the filter as
>
> upper ( cli.NOME) LIKE 'TIAGO%'
>
> You haven't said HOW you are applying the filter. Remember, it is a
> string, so you need to take care of embedded quotes. So, if it's in
> code and you are hard-coding the LIKE operand, you'll need to do e.g.
>
> MyDataset.Filter := QuotedStr('upper ( cli.NOME) LIKE 'TIAGO%');
>
> Helen
>