← Back to team overview

dhis2-devs team mailing list archive

Re: delete program manually cause error!

 

Hi Lin!
When updating data in the database in a running server, there might be a mismatch between cached data and the actual content of the database. I suggest you restart the dhis instance, and expect that this will fix your problem.

Markus

> 13. sep. 2018 kl. 15:05 skrev 林晓东 <lin_xd@xxxxxxx>:
> 
> HI,all,
>  I can't delete the program from maintains, so, do using sql: 
> 
> delete from programinstance where programid='103926124'
> delete from dashboard_items where dashboarditemid in (select dashboarditemid from dashboarditem where eventreport in (select eventreportid from eventreport where programid='103926124'))
> delete from dashboarditem where eventreport in (select eventreportid from eventreport where programid='103926124')
> delete from  eventreport_columns where eventreportid in (select eventreportid from eventreport where programid='103926124')
> delete from  eventreport_dataelementdimensions where eventreportid in (select eventreportid from eventreport where programid='103926124')
> delete from  eventreport_organisationunits where eventreportid in (select eventreportid from eventreport where programid='103926124')
> delete from  eventreport_periods where eventreportid in (select eventreportid from eventreport where programid='103926124')
> 
> delete from eventreport where programid='103926124'
> delete from program_organisationunits where programid='103926124'
> delete from  programstagesection_dataelements where programstagesectionid in (select programstagesectionid from programstagesection where programstageid in ( select programstageid from programstage where programid='103926124'))
> 
> delete from programstagesection where programstageid in (select programstageid from programstage where programid='103926124')
> --
> delete from trackedentitydatavalue where   programstageinstanceid in (select programstageinstanceid from programstageinstance a,programinstance b  where a.programinstanceid=b.programinstanceid and b.programid='103926124' )
> 
> delete from programstagedataelement where programstageid in (select programstageid from programstage where programid='103926124')
> 
> delete from programstage where programid='103926124'
> 
> delete from program  where programid='103926124'  
> 
> but , can't open dhis2:
>    http://------/dhis/api/programs <http://------/dhis/api/programs> :  
> {"httpStatus":"Internal Server Error","httpStatusCode":500,"status":"ERROR","message":"No row with the given identifier exists: [org.hisp.dhis.program.Program#103926124]"}
> 
> how?
> 
> 
> 
> 
> --
> 此致
> 
>    林晓东
> 
> 莫愁前路无知己,天下谁人不识君。
> 
> 
>  
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp


References