--TEST-- Test for binding output parameter of encrypted values for all types --SKIPIF-- --FILE-- 2147483647, "c2_smallint" => 32767, "c3_tinyint" => 255, "c4_bit" => 1, "c5_bigint" => '922337203685479936', "c6_decimal" => '9223372036854.80000', "c7_numeric" => '21474.83647', "c8_float" => $floatInput, "c9_real" => $realInput, "c10_date" => '9999-12-31', "c11_datetime" => '9999-12-31 23:59:59.997', "c12_datetime2" => '9999-12-31 23:59:59.9999999', "c13_datetimeoffset" => '9999-12-31 23:59:59.9999999 +14:00', "c14_time" => '23:59:59.9999999', "c15_char" => 'th, n', "c16_varchar" => 'This large row size can cause errors (such as error 512) during some normal operations, such as a clustered index key update, or sorts of the full column set, which users cannot anticipate until performing an operation.', "c17_nchar" => 'th Un', "c18_nvarchar" => 'When prefixing a string constant with the letter N, the implicit conversion will result in a Unicode string if the constant to convert does not exceed the max length for a Unicode string data type (4,000).' ); $stmt = AE\insertRow($conn, $tbname, $inputs); // Call store procedure $outSql = AE\getCallProcSqlPlaceholders($spname, count($inputs)); // Initialize all inputs, set bigint, decimal and numeric as empty strings $intOut = 0; $smallintOut = 0; $tinyintOut = 0; $bitOut = 0; $bigintOut = ''; $decimalOut = ''; $numericOut = ''; $floatOut = 0.0; $realOut = 0.0; $dateOut = ''; $datetimeOut = ''; $datetime2Out = ''; $datetimeoffsetOut = ''; $timeOut = ''; $charOut = ''; $varcharOut = ''; $ncharOut = ''; $nvarcharOut = ''; $stmt = sqlsrv_prepare($conn, $outSql, array( array( &$intOut, SQLSRV_PARAM_OUT ), array( &$smallintOut, SQLSRV_PARAM_OUT ), array( &$tinyintOut, SQLSRV_PARAM_OUT ), array( &$bitOut, SQLSRV_PARAM_OUT ), array( &$bigintOut, SQLSRV_PARAM_OUT ), array( &$decimalOut, SQLSRV_PARAM_OUT ), array( &$numericOut, SQLSRV_PARAM_OUT ), array( &$floatOut, SQLSRV_PARAM_OUT ), array( &$realOut, SQLSRV_PARAM_OUT ), array( &$dateOut, SQLSRV_PARAM_OUT ), array( &$datetimeOut, SQLSRV_PARAM_OUT ), array( &$datetime2Out, SQLSRV_PARAM_OUT ), array( &$datetimeoffsetOut, SQLSRV_PARAM_OUT ), array( &$timeOut, SQLSRV_PARAM_OUT ), array( &$charOut, SQLSRV_PARAM_OUT ), array( &$varcharOut, SQLSRV_PARAM_OUT ), array( &$ncharOut, SQLSRV_PARAM_OUT ), array( &$nvarcharOut, SQLSRV_PARAM_OUT ))); sqlsrv_execute($stmt); print("intOut: " . $intOut . "\n"); print("smallintOut: " . $smallintOut . "\n"); print("tinyintOut: " . $tinyintOut . "\n"); print("bitOut: " . $bitOut . "\n"); print("bigintOut: " . $bigintOut . "\n"); print("decimalOut: " . $decimalOut . "\n"); print("numericOut: " . $numericOut . "\n"); if (!compareFloats($floatInput, $floatOut)) { // Should not expect float values to match exactly print("Expected $floatInput but got $floatOut\n"); } if (!compareFloats($realInput, $realOut)) { // Should not expect real values to match exactly print("Expected $realInput but got $realOut\n"); } print("dateOut: " . $dateOut . "\n"); print("datetimeOut: " . $datetimeOut . "\n"); print("datetime2Out: " . $datetime2Out . "\n"); print("datetimeoffsetOut: " . $datetimeoffsetOut . "\n"); print("timeOut: " . $timeOut . "\n"); print("charOut: " . $charOut . "\n"); print("varcharOut: " . $varcharOut . "\n"); print("ncharOut: " . $ncharOut . "\n"); print("nvarcharOut: " . $nvarcharOut . "\n"); sqlsrv_query($conn, "DROP PROCEDURE $spname"); sqlsrv_query($conn, "DROP TABLE $tbname"); sqlsrv_free_stmt($stmt); sqlsrv_close($conn); ?> --EXPECTREGEX-- intOut: 2147483647 smallintOut: 32767 tinyintOut: 255 bitOut: 1 bigintOut: 922337203685479936 decimalOut: (9223372036854\.8|9223372036854\.80000) numericOut: 21474\.83647 dateOut: 9999-12-31 datetimeOut: (9999-12-31 23:59:59\.997|Dec 31 9999 11:59PM) datetime2Out: 9999-12-31 23:59:59\.9999999 datetimeoffsetOut: 9999-12-31 23:59:59\.9999999 \+14:00 timeOut: 23:59:59\.9999999 charOut: th\, n varcharOut: This large row size can cause errors \(such as error 512\) during some normal operations\, such as a clustered index key update\, or sorts of the full column set\, which users cannot anticipate until performing an operation\. ncharOut: th Un nvarcharOut: When prefixing a string constant with the letter N\, the implicit conversion will result in a Unicode string if the constant to convert does not exceed the max length for a Unicode string data type \(4,000\)\.