Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dbUrl=”jdbc:postgresql://vra-01.vcloud.local:5432/vcac”;
- dbUsername=”vcac”;
- dbPassword=”VMware123!”;
- var connection = new JDBCConnection().getConnection(dbUrl, dbUsername, dbPassword);
- var query = "Select * " +
- "FROM asd_workflowrunrequest rr " +
- "WHERE rr.catalogrequestid IN( Select drr.catalogrequestid " +
- " FROM asd_workflowrunrequest drr " +
- " GROUP BY drr.catalogrequestid " +
- " HAVING COUNT(*) > 1)";
- var statement = connection.prepareStatement(query);
- var result = statement.executeQuery();
- duplicates = [];
- duplicatesInfo = "<p>id, executionstate, catalogrequestid</p>";
- duplicatesIds = [];
- var finishedStates = ["canceled", "completed", "failed"];
- while (result.next()) {
- var id = result.getString("id")
- var state = result.getString("executionstate");
- state = state ? state.toLowerCase() : null;
- var catalogrequestid = result.getString("catalogrequestid");
- // Getting only the stalled ones
- if (state && finishedStates.indexOf(state) == -1) {
- duplicatesInfo += "<p>" + id + ", " + state + ", " + catalogrequestid + "</p>";
- duplicatesIds.push(id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement