Solved

Locate field with null value

Posted on 2002-04-28
7
1,888 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
Hi rajniyadav,

select * from sometable
where some_field is NULL
0
 

Author Comment

by:rajniyadav
Comment Utility
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
Comment Utility
something like this?

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

STR - name of field where can be NULL
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:rajniyadav
Comment Utility
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
Comment Utility
? 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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now