Move data from result set message to user variables.
| 170 | |
| 171 | // Move data from result set message to user variables. |
| 172 | void PreparedStatement::Builder::moveFromResultSet(thread_db* tdbb, ResultSet* rs) const |
| 173 | { |
| 174 | for (Array<OutputSlot>::const_iterator i = outputSlots.begin(); i != outputSlots.end(); ++i) |
| 175 | { |
| 176 | switch (i->type) |
| 177 | { |
| 178 | case TYPE_SSHORT: |
| 179 | *(SSHORT*) i->address = rs->getSmallInt(tdbb, i->number); |
| 180 | break; |
| 181 | |
| 182 | case TYPE_SLONG: |
| 183 | *(SLONG*) i->address = rs->getInt(tdbb, i->number); |
| 184 | break; |
| 185 | |
| 186 | case TYPE_SINT64: |
| 187 | *(SINT64*) i->address = rs->getBigInt(tdbb, i->number); |
| 188 | break; |
| 189 | |
| 190 | case TYPE_DOUBLE: |
| 191 | *(double*) i->address = rs->getDouble(tdbb, i->number); |
| 192 | break; |
| 193 | |
| 194 | case TYPE_STRING: |
| 195 | { |
| 196 | AbstractString* str = (AbstractString*) i->address; |
| 197 | str->replace(0, str->length(), rs->getString(tdbb, i->number)); |
| 198 | break; |
| 199 | } |
| 200 | |
| 201 | case TYPE_METANAME: |
| 202 | *(MetaName*) i->address = rs->getMetaName(tdbb, i->number); |
| 203 | break; |
| 204 | |
| 205 | case TYPE_METASTRING: |
| 206 | *(MetaString*) i->address = rs->getMetaString(tdbb, i->number); |
| 207 | break; |
| 208 | |
| 209 | default: |
| 210 | fb_assert(false); |
| 211 | } |
| 212 | |
| 213 | if (i->specifiedAddress && rs->isNull(i->number)) |
| 214 | *i->specifiedAddress = false; |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | |
| 219 | // Move data from user variables to the request input message. |
no test coverage detected