@@ -1973,7 +1973,7 @@ class statement::statement_impl
1973
1973
1974
1974
describe_parameters (param_index);
1975
1975
const SQLSMALLINT& param_scale = param_descr_data_.at (param_index).scale_ ;
1976
- NANODBC_ASSERT (param_scale < static_cast <SQLULEN >(std::numeric_limits<short >::max ()));
1976
+ NANODBC_ASSERT (param_scale < static_cast <SQLSMALLINT >(std::numeric_limits<short >::max ()));
1977
1977
return static_cast <short >(param_scale);
1978
1978
}
1979
1979
@@ -1986,7 +1986,7 @@ class statement::statement_impl
1986
1986
1987
1987
describe_parameters (param_index);
1988
1988
const SQLSMALLINT& param_type = param_descr_data_.at (param_index).type_ ;
1989
- NANODBC_ASSERT (param_type < static_cast <SQLULEN >(std::numeric_limits<short >::max ()));
1989
+ NANODBC_ASSERT (param_type < static_cast <SQLSMALLINT >(std::numeric_limits<short >::max ()));
1990
1990
return static_cast <short >(param_type);
1991
1991
}
1992
1992
@@ -2902,6 +2902,48 @@ class table_valued_parameter::table_valued_parameter_impl
2902
2902
}
2903
2903
}
2904
2904
2905
+ short parameters () const { return param_descr_data_.size (); }
2906
+
2907
+ unsigned long parameter_size (short param_index)
2908
+ {
2909
+ if (param_descr_data_.count (param_index))
2910
+ {
2911
+ return static_cast <unsigned long >(param_descr_data_.at (param_index).size_ );
2912
+ }
2913
+
2914
+ prepare_tvp_param_all ();
2915
+ const SQLULEN& param_size = param_descr_data_.at (param_index).size_ ;
2916
+ NANODBC_ASSERT (
2917
+ param_size < static_cast <SQLULEN>(std::numeric_limits<unsigned long >::max ()));
2918
+ return static_cast <unsigned long >(param_size);
2919
+ }
2920
+
2921
+ short parameter_scale (short param_index)
2922
+ {
2923
+ if (param_descr_data_.count (param_index))
2924
+ {
2925
+ return static_cast <short >(param_descr_data_.at (param_index).scale_ );
2926
+ }
2927
+
2928
+ prepare_tvp_param_all ();
2929
+ const SQLSMALLINT& param_scale = param_descr_data_.at (param_index).scale_ ;
2930
+ NANODBC_ASSERT (param_scale < static_cast <SQLSMALLINT>(std::numeric_limits<short >::max ()));
2931
+ return static_cast <short >(param_scale);
2932
+ }
2933
+
2934
+ short parameter_type (short param_index)
2935
+ {
2936
+ if (param_descr_data_.count (param_index))
2937
+ {
2938
+ return static_cast <short >(param_descr_data_.at (param_index).type_ );
2939
+ }
2940
+
2941
+ prepare_tvp_param_all ();
2942
+ const SQLSMALLINT& param_type = param_descr_data_.at (param_index).type_ ;
2943
+ NANODBC_ASSERT (param_type < static_cast <SQLSMALLINT>(std::numeric_limits<short >::max ()));
2944
+ return static_cast <short >(param_type);
2945
+ }
2946
+
2905
2947
// comparator for null sentry values
2906
2948
template <class T >
2907
2949
bool equals (T const & lhs, T const & rhs)
@@ -5272,8 +5314,8 @@ NANODBC_INSTANTIATE_TVP_BIND_STRINGS(wide_string_type);
5272
5314
NANODBC_INSTANTIATE_TVP_BIND_VECTOR_STRINGS (string_type);
5273
5315
5274
5316
#ifdef NANODBC_HAS_STD_STRING_VIEW
5275
- / NANODBC_INSTANTIATE_TVP_BIND_VECTOR_STRINGS(std::string_view);
5276
- / NANODBC_INSTANTIATE_TVP_BIND_VECTOR_STRINGS(wide_string_view);
5317
+ NANODBC_INSTANTIATE_TVP_BIND_VECTOR_STRINGS (std::string_view);
5318
+ NANODBC_INSTANTIATE_TVP_BIND_VECTOR_STRINGS (wide_string_view);
5277
5319
#endif
5278
5320
5279
5321
#undef NANODBC_INSTANTIATE_TVP_BINDS
@@ -5397,6 +5439,26 @@ void table_valued_parameter::describe_parameters(
5397
5439
{
5398
5440
impl_->describe_parameters (idx, type, size, scale);
5399
5441
}
5442
+
5443
+ short table_valued_parameter::parameters () const
5444
+ {
5445
+ return impl_->parameters ();
5446
+ }
5447
+
5448
+ unsigned long table_valued_parameter::parameter_size (short param_index) const
5449
+ {
5450
+ return impl_->parameter_size (param_index);
5451
+ }
5452
+
5453
+ short table_valued_parameter::parameter_scale (short param_index) const
5454
+ {
5455
+ return impl_->parameter_scale (param_index);
5456
+ }
5457
+
5458
+ short table_valued_parameter::parameter_type (short param_index) const
5459
+ {
5460
+ return impl_->parameter_type (param_index);
5461
+ }
5400
5462
} // namespace nanodbc
5401
5463
#endif // NANODBC_DISABLE_MSSQL_TVP
5402
5464
0 commit comments