Solved

Locate field with null value

Posted on 2002-04-28
7
2,117 Views
Last Modified: 2012-05-04
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



0
Comment
Question by:rajniyadav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 6976398
Hi rajniyadav,

select * from sometable
where some_field is NULL
0
 

Author Comment

by:rajniyadav
ID: 6976820
i want to user
Query.Locate function
Through sql it is working but i want to user locate function.
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6976843
something like this?

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

STR - name of field where can be NULL
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rajniyadav
ID: 6976989
when i am doing this locate function returns false even though there is one record with null.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 6977577
? maybe
as the values in the locate-method are internal variants you could try

Query1.Locate('STR', varNull, []); //or varEmpty

just a guess

meikl ;-)


0
 

Author Comment

by:rajniyadav
ID: 6979294
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.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7213588
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 ;-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question