Created
November 23, 2019 12:37
-
-
Save krisrice/a7ac838aecebfb0c696c860f13027578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set serveroutput on | |
CREATE OR REPLACE PROCEDURE is_adb AS | |
BEGIN | |
$IF $$is_autonomous $THEN | |
dbms_output.put_line('Yup'); | |
$ELSE | |
dbms_output.put_line('No'); | |
$END | |
END is_adb; | |
/ | |
declare | |
p_service varchar2(200); | |
begin | |
SELECT SYS_CONTEXT ('USERENV', 'SERVICE_NAME') | |
into p_service | |
FROM DUAL; | |
if ( p_service like '%.adwc.oraclecloud.com' ) then | |
execute immediate 'ALTER PROCEDURE is_adb COMPILE PLSQL_CCFLAGS = ''is_autonomous:TRUE'' REUSE SETTINGS'; | |
end if; | |
end; | |
/ | |
begin | |
is_adb(); | |
end; | |
/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment