Yes you can. First you will want to learn a little bit about 'UniQuery', which is the UniData database's query langauge. You can find that in the manuals on the Rocket Software site.
As an example, let's say you have a file called customers
and fields called name
and `age1
SELECT customers WITH name LIKE "Dan..." AND age GT "20"
This select statement will generate a list of record IDs that have a name
starting with Dan and have an age
greater than 20.
In your code, you will need to execute the SELECT statement first. Assuming udSess
is the session you created:
UniCommand cmd = udSess.command(); // Create an object to run the command
cmd.setCommand("SELECT customers WITH name LIKE 'Dan...' AND age GT '20'")
cmd.exec()
UniSelectList sl = udSess.selectList(0);
while (!sl.isLastRecordRead())
{
UniString recordID = sl.next();
// Read your record here, using recordID
}