From d564baf593311ca5bc62dbc401e57986bf9169ba Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 9 Aug 2009 23:46:06 +0000 Subject: - the Oracle dialect now features NUMBER which intends to act justlike Oracle's NUMBER type. It is the primary numeric type returned by table reflection and attempts to return Decimal()/float/int based on the precision/scale parameters. [ticket:885] --- lib/sqlalchemy/sql/compiler.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d6187bcde..403ec968b 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1149,6 +1149,8 @@ class GenericTypeCompiler(engine.TypeCompiler): def visit_NUMERIC(self, type_): if type_.precision is None: return "NUMERIC" + elif type_.scale is None: + return "NUMERIC(%(precision)s)" % {'precision': type_.precision} else: return "NUMERIC(%(precision)s, %(scale)s)" % {'precision': type_.precision, 'scale' : type_.scale} -- cgit v1.2.1