[V4RB] Deleting "loose" records

Joerg Pressel joergp at three-2-one.com
Tue Jul 24 11:12:07 CDT 2007


Hi Ruslan,

many thanks for pointing me in the right direction. However, took me  
some more research for coming up with the complete solution:

In the table definition of "Titles":
mGenrePtr = New VObjectPtr("Genre_Ptr", inDataBase.mGenres,  
EVOnDelete.kRestrict, EVFlag.fNone, "link_tracks_genre")

Call to delete obsolete, not linked records in "Genres":
Call SqlExecute("DELETE FROM Genres WHERE COUNT_LINKED(Genres,  
link_tracks_genre)=0")


Cheers,

Jörg



> On 23/7/07 6:44 PM, "Joerg Pressel" <joergp at three-2-one.com> wrote:
>
> Hi Joerg,
>
>> Hi,
>>
>> is there a way of finding records in table that are not linked by
>> other tables?
>>
>> I have two tables with a 1:M relationship, linked with Object_Ptrs:
>> Table "Titles" field "Genre_Ptr" points to table "Genres". I want to
>> get rid of all records in "Genres" where is no "Title" pointing to.
>
> Check this URL:
>
> http://www.valentina-db.com/dokuwiki/doku.php? 
> id=paradigma:public:en:documen
> tation:vkernel:vlink:vlink
>
> Or
>
> http://www.valentina-db.com/dokuwiki/doku.php? 
> id=paradigma:public:en:documen
> tation:vsql:reference:reference
>
>
> For "Link Functions".
>
> You need  LINKED_COUNT()
>
>
>
> -- 
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list