Skip to content

Instantly share code, notes, and snippets.

@krisrice
Created November 23, 2019 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisrice/a7ac838aecebfb0c696c860f13027578 to your computer and use it in GitHub Desktop.
Save krisrice/a7ac838aecebfb0c696c860f13027578 to your computer and use it in GitHub Desktop.
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