This file is indexed.

/usr/include/Poco/Data/ODBC/Binder.h is in libpoco-dev 1.8.0.1-1ubuntu4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
//
// Binder.h
//
// Library: Data/ODBC
// Package: ODBC
// Module:  Binder
//
// Definition of the Binder class.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier:	BSL-1.0
//


#ifndef Data_ODBC_Binder_INCLUDED
#define Data_ODBC_Binder_INCLUDED


#include "Poco/Data/ODBC/ODBC.h"
#include "Poco/Data/AbstractBinder.h"
#include "Poco/Data/LOB.h"
#include "Poco/Data/ODBC/Handle.h"
#include "Poco/Data/ODBC/Parameter.h"
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
#include "Poco/Data/ODBC/Utility.h"
#include "Poco/Data/ODBC/TypeInfo.h"
#include "Poco/Exception.h"
#include <vector>
#include <deque>
#include <list>
#include <map>
#ifdef POCO_OS_FAMILY_WINDOWS
#include <windows.h>
#endif
#include <sqlext.h>


namespace Poco {


class DateTime;


namespace Data {


class Date;
class Time;


namespace ODBC {


class ODBC_API Binder: public Poco::Data::AbstractBinder
	/// Binds placeholders in the sql query to the provided values. Performs data types mapping.
{
public:
	typedef AbstractBinder::Direction Direction;
	typedef std::map<SQLPOINTER, SQLLEN> ParamMap;

	static const size_t DEFAULT_PARAM_SIZE = 1024;

	enum ParameterBinding
	{
		PB_IMMEDIATE,
		PB_AT_EXEC
	};

	Binder(const StatementHandle& rStmt,
		std::size_t maxFieldSize,
		ParameterBinding dataBinding = PB_IMMEDIATE,
		TypeInfo* pDataTypes = 0);
		/// Creates the Binder.

	~Binder();
		/// Destroys the Binder.

	void bind(std::size_t pos, const Poco::Int8& val, Direction dir);
		/// Binds an Int8.

	void bind(std::size_t pos, const std::vector<Poco::Int8>& val, Direction dir);
		/// Binds an Int8 vector.

	void bind(std::size_t pos, const std::deque<Poco::Int8>& val, Direction dir);
		/// Binds an Int8 deque.

	void bind(std::size_t pos, const std::list<Poco::Int8>& val, Direction dir);
		/// Binds an Int8 list.

	void bind(std::size_t pos, const Poco::UInt8& val, Direction dir);
		/// Binds an UInt8.

	void bind(std::size_t pos, const std::vector<Poco::UInt8>& val, Direction dir);
		/// Binds an UInt8 vector.

	void bind(std::size_t pos, const std::deque<Poco::UInt8>& val, Direction dir);
		/// Binds an UInt8 deque.

	void bind(std::size_t pos, const std::list<Poco::UInt8>& val, Direction dir);
		/// Binds an UInt8 list.

	void bind(std::size_t pos, const Poco::Int16& val, Direction dir);
		/// Binds an Int16.
	
	void bind(std::size_t pos, const std::vector<Poco::Int16>& val, Direction dir);
		/// Binds an Int16 vector.

	void bind(std::size_t pos, const std::deque<Poco::Int16>& val, Direction dir);
		/// Binds an Int16 deque.

	void bind(std::size_t pos, const std::list<Poco::Int16>& val, Direction dir);
		/// Binds an Int16 list.

	void bind(std::size_t pos, const Poco::UInt16& val, Direction dir);
		/// Binds an UInt16.

	void bind(std::size_t pos, const std::vector<Poco::UInt16>& val, Direction dir);
		/// Binds an UInt16 vector.

	void bind(std::size_t pos, const std::deque<Poco::UInt16>& val, Direction dir);
		/// Binds an UInt16 deque.

	void bind(std::size_t pos, const std::list<Poco::UInt16>& val, Direction dir);
		/// Binds an UInt16 list.

	void bind(std::size_t pos, const Poco::Int32& val, Direction dir);
		/// Binds an Int32.

	void bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir);
		/// Binds an Int32 vector.

	void bind(std::size_t pos, const std::deque<Poco::Int32>& val, Direction dir);
		/// Binds an Int32 deque.

	void bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir);
		/// Binds an Int32 list.

	void bind(std::size_t pos, const Poco::UInt32& val, Direction dir);
		/// Binds an UInt32.

	void bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir);
		/// Binds an UInt32 vector.

	void bind(std::size_t pos, const std::deque<Poco::UInt32>& val, Direction dir);
		/// Binds an UInt32 deque.

	void bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir);
		/// Binds an UInt32 list.

	void bind(std::size_t pos, const Poco::Int64& val, Direction dir);
		/// Binds an Int64.

	void bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir);
		/// Binds an Int64 vector.

	void bind(std::size_t pos, const std::deque<Poco::Int64>& val, Direction dir);
		/// Binds an Int64 deque.

	void bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir);
		/// Binds an Int64 list.

	void bind(std::size_t pos, const Poco::UInt64& val, Direction dir);
		/// Binds an UInt64.

	void bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir);
		/// Binds an UInt64 vector.

	void bind(std::size_t pos, const std::deque<Poco::UInt64>& val, Direction dir);
		/// Binds an UInt64 deque.

	void bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir);
		/// Binds an UInt64 list.

#ifndef POCO_LONG_IS_64_BIT
	void bind(std::size_t pos, const long& val, Direction dir);
		/// Binds a long.

	void bind(std::size_t pos, const unsigned long& val, Direction dir);
		/// Binds an unsigned long.

	void bind(std::size_t pos, const std::vector<long>& val, Direction dir);
		/// Binds a long vector.

	void bind(std::size_t pos, const std::deque<long>& val, Direction dir);
		/// Binds a long deque.

	void bind(std::size_t pos, const std::list<long>& val, Direction dir);
		/// Binds a long list.
