@@ -72,17 +72,30 @@ function isEnabled() {
72
72
function getParmAttributes ( parm : SQLParm ) : string {
73
73
const lines : string [ ] = [
74
74
`Column: ${ parm . PARAMETER_NAME } ` ,
75
- `Type: ${ parm . DATA_TYPE } ` ,
75
+ `Type: ${ prepareParamType ( parm ) } ` ,
76
76
`HAS_DEFAULT: ${ parm . DEFAULT || `-` } ` ,
77
77
`IS_NULLABLE: ${ parm . IS_NULLABLE } ` ,
78
78
] ;
79
79
return lines . join ( `\n ` ) ;
80
80
}
81
81
82
+ function prepareParamType ( param : TableColumn | SQLParm ) : string {
83
+ if ( param . CHARACTER_MAXIMUM_LENGTH ) {
84
+ return `${ param . DATA_TYPE } (${ param . CHARACTER_MAXIMUM_LENGTH } )` ;
85
+ }
86
+
87
+ if ( param . NUMERIC_PRECISION !== null && param . NUMERIC_SCALE !== null ) {
88
+ return `${ param . DATA_TYPE } (${ param . NUMERIC_PRECISION } , ${ param . NUMERIC_SCALE } )` ;
89
+ }
90
+
91
+ return `${ param . DATA_TYPE } ` ;
92
+ }
93
+
94
+
82
95
function getColumnAttributes ( column : TableColumn ) : string {
83
96
const lines : string [ ] = [
84
97
`Column: ${ column . COLUMN_NAME } ` ,
85
- `Type: ${ column . DATA_TYPE } ` ,
98
+ `Type: ${ prepareParamType ( column ) } ` ,
86
99
`HAS_DEFAULT: ${ column . HAS_DEFAULT } ` ,
87
100
`IS_IDENTITY: ${ column . IS_IDENTITY } ` ,
88
101
`IS_NULLABLE: ${ column . IS_NULLABLE } ` ,
0 commit comments