MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / gen_dyn_execute

Function gen_dyn_execute

src/gpre/languages/ftn.cpp:1671–1727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1669//
1670
1671static void gen_dyn_execute(const act* action)
1672{
1673 const TEXT* transaction;
1674 gpre_req* request;
1675 gpre_req req_const;
1676
1677 const dyn* statement = (const dyn*) action->act_object;
1678 if (statement->dyn_trans)
1679 {
1680 transaction = statement->dyn_trans;
1681 request = &req_const;
1682 request->req_trans = transaction;
1683 }
1684 else
1685 {
1686 transaction = "gds__trans";
1687 request = NULL;
1688 }
1689
1690 if (gpreGlob.sw_auto)
1691 {
1692 t_start_auto(request, status_vector(), action, true);
1693 printa(COLUMN, "if (%s .ne. 0) then", transaction);
1694 }
1695
1696 const TEXT* sqlda = statement->dyn_sqlda;
1697 const TEXT* sqlda2 = statement->dyn_sqlda2;
1698#ifdef HPUX
1699 TEXT s2[64], s3[64];
1700 if (sqlda)
1701 {
1702 sprintf(s2, "isc_baddress (%s)", sqlda);
1703 sqlda = s2;
1704 }
1705 if (sqlda2)
1706 {
1707 sprintf(s3, "isc_baddress (%s)", sqlda2);
1708 sqlda2 = s3;
1709 }
1710#endif
1711
1712 TEXT s1[MAX_CURSOR_SIZE];
1713 printa(COLUMN,
1714 sqlda2 ?
1715 "CALL %s (isc_status, %s, %s, %s%d%s, %s, %s)" :
1716 "CALL %s (isc_status, %s, %s, %s%d%s, %s)",
1717 sqlda2 ? ISC_EMBED_DSQL_EXECUTE2 : ISC_EMBED_DSQL_EXECUTE,
1718 transaction,
1719 make_name(s1, statement->dyn_statement_name),
1720 DSQL_I2CONST_1, gpreGlob.sw_sql_dialect, DSQL_I2CONST_2,
1721 sqlda ? sqlda : NULL_SQLDA, sqlda2 ? sqlda2 : NULL_SQLDA);
1722
1723 if (gpreGlob.sw_auto)
1724 printa(COLUMN, "END IF");
1725
1726 status_and_stop(action);
1727}
1728

Callers 1

FTN_actionFunction · 0.70

Calls 5

status_and_stopFunction · 0.85
t_start_autoFunction · 0.70
status_vectorFunction · 0.70
printaFunction · 0.70
make_nameFunction · 0.70

Tested by

no test coverage detected