Delete PeopleSoft Query From the Database

Your rating: None

There could be different reasons why a PeopleSoft developer would like to delete a query from the database. Upgrade clean up would probably be the most common one. Here is a function you can use to get you started.

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 availabe 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;

Of course, deleting by Query Name is not the only available option. So, feel free to modify the function to fit your needs.

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.

Re: Delete PeopleSoft Query From the Database

Guest's picture

Thanks Compshack!!

How and where do you run this function in PeopleSoft?

Re: Delete PeopleSoft Query From the Database

Posts: 302
Join date: 06/23/08
Lepa's picture

Well, that depends on what you want to do. You can use the function behind a link on a page or you can call it from an Application Engine to delete queries in batch mode.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Re: Delete PeopleSoft Query From the Database

Santis's picture

Or you can do that and much more from PeopleTools > Utilities > Administration > Query Administration

Re: Delete PeopleSoft Query From the Database

Posts: 302
Join date: 06/23/08
Lepa's picture

True if you are doing that online and not problematically. Thanks for the tip though, truly appreciate your feedback.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <div> <pre> <br> <code> <a> <em> <blockquote> <strong> <ul> <ol> <li> <dl> <dt> <b> <p> <h1> <h2> <u> <img>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>.

More information about formatting options

CAPTCHA
The question below is to prevent automated spam submissions.
8 + 8 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.