#endif

	void bind(std::size_t pos, const bool& val, Direction dir);
		/// Binds a boolean.

	void bind(std::size_t pos, const std::vector<bool>& val, Direction dir);
		/// Binds a boolean vector.

	void bind(std::size_t pos, const std::deque<bool>& val, Direction dir);
		/// Binds a boolean deque.

	void bind(std::size_t pos, const std::list<bool>& val, Direction dir);
		/// Binds a boolean list.

	void bind(std::size_t pos, const float& val, Direction dir);
		/// Binds a float.

	void bind(std::size_t pos, const std::vector<float>& val, Direction dir);
		/// Binds a float vector.

	void bind(std::size_t pos, const std::deque<float>& val, Direction dir);
		/// Binds a float deque.

	void bind(std::size_t pos, const std::list<float>& val, Direction dir);
		/// Binds a float list.

	void bind(std::size_t pos, const double& val, Direction dir);
		/// Binds a double.

	void bind(std::size_t pos, const std::vector<double>& val, Direction dir);
		/// Binds a double vector.

	void bind(std::size_t pos, const std::deque<double>& val, Direction dir);
		/// Binds a double deque.

	void bind(std::size_t pos, const std::list<double>& val, Direction dir);
		/// Binds a double list.

	void bind(std::size_t pos, const char& val, Direction dir);
		/// Binds a single character.

	void bind(std::size_t pos, const std::vector<char>& val, Direction dir);
		/// Binds a character vector.

	void bind(std::size_t pos, const std::deque<char>& val, Direction dir);
		/// Binds a character deque.

	void bind(std::size_t pos, const std::list<char>& val, Direction dir);
		/// Binds a character list.

	void bind(std::size_t pos, const std::string& val, Direction dir);
		/// Binds a string.

	void bind(std::size_t pos, const std::vector<std::string>& val, Direction dir);
		/// Binds a string vector.

	void bind(std::size_t pos, const std::deque<std::string>& val, Direction dir);
		/// Binds a string deque.

	void bind(std::size_t pos, const std::list<std::string>& val, Direction dir);
		/// Binds a string list.

	void bind(std::size_t pos, const UTF16String& val, Direction dir);
		/// Binds a string.

	void bind(std::size_t pos, const std::vector<UTF16String>& val, Direction dir);
		/// Binds a string vector.

	void bind(std::size_t pos, const std::deque<UTF16String>& val, Direction dir);
		/// Binds a string deque.

	void bind(std::size_t pos, const std::list<UTF16String>& val, Direction dir);
		/// Binds a string list.

	void bind(std::size_t pos, const BLOB& val, Direction dir);
		/// Binds a BLOB. In-bound only.

	void bind(std::size_t pos, const CLOB& val, Direction dir);
		/// Binds a CLOB. In-bound only.

	void bind(std::size_t pos, const std::vector<BLOB>& val, Direction dir);
		/// Binds a BLOB vector.

	void bind(std::size_t pos, const std::deque<BLOB>& val, Direction dir);
		/// Binds a BLOB deque.

	void bind(std::size_t pos, const std::list<BLOB>& val, Direction dir);
		/// Binds a BLOB list.

	void bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir);
		/// Binds a CLOB vector.

	void bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir);
		/// Binds a CLOB deque.

	void bind(std::size_t pos, const std::list<CLOB>& val, Direction dir);
		/// Binds a CLOB list.

	void bind(std::size_t pos, const Date& val, Direction dir);
		/// Binds a Date.

	void bind(std::size_t pos, const std::vector<Date>& val, Direction dir);
		/// Binds a Date vector.

	void bind(std::size_t pos, const std::deque<Date>& val, Direction dir);
		/// Binds a Date deque.

	void bind(std::size_t pos, const std::list<Date>& val, Direction dir);
		/// Binds a Date list.

	void bind(std::size_t pos, const Time& val, Direction dir);
		/// Binds a Time.

	void bind(std::size_t pos, const std::vector<Time>& val, Direction dir);
		/// Binds a Time vector.

	void bind(std::size_t pos, const std::deque<Time>& val, Direction dir);
		/// Binds a Time deque.

	void bind(std::size_t pos, const std::list<Time>& val, Direction dir);
		/// Binds a Time list.

	void bind(std::size_t pos, const DateTime& val, Direction dir);
		/// Binds a DateTime.

	void bind(std::size_t pos, const std::vector<DateTime>& val, Direction dir);
		/// Binds a DateTime vector.

	void bind(std::size_t pos, const std::deque<DateTime>& val, Direction dir);
		/// Binds a DateTime deque.

	void bind(std::size_t pos, const std::list<DateTime>& val, Direction dir);
		/// Binds a DateTime list.

	void bind(std::size_t pos, const NullData& val, Direction dir);
		/// Binds a null. In-bound only.

	void bind(std::size_t pos, const std::vector<NullData>& val, Direction dir);
		/// Binds a null vector.

	void bind(std::size_t pos, const std::deque<NullData>& val, Direction dir);
		/// Binds a null deque.

	void bind(std::size_t pos, const std::list<NullData>& val, Direction dir);
		/// Binds a null list.

	void setDataBinding(ParameterBinding binding);
		/// Set data binding type.

	ParameterBinding getDataBinding() const;
		/// Return data binding type.

	std::size_t parameterSize(SQLPOINTER pAddr) const;
		/// Returns bound data size for parameter at specified position.

	void synchronize();
		/// Transfers the results of non-POD outbound parameters from internal 
		/// holders back into the externally supplied buffers.

	void reset();
		/// Clears the cached storage.

