← Back to team overview

dhis2-users team mailing list archive

Re: HOW TO DELETE AN ENTITY IN TRACKER CAPTURE

 

has sql statement to delete?

On Thu, Nov 3, 2016 at 4:57 PM, Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
wrote:

> I don't have ready made statements at hand.
>
> But here is what you need to do - FOR THE TRACKED ENTITY INSTANCE in
> question
>
>    1. Delete event values from trackedentitydatavalue
>    2. Delete events from programstageinstance
>    3. Delete enrollments from programinstance
>    4. Delete attribute values from trackedentityattributevalue
>    5. Delete the instance from trackedentityinstance
>
> More on the associations:
>
> trackedentityinstance uid -> trackedentityinstance id -> programinstance
> id -> programstageinstance id
>
> --
> Abyot A. Gizaw.
> Senior Engineer, DHIS2
> University of Oslo
> http://www.dhis2.org
>
> On Thu, Nov 3, 2016 at 10:27 AM, Stanley Kalyati <skalyati@xxxxxxxxx>
> wrote:
>
>> Abyot,
>>
>> Could you help with the sql statements?
>>
>> Thanks in advance.
>>
>> Stanley
>>
>> On Thu, Nov 3, 2016 at 11:22 AM, Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
>> wrote:
>>
>>> Hi Stanley,
>>>
>>> It is only version 2.25 that has UI support for deleting Tracked Entity
>>> Instance. For the other versions, one has to do it manually using sql
>>> statements.
>>>
>>> --
>>> Abyot A. Gizaw.
>>> Senior Engineer, DHIS2
>>> University of Oslo
>>> http://www.dhis2.org
>>>
>>> On Thu, Nov 3, 2016 at 10:16 AM, Stanley Kalyati <skalyati@xxxxxxxxx>
>>> wrote:
>>>
>>>> Colleagues,
>>>>
>>>> My colleague entered a tracked entity in a wrong OU and i want to
>>>> delete that.Can someone tell me how to delete this entity? or move this
>>>> entity to another OU.
>>>>
>>>> You usual support is always appreciated.
>>>>
>>>> Stanley
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-users
>>>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>

References