Reputation: 415
We use local XEs for rapid development, but deploy on "real" Oracles. Some of our scripts use partitioning and bitmap indexes and we'd like to skip those parts for XE, as they're not supported, but without having a separate set of scripts. Is there any SQL we can use to detect that a script is being run on XE so that we can adjust the statements?
Upvotes: 1
Views: 2790
Reputation: 8339
I've run into the same problem. My solution has been to embed these version specific features in anonymous blocks and test for specific error codes. Something like this :
BEGIN
EXECUTE IMMEDIATE 'CREATE BITMAP INDEX myIndex ON myTable';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE=-439 THEN -- bitmap index not supported
EXECUTE IMMEDIATE 'CREATE INDEX myIndex ON myTable';
END IF;
END;
Not exactly what you asked for, but it's been working very well for me.
Upvotes: 1