The below function can be used to delete a PeopleSoft query from database.
Function DeleteQuery(&sQueryName As string)
SQLExec("DELETE FROM PSQRYDEFN WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYSELECT WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYRECORD WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYFIELD WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYFIELDLANG WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYCRITERIA WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYEXPR WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYBIND WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYBINDLANG WHERE QRYNAME=:1", &sQueryName);
/*Below tables are not available in older PS versions*/
SQLExec("DELETE FROM PSQRYSTATS WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYEXECLOG WHERE QRYNAME=:1", &sQueryName);
SQLExec("DELETE FROM PSQRYFAVORITES WHERE QRYNAME=:1", &sQueryName);
End-Function;
0 comments:
Post a Comment