private:
	typedef std::vector<SQLLEN*>                             LengthPtrVec;
	typedef std::vector<SQLLEN>                              LengthVec;
	typedef std::vector<LengthVec*>                          LengthVecVec;
	typedef std::vector<char*>                               CharPtrVec;
	typedef std::vector<UTF16Char*>                          UTF16CharPtrVec;
	typedef std::vector<bool*>                               BoolPtrVec;
	typedef std::vector<SQL_DATE_STRUCT>                     DateVec;
	typedef std::vector<DateVec*>                            DateVecVec;
	typedef std::vector<SQL_TIME_STRUCT>                     TimeVec;
	typedef std::vector<TimeVec*>                            TimeVecVec;
	typedef std::vector<SQL_TIMESTAMP_STRUCT>                DateTimeVec;
	typedef std::vector<DateTimeVec*>                        DateTimeVecVec;
	typedef std::vector<Poco::Any>                           AnyVec;
	typedef std::vector<AnyVec>                              AnyVecVec;
	typedef std::map<char*, std::string*>                    StringMap;
	typedef std::map<UTF16String::value_type*, UTF16String*> UTF16StringMap;
	typedef std::map<SQL_DATE_STRUCT*, Date*>                DateMap;
	typedef std::map<SQL_TIME_STRUCT*, Time*>                TimeMap;
	typedef std::map<SQL_TIMESTAMP_STRUCT*, DateTime*>       TimestampMap;

	void describeParameter(std::size_t pos);
		/// Sets the description field for the parameter, if needed.

	void bind(std::size_t pos, const char* const& pVal, Direction dir);
		/// Binds a const char ptr. 
		/// This is a private no-op in this implementation
		/// due to security risk.

	SQLSMALLINT toODBCDirection(Direction dir) const;
		/// Returns ODBC parameter direction based on the parameter binding direction
		/// specified by user.

	template <typename T>
	void bindImpl(std::size_t pos, T& val, SQLSMALLINT cDataType, Direction dir)
	{
		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, cDataType, colSize, decDigits);

		_lengthIndicator.push_back(0);

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			cDataType, 
			Utility::sqlDataType(cDataType), 
			colSize,
			decDigits,
			(SQLPOINTER) &val, 0, 0)))
		{
			throw StatementException(_rStmt, "SQLBindParameter()");
		}
	}

	template <typename L>
	void bindImplLOB(std::size_t pos, const L& val, Direction dir)
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("LOB parameter type can only be inbound.");

		SQLPOINTER pVal = (SQLPOINTER) val.rawContent();
		SQLINTEGER size = (SQLINTEGER) val.size();
			
		_inParams.insert(ParamMap::value_type(pVal, size));

		SQLLEN* pLenIn = new SQLLEN;
		*pLenIn  = size;

		if (PB_AT_EXEC == _paramBinding)
			*pLenIn  = SQL_LEN_DATA_AT_EXEC(size);

		_lengthIndicator.push_back(pLenIn);

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			SQL_PARAM_INPUT, 
			SQL_C_BINARY, 
			SQL_LONGVARBINARY, 
			(SQLUINTEGER) size,
			0,
			pVal,
			(SQLINTEGER) size, 
			_lengthIndicator.back())))
		{
			throw StatementException(_rStmt, "SQLBindParameter(LOB)");
		}
	}

	template <typename T>
	void bindImplVec(std::size_t pos, const std::vector<T>& val, SQLSMALLINT cDataType, Direction dir)
	{
		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("std::vector can only be bound immediately.");

		std::size_t length = val.size();
		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, cDataType, colSize, decDigits);
		setParamSetSize(length);

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length);
		}

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			cDataType, 
			Utility::sqlDataType(cDataType), 
			colSize,
			decDigits,
			(SQLPOINTER) &val[0], 
			0, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter()");
		}
	}

	template <typename C>
	void bindImplContainer(std::size_t pos, const C& val, SQLSMALLINT cDataType, Direction dir)
		/// Utility function - a "stand-in" for non-vector containers.
		/// Creates, fills and stores the reference to the replacement std::vector container
		/// for std::deque and std::list. Calls std::vector binding.
	{
		typedef typename C::value_type Type;

		if (_containers.size() <= pos)
			_containers.resize(pos + 1);

		_containers[pos].push_back(std::vector<Type>());

		std::vector<Type>& cont = RefAnyCast<std::vector<Type> >(_containers[pos].back());
		cont.assign(val.begin(), val.end());
		bindImplVec(pos, cont, cDataType, dir);
	}

	template <typename C>
	void bindImplContainerBool(std::size_t pos, const C& val, SQLSMALLINT cDataType, Direction dir)
	{
		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("std::vector can only be bound immediately.");

		std::size_t length = val.size();
		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, cDataType, colSize, decDigits);

		setParamSetSize(val.size());

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length);
		}

		if (_boolPtrs.size() <= pos)
			_boolPtrs.resize(pos + 1);

		_boolPtrs[pos] = new bool[val.size()];

		typename C::const_iterator it = val.begin();
		typename C::const_iterator end = val.end();
		for (int i = 0; it != end; ++it, ++i) _boolPtrs[pos][i] = *it;

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			cDataType, 
			Utility::sqlDataType(cDataType), 
			colSize,
			decDigits,
			(SQLPOINTER) &_boolPtrs[pos][0], 
			0, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter()");
		}
	}

	template <typename C>
	void bindImplContainerString(std::size_t pos, const C& val, Direction dir)
		/// Utility function to bind containers of strings.
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("String container parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("Containers can only be bound immediately.");

		std::size_t length = val.size();

		if (0 == length)
			throw InvalidArgumentException("Empty container not allowed.");

		setParamSetSize(length);

		SQLINTEGER size = 0;
		getColumnOrParameterSize(pos, size);
		poco_assert (size > 0);

		if (size == _maxFieldSize)
		{
			getMinValueSize(val, size);
			// accomodate for terminating zero
			if (size != _maxFieldSize) ++size;
		}

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1, SQL_NTS);
		}

		if (_charPtrs.size() <= pos)
			_charPtrs.resize(pos + 1, 0);

		_charPtrs[pos] = (char*) std::calloc(val.size() * size, sizeof(char));
		
		std::size_t strSize;
		std::size_t offset = 0;
		typename C::const_iterator it = val.begin();
		typename C::const_iterator end = val.end();
		for (; it != end; ++it)
		{
			strSize = it->size();
			if (strSize > size)	
				throw LengthExceededException("SQLBindParameter(std::vector<std::string>)");
			std::memcpy(_charPtrs[pos] + offset, it->c_str(), strSize);
			offset += size;
		}

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			SQL_C_CHAR, 
			SQL_LONGVARCHAR, 
			(SQLUINTEGER) size - 1,
			0,
			_charPtrs[pos], 
			(SQLINTEGER) size, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter(std::vector<std::string>)");
		}
	}

	template <typename C>
	void bindImplContainerUTF16String(std::size_t pos, const C& val, Direction dir)
		/// Utility function to bind containers of strings.
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("String container parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("Containers can only be bound immediately.");

		std::size_t length = val.size();
		if (0 == length)
			throw InvalidArgumentException("Empty container not allowed.");

		setParamSetSize(val.size());

		SQLINTEGER size = 0;
		getColumnOrParameterSize(pos, size);
		poco_assert(size > 0);

		if (size == _maxFieldSize)
		{
			getMinValueSize(val, size);
			// accomodate for terminating zero
			if (size != _maxFieldSize) size += sizeof(UTF16Char);
		}

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1, SQL_NTS);
		}

		if (_utf16CharPtrs.size() <= pos)
			_utf16CharPtrs.resize(pos + 1, 0);

		_utf16CharPtrs[pos] = (UTF16Char*)std::calloc(val.size() * size, sizeof(UTF16Char));

		std::size_t strSize;
		std::size_t offset = 0;
		char* pBuf = (char*)_utf16CharPtrs[pos];
		typename C::const_iterator it = val.begin();
		typename C::const_iterator end = val.end();
		for (; it != end; ++it)
		{
			strSize = it->size() * sizeof(UTF16Char);
			if (strSize > size)
				throw LengthExceededException("SQLBindParameter(std::vector<UTF16String>)");
			std::memcpy(pBuf + offset, it->data(), strSize);
			offset += size;
		}

		if (Utility::isError(SQLBindParameter(_rStmt,
			(SQLUSMALLINT)pos + 1,
			toODBCDirection(dir),
			SQL_C_WCHAR,
			SQL_WLONGVARCHAR,
			(SQLUINTEGER)size - 1,
			0,
			_utf16CharPtrs[pos],
			(SQLINTEGER)size,
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter(std::vector<UTF16String>)");
		}
	}

	template <typename C>
	void bindImplContainerLOB(std::size_t pos, const C& val, Direction dir)
	{
		typedef typename C::value_type LOBType;
		typedef typename LOBType::ValueType CharType;

		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("BLOB container parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("Containers can only be bound immediately.");

		std::size_t length = val.size();
		if (0 == length)
			throw InvalidArgumentException("Empty container not allowed.");

		setParamSetSize(length);

		SQLINTEGER size = 0;

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1);
		}

		std::vector<SQLLEN>::iterator lIt = _vecLengthIndicator[pos]->begin();
		std::vector<SQLLEN>::iterator lEnd = _vecLengthIndicator[pos]->end();
		typename C::const_iterator cIt = val.begin();
		for (; lIt != lEnd; ++lIt, ++cIt) 
		{
			SQLLEN sz = static_cast<SQLLEN>(cIt->size());
			if (sz > size) size = static_cast<SQLINTEGER>(sz);
			*lIt = sz;
		}

		if (_charPtrs.size() <= pos)
			_charPtrs.resize(pos + 1, 0);

		_charPtrs[pos] = (char*) std::calloc(val.size() * size, sizeof(CharType));
		poco_check_ptr (_charPtrs[pos]);

		std::size_t blobSize;
		std::size_t offset = 0;
		cIt = val.begin();
		typename C::const_iterator cEnd = val.end();
		for (; cIt != cEnd; ++cIt)
		{
			blobSize = cIt->size();
			if (blobSize > size)	
				throw LengthExceededException("SQLBindParameter(std::vector<BLOB>)");
			std::memcpy(_charPtrs[pos] + offset, cIt->rawContent(), blobSize * sizeof(CharType));
			offset += size;
		}

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			SQL_PARAM_INPUT, 
			SQL_C_BINARY, 
			SQL_LONGVARBINARY, 
			(SQLUINTEGER) size,
			0,
			_charPtrs[pos], 
			(SQLINTEGER) size, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter(std::vector<BLOB>)");
		}
	}

	template<typename C>
	void bindImplContainerDate(std::size_t pos, const C& val, Direction dir)
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("Date vector parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("std::vector can only be bound immediately.");

		std::size_t length = val.size();

		if (0 == length)
			throw InvalidArgumentException("Empty vector not allowed.");

		setParamSetSize(length);

		SQLINTEGER size = (SQLINTEGER) sizeof(SQL_DATE_STRUCT);

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1);
		}

		if (_dateVecVec.size() <= pos)
		{
			_dateVecVec.resize(pos + 1, 0);
			_dateVecVec[pos] = new DateVec(length ? length : 1);
		}

		Utility::dateSync(*_dateVecVec[pos], val);

		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, SQL_TYPE_DATE, colSize, decDigits);

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			SQL_C_TYPE_DATE, 
			SQL_TYPE_DATE, 
			colSize,
			decDigits,
			(SQLPOINTER) &(*_dateVecVec[pos])[0], 
			0, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter(Date[])");
		}
	}

	template<typename C>
	void bindImplContainerTime(std::size_t pos, const C& val, Direction dir)
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("Time container parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("Containers can only be bound immediately.");

		std::size_t length = val.size();
		if (0 == length)
			throw InvalidArgumentException("Empty container not allowed.");

		setParamSetSize(val.size());

		SQLINTEGER size = (SQLINTEGER) sizeof(SQL_TIME_STRUCT);

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1);
		}

		if (_timeVecVec.size() <= pos)
		{
			_timeVecVec.resize(pos + 1, 0);
			_timeVecVec[pos] = new TimeVec(length ? length : 1);
		}

		Utility::timeSync(*_timeVecVec[pos], val);

		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, SQL_TYPE_TIME, colSize, decDigits);

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			SQL_C_TYPE_TIME, 
			SQL_TYPE_TIME, 
			colSize,
			decDigits,
			(SQLPOINTER) &(*_timeVecVec[pos])[0], 
			0, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter(Time[])");
		}
	}

	template<typename C>
	void bindImplContainerDateTime(std::size_t pos, const C& val, Direction dir)
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("DateTime container parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("Containers can only be bound immediately.");

		std::size_t length = val.size();

		if (0 == length)
			throw InvalidArgumentException("Empty Containers not allowed.");

		setParamSetSize(length);

		SQLINTEGER size = (SQLINTEGER) sizeof(SQL_TIMESTAMP_STRUCT);

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1);
		}

		if (_dateTimeVecVec.size() <= pos)
		{
			_dateTimeVecVec.resize(pos + 1, 0);
			_dateTimeVecVec[pos] = new DateTimeVec(length ? length : 1);
		}

		Utility::dateTimeSync(*_dateTimeVecVec[pos], val);

		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, SQL_TYPE_TIMESTAMP, colSize, decDigits);

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			toODBCDirection(dir), 
			SQL_C_TYPE_TIMESTAMP, 
			SQL_TYPE_TIMESTAMP, 
			colSize,
			decDigits,
			(SQLPOINTER) &(*_dateTimeVecVec[pos])[0], 
			0, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter(Time[])");
		}
	}

	template<typename C>
	void bindImplNullContainer(std::size_t pos, const C& val, Direction dir)
	{
		if (isOutBound(dir) || !isInBound(dir))
			throw NotImplementedException("Null container parameter type can only be inbound.");

		if (PB_IMMEDIATE != _paramBinding)
			throw InvalidAccessException("Container can only be bound immediately.");

		std::size_t length = val.size();

		if (0 == length)
			throw InvalidArgumentException("Empty container not allowed.");

		setParamSetSize(length);

		SQLINTEGER size = SQL_NULL_DATA;

		if (_vecLengthIndicator.size() <= pos)
		{
			_vecLengthIndicator.resize(pos + 1, 0);
			_vecLengthIndicator[pos] = new LengthVec(length ? length : 1);
		}

		SQLINTEGER colSize = 0;
		SQLSMALLINT decDigits = 0;
		getColSizeAndPrecision(pos, SQL_C_STINYINT, colSize, decDigits);

		if (Utility::isError(SQLBindParameter(_rStmt, 
			(SQLUSMALLINT) pos + 1, 
			SQL_PARAM_INPUT, 
			SQL_C_STINYINT, 
			Utility::sqlDataType(SQL_C_STINYINT), 
			colSize,
			decDigits,
			0, 
			0, 
			&(*_vecLengthIndicator[pos])[0])))
		{
			throw StatementException(_rStmt, "SQLBindParameter()");
		}
	}

	void getColSizeAndPrecision(std::size_t pos, 
		SQLSMALLINT cDataType, 
		SQLINTEGER& colSize, 
		SQLSMALLINT& decDigits,
		std::size_t actualSize = 0);
		/// Used to retrieve column size and precision.
		/// Not all drivers cooperate with this inquiry under all circumstances
		/// This function runs for query and stored procedure parameters (in and 
		/// out-bound). Some drivers, however, do not care about knowing this 
		/// information to start with. For that reason, after all the attempts 
		/// to discover the required values are unsuccesfully exhausted, the values 
		/// are both set to zero and no exception is thrown.
		/// However, if the colSize is succesfully retrieved and it is greater than
		/// session-wide maximum allowed field size, LengthExceededException is thrown.

	void setParamSetSize(std::size_t length);
		/// Sets the parameter set size. Used for column-wise binding.

	void getColumnOrParameterSize(std::size_t pos, SQLINTEGER& size);
		/// Fills the column or parameter size into the 'size' argument.
		/// Does nothing if neither can be obtained from the driver, so
		/// size should be set to some default value prior to calling this 
		/// function in order to avoid undefined size value.

	void freeMemory();
		/// Frees all dynamically allocated memory resources.

	template<typename T>
	void getMinValueSize(T& val, SQLINTEGER& size)
		/// Some ODBC drivers return DB-wide maximum allowed size for variable size columns,
		/// rather than the allowed size for the actual column. In such cases, the length is 
		/// automatically resized to the maximum field size allowed by the session.
		/// This function, in order to prevent unnecessary memory allocation, does further 
		/// optimization, looking for the maximum length within supplied data container and
		/// uses the smaller of maximum found and maximum predefined data length.
	{
		typedef typename T::value_type ContainedValType;
		typedef typename ContainedValType::value_type BaseValType;
		std::size_t typeSize = sizeof(BaseValType);
		std::size_t maxSize = 0;
		typename T::const_iterator it = val.begin();
		typename T::const_iterator end = val.end();
		for (; it != end; ++it)
		{
			std::size_t sz = it->size() * typeSize;
			if (sz > _maxFieldSize)
				throw LengthExceededException();

			if (sz == _maxFieldSize)
			{
				maxSize = 0;
				break;
			}

			if (sz < _maxFieldSize && sz > maxSize)
				maxSize = sz;
		}
		if (maxSize) size = static_cast<SQLINTEGER>(maxSize);
	}

	const StatementHandle& _rStmt;

	LengthPtrVec     _lengthIndicator;
	LengthVecVec     _vecLengthIndicator;

	ParamMap         _inParams;
	ParamMap         _outParams;
	ParameterBinding _paramBinding;
	
	DateMap          _dates;
	TimeMap          _times;
	TimestampMap     _timestamps;
	StringMap        _strings;
	UTF16StringMap   _utf16Strings;

	DateVecVec       _dateVecVec;
	TimeVecVec       _timeVecVec;
	DateTimeVecVec   _dateTimeVecVec;
	CharPtrVec       _charPtrs;
	UTF16CharPtrVec  _utf16CharPtrs;
	BoolPtrVec       _boolPtrs;
	const TypeInfo*  _pTypeInfo;
	SQLINTEGER       _paramSetSize;
	std::size_t      _maxFieldSize;
	AnyVecVec        _containers;
};


