| 3615 | // |
| 3616 | |
| 3617 | static act* act_insert_blob() |
| 3618 | { |
| 3619 | // Handle dynamic SQL statement, if appropriate |
| 3620 | |
| 3621 | dyn* cursor = par_dynamic_cursor(); |
| 3622 | if (cursor) |
| 3623 | { |
| 3624 | dyn* statement = (dyn*) MSC_alloc(DYN_LEN); |
| 3625 | statement->dyn_statement_name = cursor->dyn_statement_name; |
| 3626 | statement->dyn_cursor_name = cursor->dyn_cursor_name; |
| 3627 | par_using(statement); |
| 3628 | if (statement->dyn_using) |
| 3629 | PAR_error("Using host-variable list not supported."); |
| 3630 | |
| 3631 | act* action = (act*) MSC_alloc(ACT_LEN); |
| 3632 | action->act_type = ACT_dyn_insert; |
| 3633 | action->act_object = (ref*) statement; |
| 3634 | action->act_whenever = gen_whenever(); |
| 3635 | return action; |
| 3636 | } |
| 3637 | |
| 3638 | // Statement is static SQL |
| 3639 | |
| 3640 | gpre_req* request = par_cursor(NULL); |
| 3641 | if (request->req_flags & REQ_sql_blob_open) |
| 3642 | PAR_error("Inserting into a blob being opened is not allowed."); |
| 3643 | |
| 3644 | act* action = MSC_action(request, ACT_put_segment); |
| 3645 | action->act_whenever = gen_whenever(); |
| 3646 | |
| 3647 | if (!MSC_match(KW_VALUES)) |
| 3648 | CPR_s_error("VALUES"); |
| 3649 | |
| 3650 | EXP_left_paren(0); |
| 3651 | action->act_object = (ref*) SQE_variable(NULL, false, NULL, NULL); |
| 3652 | if (!action->act_object->ref_null_value) |
| 3653 | PAR_error("A segment length is required."); |
| 3654 | EXP_match_paren(); |
| 3655 | |
| 3656 | return action; |
| 3657 | } |
| 3658 | |
| 3659 | |
| 3660 | //____________________________________________________________ |
no test coverage detected