CREATE OR REPLACE PROCEDURE SP_GET_CONSUMER_STATIC_SELECT
(
P_OSR_CONSUMER_KEY          OUT        VARCHAR2,
P_RESULT                    OUT       NUMBER
)
AS

-- PROCEDURE TO Fetch the static consumer key for this provider.
BEGIN
P_RESULT := 0;


 SELECT OSR_CONSUMER_KEY INTO P_OSR_CONSUMER_KEY
  FROM OAUTH_SERVER_REGISTRY
  WHERE OSR_CONSUMER_KEY LIKE 'sc-%%'
  AND OSR_USA_ID_REF IS NULL;
              

EXCEPTION
WHEN OTHERS THEN
-- CALL THE FUNCTION TO LOG ERRORS
ROLLBACK;
P_RESULT := 1; -- ERROR
END;
/
