From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,93a8020cc980d113 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!sn-xt-sjc-04!sn-xt-sjc-01!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail From: Jason King Newsgroups: comp.lang.ada Subject: Re: What is wrong with Ada? Date: Sat, 14 Apr 2007 10:28:21 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <1321sobac3rfsd1@corp.supernews.com> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 References: <131pv6rmhhj51be@corp.supernews.com> <131tsgap1cbhd0c@corp.supernews.com> <1176455010.6753.12.camel@localhost.localdomain> In-Reply-To: <1176455010.6753.12.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@supernews.com Xref: g2news1.google.com comp.lang.ada:15012 Date: 2007-04-14T10:28:21-05:00 List-Id: Generally in an Oracle database (this generalization based on about 15 years experience in several industries) you find these datatypes employed. VARCHAR2 - A string datatype that has the Oracle-specific behavior that trailing spaces are ignored in comparisons, eg DECLARE x varchar2(10) := 'abc '; y varchar2(10) := 'abc'; BEGIN IF x = y THEN dbms_output.put_line('They match'); END IF; END; produces the output 'They match' on the console. That, btw, is pl/sql but I'm sure the keywords and structure look familiar to everybody in c.l.a. NUMBER(precision) -- integer NUMBER(precision,scale) -- decimal number, Oracle stores these internally in a bcd-like manner so no floating-point rounding errors occur. DATE -- actually date and time to seconds. Recent versions of Oracle have added several flavors of TIMESTAMP(precision) -- date and time to fraction of seconds e.g. DECLARE when timestamp(6); -- time to seconds/100000 In pl/sql code but not actually in the database itself you often see BOOLEAN which can have the values true, false and null, although booleans cannot be persisted as such into the database. MSSQL has a currency datatype and several flavors of numeric datatypes, but as to how common their usage is I don't know because virtually all my real database work has been against Oracle. For business applications I'd be surprised to see extensive use of REAL (esp if it maps to a c-style float or double) because of rounding issues. The decimal item that business applications are most concerned about is generally money and rounding is fatal wrt money. Recent versions of Oracle allow structured data in tables e.g. create type address_t ( -- new object type address1 varchar2(50), address2 varchar2(50), city varchar2(30), state varchar2(3), zip varchar2(9), country varchar2(3) -- we could define methods as well as members ); create table contacts ( name varchar2(50), address address_t ); Creates a table that contains an address as part of the datatype. Inside Oracle this is fairly straightforward to access, e.g. BEGIN FOR c IN (SELECT * from CONTACTS ) LOOP -- iterate through contacts table dbms_output.put_line(c.address.state) ; -- print contact's state END LOOP; END; Accessing the object from non-Oracle tools like Crystal Reports is often more difficult. Georg Bauhaus wrote: > On Thu, 2007-04-12 at 21:59 -0500, Jason King wrote: >> Work with us pl/sql people and you >> might find large sets of database developers using Ada as a middleware >> or front-end tool. > > Would Cobol style records be relevant in current database > programming? I'm asking because of Annex F, Information Systems > combined with the elaborate base types of Ada always seemed to be > a good match for an RDBMS that uses more than INT, REAL, > and CHARACTER VARYING. (Is anyone in the wild actually using > a money type or a decimal type in table definitions?) > >