Skip to content

Instantly share code, notes, and snippets.

@foobarbaz-pl
Last active January 15, 2018 16:47
Show Gist options
  • Select an option

  • Save foobarbaz-pl/72b7dcd85957381108c840f10c31e155 to your computer and use it in GitHub Desktop.

Select an option

Save foobarbaz-pl/72b7dcd85957381108c840f10c31e155 to your computer and use it in GitHub Desktop.

Revisions

  1. foobarbaz-pl revised this gist Jan 15, 2018. 2 changed files with 5 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions config_ccflags.sql
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,13 @@
    declare
    l_sql varchar2(32767);
    l_variables varchar2(1000) := '';
    l_db_lt_11_2 varchar2(50) := 'FALSE';
    l_version constant number := dbms_db_version.version + (dbms_db_version.release / 10);
    l_rac varchar2(50) := 'FALSE';
    begin
    if l_version < 11.2 then
    l_db_lt_11_2 := 'TRUE';
    if dbms_utility.is_cluster_database then
    l_rac := 'TRUE';
    end if;

    l_variables := l_variables || 'DB_LT_11_2:' || l_sin_master_instance || ',';
    l_variables := l_variables || 'RAC:' || l_rac || ',';

    -- other conditional compilation flags goes here

    1 change: 1 addition & 0 deletions get_val.sql
    Original file line number Diff line number Diff line change
    @@ -9,3 +9,4 @@ begin
    -- RAC specific code goes here
    $end
    end;
    /
  2. foobarbaz-pl created this gist Jan 15, 2018.
    23 changes: 23 additions & 0 deletions config_ccflags.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    declare
    l_sql varchar2(32767);
    l_variables varchar2(1000) := '';
    l_db_lt_11_2 varchar2(50) := 'FALSE';
    l_version constant number := dbms_db_version.version + (dbms_db_version.release / 10);
    begin
    if l_version < 11.2 then
    l_db_lt_11_2 := 'TRUE';
    end if;

    l_variables := l_variables || 'DB_LT_11_2:' || l_sin_master_instance || ',';

    -- other conditional compilation flags goes here

    l_variables := rtrim(l_variables,
    ',');

    dbms_output.put_line(l_variables);

    l_sql := q'[alter session set PLSQL_CCFLAGS=']' || l_variables || q'[']';
    execute immediate l_sql;
    end;
    /
    11 changes: 11 additions & 0 deletions get_val.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    create function get_val return varchar2
    $if not dbms_db_version.ver_le_10_2 $then
    result_cache
    $end;
    as
    begin
    null;
    $if $$RAC $then
    -- RAC specific code goes here
    $end
    end;