Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 1 Time in 1 Post

    Oracle data types (.NET 2003/Framework 1.1)

    Can anybody give me any valid reason why I should use Oracle data types in my code instead of the regular CLR data types? For the life of me I cannot see any beneifts, in fact, it seems to only serve to make the code you have to write more complicated.

    Regards,
    Kevin Bell

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Oracle data types (.NET 2003/Framework 1.1)

    Hi Kevin,

    I am not familiar with the Oracle Client for .NET, but I am quite familiar with the SQL Client. I believe the principles are about the same for using the provider-specific data types between these two, so my thoughts come with that assumption.

    If you examine the classes for the various provider-specific types in the object browser you'll see that there are quite a few more functions and properties than with the CLR data types. For instance, the System.Data.OracleClient.OracleNumber is loaded full of functionality including constants for Null, Min/Max value, Scale, Precision, etc.

    Granted, you could get most of that from the CLR data types and classes. But in a sense the provider-specific types give you a wrapper with that functionality already built-in. I believe this is actually MORE simple than using the base .NET types, especially when you factor in the ability to handle null values! Plus, there could be instances in which compatibility issues are reduced by using these types. Not to mention the fact that the overhead is negligable.

    Hope this helps.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Jeddah, Saudi Arabia
    Posts
    243
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Oracle data types (.NET 2003/Framework 1.1)

    Thanks for the post Mark. I have created a small program to just take some data from an Oracle table and perform some simple arithmetic with it using both the Oracle data types and CLR data types. I have found no particular performance gain using the oracle data types which to be honest would be the only reason I would use the Oracle types.

    I see your point about the additional functionality of the Oracle types but when such simple tasks as assigning a number to a variable become like this:

    TheOracleNumber = OracleNumber(123)

    I see no reason to expand the complexity of my programs.

    Thanks again and congratulations on the wedding.

    Regards,
    Kevin Bell

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Oracle data types (.NET 2003/Framework 1.1)

    Perhaps the definitive answer depends on how you are using the datatypes in your application. If you have created Oracle dataproviders in a data tier, then you would ordinarily use Oracle data types in that dataprovider to match the Oracle OLEDb provider.
    Charlotte

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Oracle data types (.NET 2003/Framework 1.1)

    Oracle data types allow things like empty date/time variables or nullable integers, which have not been present in the CLR variables (I heard rumours they were going to be included, it may have happenned already).

    My last site used their own user define nullable variables for the same reason.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •