8 #define SOCI_FIREBIRD_SOURCE 20 if (statement_.boundByName_)
23 "Binding for use elements must be either by position or by name.");
26 position_ = position-1;
33 statement_.uses_.push_back(static_cast<void*>(
this));
35 XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_;
39 var->sqlind = &indISCHolder_;
41 statement_.boundByPos_ =
true;
45 std::string
const & name,
void * data,
48 if (statement_.boundByPos_)
51 "Binding for use elements must be either by position or by name.");
54 std::map <std::string, int> :: iterator idx =
55 statement_.names_.find(name);
57 if (idx == statement_.names_.end())
59 throw soci_error(
"Missing use element for bind by name (" + name +
")");
62 position_ = idx->second;
67 statement_.uses_.push_back(static_cast<void*>(
this));
69 XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_;
73 var->sqlind = &indISCHolder_;
75 statement_.boundByName_ =
true;
92 throw soci_error(
"Unsupported indicator value.");
99 XSQLVAR *var = statement_.sqlda2p_->sqlvar+position_;
101 if (0 != indISCHolder_)
110 to_isc<short>(data_, var);
113 to_isc<int>(data_, var);
116 to_isc<long long>(data_, var);
119 to_isc<double>(data_, var);
124 std::string *tmp =
static_cast<std::string*
>(data_);
130 static_cast<std::tm*>(data_), buf_);
136 blob *tmp =
static_cast<blob*
>(data_);
143 throw soci_error(
"Can't get Firebid BLOB BackEnd");
147 memcpy(buf_, &blob->
bid_, var->sqllen);
151 throw soci_error(
"Use element used with non-supported type.");
178 std::vector<void*>::iterator it =
179 std::find(statement_.uses_.begin(), statement_.uses_.end(),
this);
180 if (it != statement_.uses_.end())
181 statement_.uses_.erase(it);
void tmEncode(short type, std::tm *src, void *dst)
void setTextParam(char const *s, std::size_t size, char *buf_, XSQLVAR *var)
char * allocBuffer(XSQLVAR *var)
virtual void post_use(bool gotData, indicator *ind)
details::blob_backend * get_backend()
virtual void bind_by_pos(int &position, void *data, details::exchange_type type, bool readOnly)
virtual void exchangeData()
virtual void pre_use(indicator const *ind)
virtual void bind_by_name(std::string const &name, void *data, details::exchange_type type, bool readOnly)