Delete connection between not existing worker and existing user

Which stops you from assigning worker to the user ( this happens usually after migrations of data or something similar)

 

static void DelConBetweenNotExistWorkerandUser(Args _args)
{
    DirPersonUser         dirPersonUser;
    UserInfo                   userInfo;
    int                             counter;
    while select forUpdate dirPersonUser notExists join UserInfo
        where DirPersonUser.User == userinfo.id
    {
        info ( DirPerson::find(dirPersonUser.PersonParty).Name);
        dirPersonUser.delete();
    }
    info(int2str(counter));

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s