//
// inlines
//
inline void Binder::bind(std::size_t pos, const Poco::Int8& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::Int8>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::Int8>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::Int8>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::UInt8& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_UTINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::UInt8>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_UTINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::UInt8>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_UTINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::UInt8>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_UTINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::Int16& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_SSHORT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::Int16>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_SSHORT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::Int16>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SSHORT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::Int16>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SSHORT, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::UInt16& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_USHORT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::UInt16>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_USHORT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::UInt16>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_USHORT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::UInt16>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_USHORT, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::Int32& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::Int32>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::UInt32& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_ULONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_ULONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::UInt32>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_ULONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_ULONG, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::Int64& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_SBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_SBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::Int64>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const Poco::UInt64& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_UBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_UBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Poco::UInt64>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_UBIGINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_UBIGINT, dir);
}


#ifndef POCO_LONG_IS_64_BIT
inline void Binder::bind(std::size_t pos, const long& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const unsigned long& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<long>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<long>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SLONG, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<long>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_SLONG, dir);
}
#endif


inline void Binder::bind(std::size_t pos, const float& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_FLOAT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<float>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_FLOAT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<float>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_FLOAT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<float>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_FLOAT, dir);
}


inline void Binder::bind(std::size_t pos, const double& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_DOUBLE, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<double>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_DOUBLE, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<double>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_DOUBLE, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<double>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_DOUBLE, dir);
}


