Subject | Re: What is the BEST method to find if a record exists? |
---|---|
Author | GrumpyRain |
Post date | 2004-11-17T22:32:55Z |
That is probably the most efficient way BUT (there is always one) the
field needs to be declared as NOT NULL for that test to be valid.
NO_RECORD_EXISTS = TRUE;
for select first 1 testfield
from testfile
where testfield='xxxxx'
into :testfield
do
begin
NO_RECORD_EXISTS = FALSE;
end
field needs to be declared as NOT NULL for that test to be valid.
> should have beenAnother way that should work is:
> 3.
> NO_RECORD_EXISTS = 'FALSE';
> testfield = null;
> select first 1 testfield from testfile
> where testfield='xxxxx' into :testfield;
> if (testfield = null) then NO_RECORD_EXISTS = 'TRUE';
>
> Thanks
>
NO_RECORD_EXISTS = TRUE;
for select first 1 testfield
from testfile
where testfield='xxxxx'
into :testfield
do
begin
NO_RECORD_EXISTS = FALSE;
end