Board index » delphi » TDataset.filter works with oracle?

TDataset.filter works with oracle?

Hi all:

Does the filter property in TDataset (Delphi 3) work with Oracle 7.3
tables?
I am applying a simple filter and when I set it true, all the data
disappears from the
DBGrid. Any hints?

Thanks
--Minhaj Hasan
   Maryland Office of Planning

 

Re:TDataset.filter works with oracle?


Filtering TQuerys works fine with Oracle.  The data disappears from the grid
because no rows match your filter expression.  Post the filter expression if
you need some help.

V/R
Russell L. Smith

Quote
Minhaj Hasan wrote in message <361CCE6B.A7756...@mail.op.state.md.us>...
>I am applying a simple filter and when I set it true, all the data
>disappears from the DBGrid. Any hints?

Re:TDataset.filter works with oracle?


Re:TDataset.filter works with oracle?


Hi. Thanks for the help. My filters are fine with Oracle when the fields
are string fields.
The problems arise when i try to filter on numeric fields (BDE sees as
tfloatfield, really an
Oracle NUMBER(6) field).

table1.filter:= 'projectid = 102';

Re:TDataset.filter works with oracle?


Use upper-case column names:

    table1.filter:= 'PROJECTID = 102';

Quote
Minhaj Hasan wrote in message <361CF884.EEC24...@mail.op.state.md.us>...
>table1.filter:= 'projectid = 102';

Re:TDataset.filter works with oracle?


Re:TDataset.filter works with oracle?


I tried that (using caps). It doesn't work.
It does work when I use the onfilterrecord event.
With that I can do table1.fieldbyname('projectid').AsFloat = 102
and it runs fine.

Re:TDataset.filter works with oracle?


Try using a filter like PROJECTID = 102.0.
I think that your having a problem with an exact match of an integer
to a float.
Quote
Minhaj Hasan wrote:

> I tried that (using caps). It doesn't work.
> It does work when I use the onfilterrecord event.
> With that I can do table1.fieldbyname('projectid').AsFloat = 102
> and it runs fine.

Re:TDataset.filter works with oracle?


This works fine for me with "select * from TEMP":

    CREATE TABLE TEMP (
      USER_NM VARCHAR2(20) NOT NULL PRIMARY KEY,
      DEPT_ID NUMBER(6)
    )

    Query1.Filter := 'DEPT_ID = 2';
    Query1.Filtered := True;

Can you post a simple example for you that doesn't work?

V/R
Russell L. Smith

Quote
Minhaj Hasan wrote in message <361D024E.76A1...@mail.op.state.md.us>...
>I tried that (using caps). It doesn't work.

Re:TDataset.filter works with oracle?


Hi everyone:

Russell and everyone, thanks a lot for your help. I tried using
different precisions (102.0 , etc) for the filter string, but to no
avail. I did not figure it out, but instead I'm just using the
onFilterRecord event which works fine for me.

BTW, I also have a problem with the '/' character in the filter string
when I'm trying to filter on an oracle date field. eg  'timein =
12/05/1998 3:45:59 PM'. I get the error
'illegal character used in filter expression'.

Any hints.
Thanks
MH

Re:TDataset.filter works with oracle?


Dates in filter expressions need to be enclosed in single quotes.

    Filter := 'PASSWORD_DT = ' + QuotedStr('12/05/1998');

I don't think times will work at all, but don't know for sure.

V/R
Russell L. Smith

Quote
Minhaj Hasan wrote in message <361D22A6.27A60...@mail.op.state.md.us>...
>BTW, I also have a problem with the '/' character in the filter string
>when I'm trying to filter on an oracle date field. eg  'timein =
>12/05/1998 3:45:59 PM'. I get the error
>'illegal character used in filter expression'.

Other Threads