Follow the linked list approach.

Add two more members in the structure, prev_id and next_id and store the
record_id and create a linked list.

Also you need to store the first record id of the order in the corresponding
master record in order to retrieve all the detail (order records).

Thanks
"George Bassili" <[EMAIL PROTECTED]> wrote in message
news:98771@;palm-dev-forum...
>
> Hi everyone,
> just wanting some advice on a databse design.
> I have 2 entities in a one to many relationship :
>
> Sales <--------->> Sales Order Lines or Items
>
>
> I come from a relational database background so I automatically just put
> them in 2 databases for my app.
> Each structure is about the same size in each table, probably on average
> between 1 and 2k.
> Now i've realised that when i want to retrieve the order lines, i need to
go
> through every record in the database to discover the appropriate ones.
>
> I'm wondering whether I shoudl put it all in one database?  So My
Structure
> would become
>
> typedef struct {
>  PrimaryKey order;
>  const char * lastname;
>  const char * firstname;
>  const char * title;
>  const char * notes;
> .....
>  OrderLines    lines[1] // could be more than one!
> } Order
>
> Is this more sort of appropriate and better design practise for the palm?
> Could i reach issues if there are many elements in the array say 20?
> There are other databases as well and everything is related to order, so
is
> it better to just throw everything on there?
>
> Thanks for any help.
>
> Regards,
> George Bassili
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to