cancel
Showing results for 
Search instead for 
Did you mean: 

Default scale for DECIMAL data type may be 6 or 0.

Breck_Carter
Participant
0 Kudos
753

The current Help says "scale ... The default setting is 6."

That is not always true.

The Help should say this instead: "scale ... If precision and scale are both omitted, the default scale is 6. If precision is specified but scale is omitted, the default scale is 0."

BEGIN
DECLARE x DECIMAL ( 20 );
DECLARE y DECIMAL ( 20, 0 );
DECLARE z DECIMAL;
DECLARE a DECIMAL ( 30 );
SELECT EXPRTYPE ( 'SELECT x', 1 ), 
       EXPRTYPE ( 'SELECT y', 1 ),  
       EXPRTYPE ( 'SELECT z', 1 ),  
       EXPRTYPE ( 'SELECT a', 1 );
END;

EXPRTYPE('SELECT x',1),EXPRTYPE('SELECT y',1),EXPRTYPE('SELECT z',1),EXPRTYPE('SELECT a',1)
decimal(20,0),decimal(20,0),decimal(30,6),decimal(30,0)

Accepted Solutions (0)

Answers (0)