Login  Register

IF Condition

Posted by big on May 20, 2022; 3:28pm
URL: http://erman-arslan-s-oracle-forum.124.s1.nabble.com/IF-Condition-tp10924.html

Hi,
On 19c on AIX , IF condition in following bloc does not executed:

set serveroutput on
BEGIN
dbms_output.enable (1000000);
 dbms_output.put_line ( 'before ' || sys_context('USERENV','DB_NAME'));
IF $$ORACLE_SID='myCDB' THEN
execute immediate ( 'alter session set container="myPDB" ');
dbms_output.enable (1000000);
dbms_output.put_line ( 'condition ok ');
END IF;
dbms_output.enable (1000000);
 dbms_output.put_line ( 'after ' || sys_context('USERENV','DB_NAME'));
END;
/

After exection I have:
befor myCDB
after myCDB

What is wrong with my IF condition?

Thanks and regards.