• Added NVL() to query on Data_Precision to prevent spurious errors when precision isn’t specified for a NUMBER column (closes #2, I hope!).
1 parent d377d7d commit ea373b7c55079911c249517ed5448baadf93cc26
Nigel Stanger authored on 11 Mar 2014
Showing 1 changed file
View
9
Unit_testing/Schema.php
array( ucfirst( strtolower( $this->getTableName() ) ), ucfirst( strtolower( $columnName ) ), $lengthSpec ) );
if ( $columnType === 'NUMBER' )
{
/*
Note NVL() on Data_Precision to ensure that we don't get spurious errors for NUMBER
columns with unspecified precision (=> Data_Precision is null). 38 is the maximum
precision for a NUMBER and will always be larger than the specified minimum precision
(but may be larger than any specified maximum precision). Data_Scale doesn't get the
same treatment, because it's still an error to not provide a scale when one is expected.
*/
$queryString = sprintf(
"SELECT Data_Type, Data_Precision, Data_Scale
"SELECT Data_Type, NVL( Data_Precision, 38 ), Data_Scale
FROM User_Tab_Cols
WHERE ( Table_Name = '%s' ) AND ( Column_Name = '%s' )",
strtoupper( $this->getTableName() ),
strtoupper( $columnName )