Re: How many pre-decimal positions/integer digits has a DECimal (5,3) defined field ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 10/09/04


Date: Sat, 9 Oct 2004 10:07:10 +0200


> Each RDBMS is exactly the same, only different. The 'only different'
> is very subtle but significant enough that a generic application can
> not swap out the back end without experienceing some negative impact -
> frequently in scalability.

This is why I prefer NUMERIC instead of DECIMAL.

Per ANSI SQL, for DECIMAL, the RDBMS is allowed you to give you a higher precision than you asked
for. NUMERIC is required to give you the precision you ask for.

In SQL Server, they are the same (they both gives you exactly what you ask for). But by using
NUMERIC, I would have a consistent behavior across products (assuming the other product adheres to
the ANSI SQL standard).

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hans" <forbrich@gmail.com> wrote in message news:bd0e88c6.0410080807.63728ec8@posting.google.com...
> peterb@gmx.net (Peter Blatt) wrote in message news:<ck4ale$n5t$00$1@news.t-online.com>...
>> Does 5 represent the total numer of digits (including the fractional portion) or only the number 
>> of places
>> BEFORE the decimal point? Moreover does the number include the decimal point?
>>
>> Are there differences between the databases servers ?
>>
>> Peter
>
>
> In Oracle, you would normally use the 'NUMBER(5,3)' declaration
> instead of 'DECIMAL(5,3)'.   It results in 5 digits being stored, with
> the decimal place implied at position 3 - resulting in 6 'printer'
> positions.
>
> In Oracle, you can also specify 'NUMBER(5,-3)' which stores 5 digits
> and puts the decimal 3 'zeros' after the last digit, giving you a
> column or variable that displays 'thousands'.
>
> Finally, in Oracle, the traditional internal representation of a
> number is BCD - Binary Coded Decimal - with 2 digits per byte, up to
> 38 digits.  Other variations, including IEEE Foating Point numerics
> are possible as well.
>
> If you need more details for the Oracle side, go to
> http://docs.oracle.com for all online documentation, and look for the
> SQL Reference Manual for the version(s) of interest.  Excrutiating
> detail is available in Chapter 1 under Datatypes.
>
> Each RDBMS is exactly the same, only different.  The 'only different'
> is very subtle but significant enough that a generic application can
> not swap out the back end without experienceing some negative impact -
> frequently in scalability.
>
> HTH
> /Hans
>
> BTW:  comp.databases.oracle is a dead newsgroup, carried by only a few
> ISPs.  The question only needs to go to comp.database.oracle.misc (one
> of the comp.databases.oracle.* heirarchy) as described in the Charter
> available at http://orafaq.com 


Relevant Pages

  • Re: Bind combobox to sql statement result in VB2005
    ... 'this is not portable to other RDBMS' ... Oracle hasn't been competitive for 5 years www.olapreport.com/market.htm ... The problem has to do with visual programming so the only code is SQL. ... The following ANSI SQL is not accepted by the TableAdapter Query Builder parser although the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Migration Database Choice
    ... If you do not need the Image wrapper that Eloquence offers than M$ SQL is an option, as well as any other RDBMS like MySQL, or Oracle, heck the list goes on an on. ... To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)
  • Re: Oracle
    ... Those things you can never expect in Oracle or any ... other RDBMS. ... Due to this I will say SQL Server is the best. ...
    (microsoft.public.sqlserver.server)
  • Re: Need help with monstrous query migrated from sql server
    ... You've seen a classic case where a SQL statement which runs on one RDBMS does not work well on another. ... This does not work as well in Oracle as it does in SQL Server. ... In order to effectively migrate an application from one RDBMS to another, the person migrating the code should be fluent in both RDBMS versions. ...
    (comp.databases.oracle.misc)
  • Re: Moderately OT: Scientific File Design
    ... From the extensive description of your data organization, it appears that this is the kind of problem that is well-suited to an RDBMS. ... All modern RDBMS packages use Structured Query Language (SQL) as an interface language to the RDBMS. ... Oracle/Rdb is very well tailored to the OpenVMS operating system and, IMHO, easier to use than the regular Oracle product. ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ...
    (comp.lang.fortran)