RecID again

Roger Amar Roger at logram.com
Wed Feb 16 12:50:13 CST 2005


Hi Robert,

I was thinking about your reply to my question regarding the recID.
The "Cursor_DeleteRecord" function needs "RecIndex" as 2nd param; I suppose "RecIndex" is the position number.
Then, how to delete several records in a loop if I have selected them with a query which is not able to return the position number ?

Roger;



-----Message d'origine-----
De : valentina-bounces at lists.macserve.net [mailto:valentina-bounces at lists.macserve.net] De la part de Roger Amar
Envoyé : mercredi 16 février 2005 12:31
À : Valentina Developers
Objet : RE: RecID again

Thank you, Robert.
Did you got the files on my ftp ?

Nice day,
Roger;

-----Message d'origine-----
De : valentina-bounces at lists.macserve.net [mailto:valentina-bounces at lists.macserve.net] De la part de Robert Brenstein Envoyé : mercredi 16 février 2005 12:21 À : Valentina Developers Objet : Re: RecID again

>Hello Ruslan,
>
>When deleting records in a database, the positions of remaining records 
>are not corresponding to their recID.
>So, one can't rely on recID to search records.
>Is there a way to rebuild table with new recIDs after deletions ?
>Or a way to use position number in a sql query ?
>
>Thanks,
>
>Roger;
>

You can physically compact your database records by dumping them into xml file and then re-creating the database from that file.

When you delete records, Valentina just makes those records available for re-use. This means the recids of remaining records do not change although their position (relative) does. When you add new records, the free records will be re-used, so the physical order of records will not correspond to the order of entries. This contributes a lot to Valentina's speed.

Having recids fixed for life for a given record can be advantagous in some applications; for example, they can be used as unique identifier. That is,however, a minus for people who want to rely on physical order of records. In general, it is not a good idea to rely on that. If you need sequencing, you just need to have your own field to handle that.

Robert
_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina



_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina





More information about the Valentina mailing list