| 1 | // |
|---|---|
| 2 | // Parameter.cpp |
| 3 | // |
| 4 | // Library: Data/ODBC |
| 5 | // Package: ODBC |
| 6 | // Module: Parameter |
| 7 | // |
| 8 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. |
| 9 | // and Contributors. |
| 10 | // |
| 11 | // SPDX-License-Identifier: BSL-1.0 |
| 12 | // |
| 13 | |
| 14 | |
| 15 | #include "Poco/Data/ODBC/Parameter.h" |
| 16 | #include "Poco/Data/ODBC/Utility.h" |
| 17 | #include "Poco/Data/ODBC/Error.h" |
| 18 | #include "Poco/Data/ODBC/ODBCException.h" |
| 19 | |
| 20 | |
| 21 | namespace Poco { |
| 22 | namespace Data { |
| 23 | namespace ODBC { |
| 24 | |
| 25 | |
| 26 | Parameter::Parameter(const StatementHandle& rStmt, std::size_t colNum) : |
| 27 | _rStmt(rStmt), |
| 28 | _number(colNum) |
| 29 | { |
| 30 | init(); |
| 31 | } |
| 32 | |
| 33 | |
| 34 | Parameter::~Parameter() |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | |
| 39 | void Parameter::init() |
| 40 | { |
| 41 | if (Utility::isError(SQLDescribeParam(_rStmt, |
| 42 | (SQLUSMALLINT) _number + 1, |
| 43 | &_dataType, |
| 44 | &_columnSize, |
| 45 | &_decimalDigits, |
| 46 | &_isNullable))) |
| 47 | { |
| 48 | throw StatementException(_rStmt); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | |
| 53 | } } } // namespace Poco::Data::ODBC |
| 54 |