inline void Binder::bind(std::size_t pos, const bool& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_BIT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<bool>& val, Direction dir)
{
	bindImplContainerBool(pos, val, SQL_C_BIT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<bool>& val, Direction dir)
{
	bindImplContainerBool(pos, val, SQL_C_BIT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<bool>& val, Direction dir)
{
	bindImplContainerBool(pos, val, SQL_C_BIT, dir);
}


inline void Binder::bind(std::size_t pos, const char& val, Direction dir)
{
	bindImpl(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<char>& val, Direction dir)
{
	bindImplVec(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<char>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<char>& val, Direction dir)
{
	bindImplContainer(pos, val, SQL_C_STINYINT, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<std::string>& val, Direction dir)
{
	bindImplContainerString(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<std::string>& val, Direction dir)
{
	bindImplContainerString(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<std::string>& val, Direction dir)
{
	bindImplContainerString(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<UTF16String>& val, Direction dir)
{
	bindImplContainerUTF16String(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<UTF16String>& val, Direction dir)
{
	bindImplContainerUTF16String(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<UTF16String>& val, Direction dir)
{
	bindImplContainerUTF16String(pos, val, dir);
}

inline void Binder::bind(std::size_t pos, const BLOB& val, Direction dir)
{
	bindImplLOB<BLOB>(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const CLOB& val, Direction dir)
{
	bindImplLOB<CLOB>(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<BLOB>& val, Direction dir)
{
	bindImplContainerLOB(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<BLOB>& val, Direction dir)
{
	bindImplContainerLOB(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<BLOB>& val, Direction dir)
{
	bindImplContainerLOB(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir)
{
	bindImplContainerLOB(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir)
{
	bindImplContainerLOB(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<CLOB>& val, Direction dir)
{
	bindImplContainerLOB(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Date>& val, Direction dir)
{
	bindImplContainerDate(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Date>& val, Direction dir)
{
	bindImplContainerDate(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Date>& val, Direction dir)
{
	bindImplContainerDate(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<Time>& val, Direction dir)
{
	bindImplContainerTime(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<Time>& val, Direction dir)
{
	bindImplContainerTime(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<Time>& val, Direction dir)
{
	bindImplContainerTime(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<DateTime>& val, Direction dir)
{
	bindImplContainerDateTime(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<DateTime>& val, Direction dir)
{
	bindImplContainerDateTime(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<DateTime>& val, Direction dir)
{
	bindImplContainerDateTime(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::vector<NullData>& val, Direction dir)
{
	bindImplNullContainer(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::deque<NullData>& val, Direction dir)
{
	bindImplNullContainer(pos, val, dir);
}


inline void Binder::bind(std::size_t pos, const std::list<NullData>& val, Direction dir)
{
	bindImplNullContainer(pos, val, dir);
}


inline void Binder::setDataBinding(Binder::ParameterBinding binding)
{
	_paramBinding = binding;
}


inline Binder::ParameterBinding Binder::getDataBinding() const
{
	return _paramBinding;
}


} } } // namespace Poco::Data::ODBC


#endif // Data_ODBC_Binder_INCLUDED