{"action":"opened","issue":{"url":"https://api.github.com/repos/firelab/viirs_ba/issues/7","repository_url":"https://api.github.com/repos/firelab/viirs_ba","labels_url":"https://api.github.com/repos/firelab/viirs_ba/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/firelab/viirs_ba/issues/7/comments","events_url":"https://api.github.com/repos/firelab/viirs_ba/issues/7/events","html_url":"https://github.com/firelab/viirs_ba/issues/7","id":134186179,"number":7,"title":"Selecting, then testing for existance","user":{"login":"bnordgren","id":976922,"avatar_url":"https://avatars.githubusercontent.com/u/976922?v=3","gravatar_id":"","url":"https://api.github.com/users/bnordgren","html_url":"https://github.com/bnordgren","followers_url":"https://api.github.com/users/bnordgren/followers","following_url":"https://api.github.com/users/bnordgren/following{/other_user}","gists_url":"https://api.github.com/users/bnordgren/gists{/gist_id}","starred_url":"https://api.github.com/users/bnordgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnordgren/subscriptions","organizations_url":"https://api.github.com/users/bnordgren/orgs","repos_url":"https://api.github.com/users/bnordgren/repos","events_url":"https://api.github.com/users/bnordgren/events{/privacy}","received_events_url":"https://api.github.com/users/bnordgren/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/firelab/viirs_ba/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"calbury","id":16825614,"avatar_url":"https://avatars.githubusercontent.com/u/16825614?v=3","gravatar_id":"","url":"https://api.github.com/users/calbury","html_url":"https://github.com/calbury","followers_url":"https://api.github.com/users/calbury/followers","following_url":"https://api.github.com/users/calbury/following{/other_user}","gists_url":"https://api.github.com/users/calbury/gists{/gist_id}","starred_url":"https://api.github.com/users/calbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calbury/subscriptions","organizations_url":"https://api.github.com/users/calbury/orgs","repos_url":"https://api.github.com/users/calbury/repos","events_url":"https://api.github.com/users/calbury/events{/privacy}","received_events_url":"https://api.github.com/users/calbury/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2016-02-17T05:49:13Z","updated_at":"2016-02-17T05:49:13Z","closed_at":null,"body":"in the viirs_threshold_2_fireevents method (and perhaps elsewhere) I see : \r\n\r\n    SELECT * from ... LIMIT 1 into dumrec ; \r\n    IF EXISTS (SELECT * from ... LIMIT 1) THEN\r\n        blah\r\n    END\r\n\r\nWe may be able to cut the number of select statements in half if we take the approach here: http://stackoverflow.com/questions/7163996/how-to-select-into-a-variable-in-pl-sql-when-the-result-might-be-null\r\n\r\n    BEGIN\r\n        SELECT * from ... LIMIT 1 into dumrec ; \r\n    EXCEPTION\r\n         WHEN NO_DATA_FOUND THEN \r\n            NULL ; \r\n     END;"}}