Is it possible to do conditional compilation based on the database name within a P/SQL SELECT ?
Something like this:
begin
SELECT blah
into blah
where A=B
$IF database_name = ‘TRAINING’ $THEN
and XXX = YYY
$END IF
and mickey = mouse;
end;
I know that would do the same thing: (code not optimised, this is just an example)
and ( (select db.name from v$database db) = ‘TRAINING’ and XXX = YYY)
or (select db.name from v$database db) <> ‘TRAINING’
)
however I want to use conditional compilation to minimize the amount of regression testing and performance testing that I would need to do. The change is only applicable to one environment but has to be deployed to all environments due to our version control procedures.