ObjectOriented DataBase in the SQL

  • Hi everybody.

    I wanna make an object oriented database . whether i know the SQL3 language well but i dont know how can i start it.(i wanna use inheriate relations in my database ).

    Thanks.

  • SQL Server is a relational database. You can store objects in SQL Server, but it does not provide any native support for object inheritence.

    If you need this suppoprt, then you will need to find a dedicated object-orientated database.

    Be aware that many object-orientated databases can have issues with scalability. What works well with 5 or 20 users may grind to a halt with 100 or more regardless of how much hardware you have. Most relational databases will easily scale to thousands of simultaneous users. Not all OO databases have scalability problems, but you need to choose the right one for your expected workload.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Thanks Ed,

    so i think i never can create an OO database!that's awful. can you help me more plz?what can i do now?can you prefer another software or program?:-)

  • Hi

    Could you explain more detailed why you are looking for an object oriented database? Why SQL Server?

    Flo

  • You may want to look into a database called "Cache" from Intersystems. We have a business application built upon it. It works very well within the confines of the application. However, it can be problematic to export data out of the system for other purposes.

  • hi,because it's my project. i'm not sure that the SQL SERVER is the best or not and for this i'm confuse.what do you think?do you suggest any other program or software for creating OO database?:-)

  • Dear Ed,

    Please Help me more. i can't do whatever you said beacause i wanna make a small OO database for my teacher not more. please suggest me an usefull software.

  • Why does it have to an object oriented database? If you are starting this project, I start by ask what it needs to do, not how it needs to it.

    We really can't help you at this point, as we have no idea of the requirements you are attempting to meet. Not only that, I really don't think an online forum is proper place to vet your requirements. You probably need to look at bringing some one with more experience into your project to help ensure that you are architecting the application correctly.

  • Maybe you're right but i have just one question: can i creat an object oriented and inheritance program in the SQL SERVER or not?and if you answer is positive,how can i do that?and otherwise,which software is usefull(Oracle,...)?

    i must know the answers then continue with some one else.

  • For sure you can create a object oriented application with a relational database back end. I think this is the most common way to make larger software.

    Very simplified look from object oriented side to a database:

    A table is a list of objects which are related (referenced) to other objects.

    Flo

  • Obviously you have already decided that you must have an object oriented database. SQL Server, Oracle, Informix, PostgreSQL, MySQL, are relational database management systems. They are not object oriented. If that is what you want, then as mentioned earlier in this thread, you need to look at something like Cache.

  • Hi Lynn

    Lynn Pettis (6/7/2009)


    Obviously you have already decided that you must have an object oriented database. SQL Server, Oracle, Informix, PostgreSQL, MySQL, are relational database management systems. They are not object oriented. If that is what you want, then as mentioned earlier in this thread, you need to look at something like Cache.

    Sure, if already decided to use a OO database. I think the OP just don't know how to represent a relational database in a object oriented front-end.

  • If you are asking if you can have a mapping of an OO Class to a relational table, then the answer is no.

    If you are asking if you a table column can be a complex type with methods on that type that support inheritance, then the answer is yes but is not recommended due to complexity and very poor performance under MS SQL Server, Sybase, SQL Anywhere, and Oracle. PostGres and DB2 do have support for complex data types and below is simple example of the DB2 SQL to support such a type.

    PostGres documentation on complex types can be found at http://www.postgresql.org/docs/8.2/static/sql-createtype.html

    CREATE TYPE Amt AS

    ( AmtValue DECIMAL(20,2)

    , CurrencyCd VARCHAR(3)

    )

    INSTANTIABLE MODE DB2SQL NOT FINAL

    ;

    ALTER TYPE Amt

    ADD METHOD getEuro()

    RETURNS DECIMAL(20, 2)

    LANGUAGE SQL DETERMINISTIC NO EXTERNAL ACTION READS SQL DATA

    ADD METHOD getUSDollar()

    RETURNS DECIMAL(20, 2)

    LANGUAGE SQL DETERMINISTIC NO EXTERNAL ACTION READS SQL DATA

    ;

    CREATE METHOD getEuro() FOR Amt RETURN (

    SELECT SELF.AmtValue * CurrencyExchange.exchange_rate

    FROM CurrencyExchange

    WHERE CurrencyExchange.source_CurrencyCd = SELF.CurrencyCd

    AND CurrencyExchange.target_CurrencyCd = 'EUR'

    )

    ;

    CREATE METHOD getUSDollar() FOR Amt RETURN (

    SELECT SELF.AmtValue * CurrencyExchange.exchange_rate

    FROM CurrencyExchange

    WHERE CurrencyExchange.source_CurrencyCd = SELF.CurrencyCd

    AND CurrencyExchange.target_CurrencyCd = 'USD'

    )

    ;

    CREATE FUNCTION Amt

    ( AmtValue DECIMAL(20,2)

    , CurrencyCd VARCHAR(3)

    )

    RETURN Amt

    LANGUAGE SQL DETERMINISTIC NO EXTERNAL ACTION

    RETURN CASE

    WHEN NOT EXISTS

    (SELECT 1

    FROM CurrencyExchange

    WHERE source_CurrencyCd = CurrencyCd )

    THEN (

    SELECT RAISE_ERROR('MOCUR','Invalid CurrencyCd ''' || CurrencyCd || '''')

    FROM sysibm.sysdummy1

    )

    ELSE

    Amt()..AmtValue(AmtValue)..CurrencyCd(CurrencyCd)

    END;

    SQL = Scarcely Qualifies as a Language

  • Hi Flo,

    Actually, I'm not too sure but you may be correct. The OP just seems to focused on object-oriented and inheritance for me to think that a relational databse is what is needed. In addition, the fact that this is for a teacher makes me wonder if this a school project of some sort.

    There may be others out there that could be used. I may actually have a book sitting somewhere in this mess I call my den that may have an OO database framework included. One that comes to mind is called POET. I just ran a quick Google search which returned a couple of hists, but not much information. Maybe some one else may have better luck.

  • I have no experiences with any object oriented database. Since now I was able to handle every thing in simple RDBs ;-).

    As you wrote it sounds like a school project. Maybe the OP comes from an object oriented front-end language and thinks (s)he needs a object oriented database to handle this.

    @Carl:

    Thanks for the sample! I never saw any OO style SQL syntax.

    Flo

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic. Login to reply