| 1667 | // |
| 1668 | |
| 1669 | static void create_trigger(gpre_req* request, |
| 1670 | const act* action, |
| 1671 | gpre_trg* trigger, pfn_local_trigger_cb routine) |
| 1672 | { |
| 1673 | const gpre_rel* relation = (gpre_rel*) action->act_object; |
| 1674 | |
| 1675 | // Name of trigger to be generated |
| 1676 | |
| 1677 | put_cstring(request, isc_dyn_def_trigger, ""); |
| 1678 | |
| 1679 | put_symbol(request, isc_dyn_rel_name, relation->rel_symbol); |
| 1680 | put_numeric(request, isc_dyn_trg_type, trigger->trg_type); |
| 1681 | put_numeric(request, isc_dyn_trg_sequence, 0); |
| 1682 | put_numeric(request, isc_dyn_trg_inactive, 0); |
| 1683 | request->add_byte(isc_dyn_sql_object); |
| 1684 | |
| 1685 | if (trigger->trg_source != NULL) |
| 1686 | put_cstring(request, isc_dyn_trg_source, trigger->trg_source->str_string); |
| 1687 | |
| 1688 | if (trigger->trg_message != NULL) |
| 1689 | { |
| 1690 | put_numeric(request, isc_dyn_def_trigger_msg, 1); |
| 1691 | put_cstring(request, isc_dyn_trg_msg, trigger->trg_message->str_string); |
| 1692 | request->add_byte(isc_dyn_end); |
| 1693 | } |
| 1694 | |
| 1695 | // Generate the BLR for firing the trigger |
| 1696 | |
| 1697 | put_trigger_blr(request, isc_dyn_trg_blr, trigger->trg_boolean, routine); |
| 1698 | |
| 1699 | request->add_end(); |
| 1700 | } |
| 1701 | |
| 1702 | |
| 1703 | //____________________________________________________________ |
no test coverage detected