| 3157 | // |
| 3158 | |
| 3159 | static void gen_request( gpre_req* request) |
| 3160 | { |
| 3161 | if (!(request->req_flags & (REQ_exp_hand | REQ_sql_blob_open | REQ_sql_blob_create)) && |
| 3162 | request->req_type != REQ_slice && request->req_type != REQ_procedure) |
| 3163 | { |
| 3164 | printa(COLUMN8, false, "01 %s PIC S9(10) %s VALUE IS 0.", |
| 3165 | request->req_handle, USAGE_BINARY4); |
| 3166 | } |
| 3167 | |
| 3168 | if (request->req_type == REQ_ready) |
| 3169 | printa(COLUMN8, false, "01 %s%dL PIC S9(5) %s VALUE IS %d.", |
| 3170 | names[isc_a_pos], request->req_ident, USAGE_BINARY2, request->req_length); |
| 3171 | |
| 3172 | // check the case where we need to extend the dpb dynamically at runtime, |
| 3173 | // in which case we need dpb length and a pointer to be defined even if |
| 3174 | // there is no static dpb defined |
| 3175 | |
| 3176 | if (request->req_flags & REQ_extend_dpb) |
| 3177 | { |
| 3178 | printa(COLUMN8, false, "01 %s%dP PIC S9(10) %s VALUE IS 0.", |
| 3179 | names[isc_a_pos], request->req_ident, USAGE_BINARY4); |
| 3180 | printa(COLUMN8, false, "01 %s%dP1 PIC S9(10) %s VALUE IS 0.", |
| 3181 | names[isc_a_pos], request->req_ident, USAGE_BINARY4); |
| 3182 | } |
| 3183 | |
| 3184 | if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create)) |
| 3185 | printa(COLUMN8, false, "01 %s%dS PIC S9(10) %s VALUE IS 0.", |
| 3186 | names[isc_a_pos], request->req_ident, USAGE_BINARY4); |
| 3187 | |
| 3188 | // generate the request as BLR long words |
| 3189 | |
| 3190 | if (request->req_length) |
| 3191 | { |
| 3192 | if (request->req_flags & REQ_sql_cursor) |
| 3193 | printa(COLUMN8, false, "01 %s%dS PIC S9(10) %s VALUE IS 0.", |
| 3194 | names[isc_a_pos], request->req_ident, USAGE_BINARY4); |
| 3195 | printa(COLUMN8, false, "01 %s%d.", names[isc_a_pos], request->req_ident); |
| 3196 | gen_raw(request->req_blr, request->req_type, request->req_length, request->req_ident); |
| 3197 | |
| 3198 | const char* string_type; |
| 3199 | if (!gpreGlob.sw_raw) |
| 3200 | { |
| 3201 | printa(names[COMMENT], false, " "); |
| 3202 | printa(names[COMMENT], false, "FORMATTED REQUEST BLR FOR %s%d = ", |
| 3203 | names[isc_a_pos], request->req_ident); |
| 3204 | |
| 3205 | switch (request->req_type) |
| 3206 | { |
| 3207 | case REQ_create_database: |
| 3208 | case REQ_ready: |
| 3209 | string_type = "DPB"; |
| 3210 | if (PRETTY_print_cdb(request->req_blr, gen_blr, 0, 0)) |
| 3211 | CPR_error("internal error during parameter generation"); |
| 3212 | break; |
| 3213 | case REQ_ddl: |
| 3214 | string_type = "DYN"; |
| 3215 | if (PRETTY_print_dyn(request->req_blr, gen_blr, 0, 0)) |
| 3216 | CPR_error("internal error during dynamic DDL generation"); |
no test coverage detected