Link to home
Start Free TrialLog in
Avatar of rajniyadav
rajniyadav

asked on

Locate field with null value

I am using interbase as database with delphi 5.
i am using TIBQuery

Now in a table one field contains Null
i want to use locate function locate this field where value is null. Its now working.

Do you have any suggestions

rajni



Avatar of Igor UL7AAjr
Igor UL7AAjr
Flag of Kazakhstan image

Hi rajniyadav,

select * from sometable
where some_field is NULL
Avatar of rajniyadav
rajniyadav

ASKER

i want to user
Query.Locate function
Through sql it is working but i want to user locate function.
something like this?

  Query1.Locate('STR', NULL, []);

STR - name of field where can be NULL
when i am doing this locate function returns false even though there is one record with null.
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
kretzschmar that works but i have one more problem.

Since i have more than on fields value to locate can u tell how can i store those values in a variable and use it in locate function

i made one string variable even variant and stored all the fieldvalues seperated with commas in that but it is not locating the right record.
And if i directly give the value in hte locate function it does locates

Can u help in that.
even not tested, but try

Query1.Locate('FIELD1;FIELD2;FIELD3;FIELD4', VarArrayOf([varNull,varNull,varNull,varNull]), []); //or varEmpty

seems i got no notification at april

thanks for the points

meikl ;-)