Difference between revisions of "Delete Non-functional Saved Search"

From IMSMA Wiki
Jump to: navigation, search
(Created page with "If a Saved Search is not functioning it is not possible to delete it. This might feel a bit backwards but there is a very easy work-around: # edit the Saved Search until it wo...")
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
If a Saved Search is not functioning it is not possible to delete it. This might feel a bit backwards but there is a very easy work-around:
+
{{Note | Even if you edit the Saved search so it works, it is not possible to delete it if it is used as Data source for a iReport}}
 +
 
 +
If a Saved Search is not functioning it is not possible to delete it. This might feel a bit backwards but there is a very easy workaround:
 
# edit the Saved Search until it works
 
# edit the Saved Search until it works
 
# save
 
# save
Line 10: Line 12:
 
# Press Ctrl+A and then Ctrl+C
 
# Press Ctrl+A and then Ctrl+C
 
# Copy to Navicat or Word
 
# Copy to Navicat or Word
# Edit the SQL statement to something that works with PostGreSQL
+
# Edit the SQL statement to something that works with PostgreSQL
 
# Copy and paste into the SQL field
 
# Copy and paste into the SQL field
 
# Save
 
# Save
Line 43: Line 45:
 
hazreduc
 
hazreduc
 
</pre>
 
</pre>
 +
{{NavBox Technical Notes}}
 +
 
[[Category:NAA]]
 
[[Category:NAA]]

Latest revision as of 21:52, 5 April 2015

Note.jpg Even if you edit the Saved search so it works, it is not possible to delete it if it is used as Data source for a iReport

If a Saved Search is not functioning it is not possible to delete it. This might feel a bit backwards but there is a very easy workaround:

  1. edit the Saved Search until it works
  2. save
  3. delete.

After upgrading IMSMANG to V6.0 there might be Saved searches that do not work, especially if they use SQL.

  1. Edit the Saved search
  2. Click in the SQL field
  3. Press Ctrl+A and then Ctrl+C
  4. Copy to Navicat or Word
  5. Edit the SQL statement to something that works with PostgreSQL
  6. Copy and paste into the SQL field
  7. Save
  8. Now it is possible to delete. Note that the query will be executed in the background so if the edited SQL returns many rows it will take a few seconds to delete.

Example non-working SQL statement

SELECT
	hazreduc.hazreduc_guid
FROM
	hazreduc
INNER JOIN (
	SELECT
		b.hazreduc_localid,
		COUNT (b.hazreduc_localid) AS 'No'
	FROM
		hazreduc b
	GROUP BY
		b.hazreduc_localid
) b ON hazreduc.hazreduc_localid = b.hazreduc_localid
WHERE
	b. NO > 1
ORDER BY
	hazreduc.hazreduc_localid

Example of edited SQL statement

SELECT
	hazreduc_guid
FROM
	hazreduc