DB ...

A PocketC native palm library offering native forms and assorted utilities

Postby MALOSSE on Fri May 31, 2002 10:31 am

How can i interrogate PilotDB database like SQL language ?
MALOSSE
 
Posts: 6
Joined: Fri May 24, 2002 1:06 pm
Location: France

Postby jstadolnik on Fri May 31, 2002 12:47 pm

I've never used an SQL language, so it's difficult for to grasp what you are asking?

Can you embellish?

Joe



The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby MALOSSE on Fri May 31, 2002 1:18 pm

Ok i try.

With SQL you can interrogate data from database with "natural" sentence.
For example, if you have database named "family", with one field "name" but with many records, you can select one of record by:

SELECT name FROM family WHERE name="toto"

Perhaps my question is mistake, but i've database with 450 records and i would like to seek record with multi criteria.



Many thanks in advance

Manu
MALOSSE
 
Posts: 6
Joined: Fri May 24, 2002 1:06 pm
Location: France

Postby jstadolnik on Fri May 31, 2002 5:02 pm

This is really complicated to imlement. The Pilot-DB format wasn't really intended for that kind of advanced database access, not that it can't be done though by doing individual sorts and searches... but it's quite complicated.

You can easily fake this out by loading the DB records into a contigious array (see malloct() and Array()) and then using the Sort() and Query() functions on the array to find the data you want.

The Sort() function in the upcoming v7.4.0 has a pointer-to-data struct sort that makes this even easier to do.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby MALOSSE on Mon Jun 03, 2002 10:01 am

I've use Array() and malloc() function, but i'm serch another manner to interrogate the databases.


Many thanks for your informations.

Manu
MALOSSE
 
Posts: 6
Joined: Fri May 24, 2002 1:06 pm
Location: France

Postby jstadolnik on Mon Jun 03, 2002 12:14 pm

1) load the database records into an array.
2) Use Sort() and Query() on the array to get the data you want.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 0 guests

cron