|
14 | 14 | * |
15 | 15 | * History |
16 | 16 | * |
| 17 | + * johnkenn 06-mar-2024 - writelob with offset |
17 | 18 | * johnkenn 18-dec-2023 - Add lobstreaming to readlob |
18 | 19 | * bengsig 25-sep-2023 - fix if doublevar then |
19 | 20 | * bengsig 22-sep-2023 - ampersand needs thread local sql |
@@ -1135,6 +1136,54 @@ void *rwlcoderun ( rwl_xeqenv *xev) |
1135 | 1136 | } |
1136 | 1137 | break; |
1137 | 1138 |
|
| 1139 | + case RWL_CODE_WRITELOB_O: |
| 1140 | + { |
| 1141 | + sb4 l; |
| 1142 | + if (bit(xev->rwm->mflags, RWL_DEBUG_EXECUTE)) |
| 1143 | + rwldebug(xev->rwm, "pc=%d executing writelobo", pc); |
| 1144 | + // find the LOB |
| 1145 | + l = rwlfindvarug2(xev, xev->rwm->code[pc].ceptr1, &xev->rwm->code[pc].ceint2 |
| 1146 | + , codename); |
| 1147 | + rwlexpreval(xev->rwm->code[pc].ceptr5, &xev->rwm->code[pc].cloc, xev, &xev->xqnum2); |
| 1148 | + /*assert*/ |
| 1149 | + if (xev->evar[l].vtype != RWL_TYPE_CLOB |
| 1150 | + && xev->evar[l].vtype != RWL_TYPE_BLOB) |
| 1151 | + { |
| 1152 | + rwlexecsevere(xev, &xev->rwm->code[pc].cloc |
| 1153 | + , "[rwlcoderun-writelob:%s;%s;%d]", xev->evar[l].vname, xev->evar[l].stype, l); |
| 1154 | + } |
| 1155 | + else |
| 1156 | + { |
| 1157 | + if (xev->rwm->lobdataexpr) |
| 1158 | + { |
| 1159 | + rwlexpreval(xev->rwm->code[pc].ceptr3, &xev->rwm->code[pc].cloc, xev, &xev->xqnum); |
| 1160 | + // rwl_identifier *ri = rwlidgetmx(xev, &xev->rwm->code[pc].cloc, l); |
| 1161 | + rwlwritelobo(xev |
| 1162 | + , rwlnuminvar(xev, xev->evar+l)->vptr // the OCILob * |
| 1163 | + , xev->evar[l].vdata // the db (i.e. rwl_cinfo *) |
| 1164 | + , &xev->xqnum // the string to write |
| 1165 | + , &xev->rwm->code[pc].cloc, |
| 1166 | + (ub8) xev->xqnum2.ival, codename); |
| 1167 | + } |
| 1168 | + else |
| 1169 | + { |
| 1170 | + sb4 l2; |
| 1171 | + l2 = rwlfindvarug2(xev, xev->rwm->code[pc].ceptr3, &xev->rwm->code[pc].ceint4 |
| 1172 | + , codename); |
| 1173 | + rwl_identifier *ri = rwlidgetmx(xev, &xev->rwm->code[pc].cloc, l2); |
| 1174 | + rwlwritelobo(xev |
| 1175 | + , rwlnuminvar(xev, xev->evar+l)->vptr // the OCILob * |
| 1176 | + , xev->evar[l].vdata // the db (i.e. rwl_cinfo *) |
| 1177 | + , rwlnuminvar(xev, ri) // the string to write |
| 1178 | + , &xev->rwm->code[pc].cloc, |
| 1179 | + (ub8) xev->xqnum2.ival, codename); |
| 1180 | + rwlidrelmx(xev, &xev->rwm->code[pc].cloc, l2); |
| 1181 | + } |
| 1182 | + } |
| 1183 | + pc++; |
| 1184 | + } |
| 1185 | + break; |
| 1186 | + |
1138 | 1187 | case RWL_CODE_READLOB: |
1139 | 1188 | { |
1140 | 1189 | sb4 l, l2; |
|
0 commit comments