On 01-Jun-2011 12:50 , Luis Rodriguez wrote:
Also, Shouldn't it be (i_date NUMERIC(8, 0) ?

On Wed, Jun 1, 2011 at 2:58 PM, James Lampert wrote:

<<SNIP>>
create function @@@@@@@@@@/DISPLAYDAT(i_date NUMERIC(8))

NUMERIC(8) and NUMERIC(8, 0) are the same for a routine parameter declaration.

AFaIK the syntax diagram for the Packed and Zoned Binary Coded Decimal data types across all SQL statements for the IBM i DB2 is consistently defined such that a second argument for scale after a specified precision is optional; the scale assumed by the SQL to be zero when not specified:

<code>

.-(5,0)------------------------.
+-+-+-DECIMAL-+-+--+------------------------------+--+
| '-DEC-----' | | .-,0--------. |
'-+-NUMERIC-+-' '-(--integer--+-----------+--)-'
'-NUM-----' '-, integer-'

</code>

Note that both precision and scale are optional, as are the parentheses to denote them, whereby the SQL assumes precision of five and scale of zero.

Regards, Chuck

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].