Deleting OrgUnit

Hi all,

I have a problem with OrgUnits, I want to delete a OrgUnit that no longer serves in the system but I know that this message which appears OrgUnit means that this is linked to the data but as I made my manipulations front end, and I am obliged to remove, then how?

who can help me on this?

thank you

image

···

Carlos Nyembwe

Informaticien

Skype*: carloscnk1***

Téléphone*: (+243)813166381***

***URL: ***www.linkedin.com/in/carloscnk

Hi Carlos,
The only real way to do this at the moment is to remove the data values from the database with SQL.

So, something like

DELETE FROM datavalue where sourceid = XXXXX;

where XXXXXX is the organisationunitid of the orgunit you wish to delete.

This statement will permanently delete all data associated with the orgunit you wish to remove.

Just be sure, obviously, to ensure you have a backup of your database, and that the SQL which you develop actually does what you want it to!

Regards,

Jason

image

···

On Mon, Jun 15, 2015 at 12:23 PM, Carlos Nyembwe nyembwe@gmail.com wrote:

Hi all,

I have a problem with OrgUnits, I want to delete a OrgUnit that no longer serves in the system but I know that this message which appears OrgUnit means that this is linked to the data but as I made my manipulations front end, and I am obliged to remove, then how?

who can help me on this?

thank you

Carlos Nyembwe

Informaticien

Skype*: carloscnk1***

Téléphone*: (+243)813166381***

***URL: ***www.linkedin.com/in/carloscnk


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

hi Carlos
the orgunit or are trying to delete has some data (is associated with some data). It may not be a good idea to delete anyway. I'd recommend that you just close the facility so that you can still use the legacy data associated with it later. To do this you can open the facility and edit and insert 'closing date'. hope you find this to be useful.

Moeketse Tlohang
Cell: +266 58095200
Email: moeketsetf@yahoo.com

"For God is not unrighteous to forget your work and labour of love..."

···

--------------------------------------------
On Mon, 6/15/15, Carlos Nyembwe <nyembwe@gmail.com> wrote:

Subject: [Dhis2-users] Deleting OrgUnit
To: "dhis2-devs" <dhis2-devs@lists.launchpad.net>, "dhis2-users@lists.launchpad.net" <dhis2-users@lists.launchpad.net>
Date: Monday, June 15, 2015, 12:23 PM

Hi all,
I have a problem with OrgUnits, I want to
delete a OrgUnit that no longer serves in the system but I
know that this message which appears OrgUnit means that this
is linked to the data but as I made my manipulations front
end, and I am obliged to remove, then how?
who can help me on this?
thank you

--
Carlos NyembweInformaticien
Skype:
carloscnk1Téléphone:
(+243)813166381URL: www.linkedin.com/in/carloscnk

-----Inline Attachment Follows-----

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to : dhis2-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
More help : https://help.launchpad.net/ListHelp

In that case, you will need to delete the data using the user interface.

Currently, there is no way to delete an orgunit which has data associated with it, without deleting all of the data from that orgunit first.

image

···

On Mon, Jun 15, 2015 at 1:17 PM, Carlos Nyembwe nyembwe@gmail.com wrote:

Thanks, but i kown that but, I don’t use back end, I’m using front end. now, how can I execute the SQL?

On Mon, Jun 15, 2015 at 11:38 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Carlos,
The only real way to do this at the moment is to remove the data values from the database with SQL.

So, something like

DELETE FROM datavalue where sourceid = XXXXX;

where XXXXXX is the organisationunitid of the orgunit you wish to delete.

This statement will permanently delete all data associated with the orgunit you wish to remove.

Just be sure, obviously, to ensure you have a backup of your database, and that the SQL which you develop actually does what you want it to!

Regards,

Jason


Carlos Nyembwe

Informaticien

Skype*: carloscnk1***

Téléphone*: (+243)813166381***

***URL: ***www.linkedin.com/in/carloscnk

On Mon, Jun 15, 2015 at 12:23 PM, Carlos Nyembwe nyembwe@gmail.com wrote:

Hi all,

I have a problem with OrgUnits, I want to delete a OrgUnit that no longer serves in the system but I know that this message which appears OrgUnit means that this is linked to the data but as I made my manipulations front end, and I am obliged to remove, then how?

who can help me on this?

thank you

Carlos Nyembwe

Informaticien

Skype*: carloscnk1***

Téléphone*: (+243)813166381***

***URL: ***www.linkedin.com/in/carloscnk


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Carlos,

You can create an SQL View like the following in order to find out where your data is:

select p.startdate, de.name, dv.value from datavalue dv

inner join organisationunit ou on sourceid = organisationunitid

inner join period p on p.periodid=dv.periodid

inner join dataelement de on de.dataelementid=dv.dataelementid

where ou.name = ‘NAME OF YOUR OU’

image

···

On Mon, Jun 15, 2015 at 1:31 PM, Matthieu Pinard matthiep@ifi.uio.no wrote:

Bonjour Carlos,

peux-tu lancer une requête pour vérifier ce qui est associé à ton orgunit?

Cdlt,

Matthieu

Vous recevez ce message, car vous êtes abonné au groupe Google Groupes “Groupe Francophone du DHIS 2”.

Pour vous désabonner de ce groupe et ne plus recevoir d’e-mails le concernant, envoyez un e-mail à l’adresse dhis2-fr+unsubscribe@googlegroups.com.

Pour obtenir davantage d’options, consultez la page https://groups.google.com/d/optout.

Matthieu Pinard

DHIS 2 Academy & Community Coordinator | University of Oslo

On 15 June 2015 at 12:15, Carlos Nyembwe nyembwe@gmail.com wrote:

No, il n’y a meme pas un DataSet associe

On Mon, Jun 15, 2015 at 11:32 AM, Matthieu Pinard matthiep@ifi.uio.no wrote:

Bonjour Carlos.
As-tu des données associées à ces orgunits?

Cordialement,

Matthieu


Carlos Nyembwe

Informaticien

Skype*: carloscnk1***

Téléphone*: (+243)813166381***

***URL: ***www.linkedin.com/in/carloscnk

Matthieu Pinard

DHIS 2 Academy & Community Coordinator | University of Oslo

On 15 June 2015 at 11:23, Carlos Nyembwe nyembwe@gmail.com wrote:

Hi all,

I have a problem with OrgUnits, I want to delete a OrgUnit that no longer serves in the system but I know that this message which appears OrgUnit means that this is linked to the data but as I made my manipulations front end, and I am obliged to remove, then how?

who can help me on this?

thank you

Carlos Nyembwe

Informaticien

Skype*: carloscnk1***

Téléphone*: (+243)813166381***

***URL: ***www.linkedin.com/in/carloscnk


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org