Home » SQL & PL/SQL » SQL & PL/SQL » Conditional Compilation?
Conditional Compilation? [message #259233] Tue, 14 August 2007 15:38 Go to next message
zzasteven
Messages: 18
Registered: August 2007
Junior Member
is there a way to tell between versions of oracle using Conditional Compilation? For example can i put in Conditional Compilation that will tell if i am on EE or SE? i know you can use dbms_db_version to tell the version...
Re: Conditional Compilation? [message #259240 is a reply to message #259233] Tue, 14 August 2007 15:59 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
It sure doesn't look like it - not even in 11g:

PACKAGE DBMS_DB_VERSION IS
   VERSION CONSTANT PLS_INTEGER := 11; -- RDBMS version number
   RELEASE CONSTANT PLS_INTEGER := 1;  -- RDBMS release number
   ver_le_9_1    CONSTANT BOOLEAN := FALSE;
   ver_le_9_2    CONSTANT BOOLEAN := FALSE;
   ver_le_9      CONSTANT BOOLEAN := FALSE;
   ver_le_10_1   CONSTANT BOOLEAN := FALSE;
   ver_le_10_2   CONSTANT BOOLEAN := FALSE;
   ver_le_10     CONSTANT BOOLEAN := FALSE;
   ver_le_11_1   CONSTANT BOOLEAN := TRUE;
   ver_le_11     CONSTANT BOOLEAN := TRUE;
END DBMS_DB_VERSION;
Re: Conditional Compilation? [message #259332 is a reply to message #259233] Wed, 15 August 2007 01:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No.
Precise what is your problem maybe we can solve it in another way.

Regards
Michel
Re: Conditional Compilation? [message #259362 is a reply to message #259332] Wed, 15 August 2007 04:40 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You can look in v$version:
select case when upper(banner) like '%ENTERPRISE%' then 'ENTERPRISE'
            else 'STANDARD' end version
from v$version
where upper(banner) like 'ORACLE DATABASE%'
Re: Conditional Compilation? [message #259386 is a reply to message #259362] Wed, 15 August 2007 07:50 Go to previous messageGo to next message
zzasteven
Messages: 18
Registered: August 2007
Junior Member
this will work.. thanks
Re: Conditional Compilation? [message #259388 is a reply to message #259386] Wed, 15 August 2007 08:09 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
May I ask why you need to know if it is EE or SE?

Regards
Michel
Re: Conditional Compilation? [message #259429 is a reply to message #259388] Wed, 15 August 2007 10:46 Go to previous messageGo to next message
zzasteven
Messages: 18
Registered: August 2007
Junior Member
Our software works different if they use EE or SE.. Our large clients use EE the small ones use SE..
Re: Conditional Compilation? [message #259444 is a reply to message #259429] Wed, 15 August 2007 11:23 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
My question is: what are the points that need to make a difference in code between EE and SE?
In which cases you code it is EE I do this, it is SE I do that?
Can you post an example?

Regards
Michel
Re: Conditional Compilation? [message #259697 is a reply to message #259444] Thu, 16 August 2007 05:00 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Parallel query processing and partitioning are the only two that leap to mine, although a lot of EE places don't but the partitioning option.
Re: Conditional Compilation? [message #259712 is a reply to message #259697] Thu, 16 August 2007 05:30 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
How can this change the code?

Regards
Michel
Re: Conditional Compilation? [message #259722 is a reply to message #259712] Thu, 16 August 2007 05:58 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
You'd need different queries if some of your clients used table A without partitioning and some of them used a partitioned version of it.

I'm reaching a bit here.
Re: Conditional Compilation? [message #259749 is a reply to message #259722] Thu, 16 August 2007 06:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Still don't see why you need different queries.
Optimizer is there to make the difference.

Regards
Michel
Re: Conditional Compilation? [message #259757 is a reply to message #259749] Thu, 16 August 2007 07:07 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I believe you can specify which partitions you wish to search in.
Link

If the OP ever bothers to reply, I reckon we'll find that they condition some of their product features on whether the user has SE or EE, or something equally poor practice like that.
Previous Topic: Pivot Query
Next Topic: DBMS_LOB problem
Goto Forum:
  


Current Time: Fri Dec 02 16:35:02 CST 2016

Total time taken to generate the page: 0.34664 seconds