MCPcopy Create free account
hub / github.com/apache/cloudberry / exec_stmt_fors

Function exec_stmt_fors

src/pl/plpgsql/src/pl_exec.c:2782–2804  ·  view source on GitHub ↗

---------- * exec_stmt_fors Execute a query, assign each * tuple to a record or row and * execute a group of statements * for it. * ---------- */

Source from the content-addressed store, hash-verified

2780 * ----------
2781 */
2782static int
2783exec_stmt_fors(PLpgSQL_execstate *estate, PLpgSQL_stmt_fors *stmt)
2784{
2785 Portal portal;
2786 int rc;
2787
2788 /*
2789 * Open the implicit cursor for the statement using exec_run_select
2790 */
2791 exec_run_select(estate, stmt->query, 0, &portal);
2792
2793 /*
2794 * Execute the loop
2795 */
2796 rc = exec_for_query(estate, (PLpgSQL_stmt_forq *) stmt, portal, true);
2797
2798 /*
2799 * Close the implicit cursor
2800 */
2801 SPI_cursor_close(portal);
2802
2803 return rc;
2804}
2805
2806
2807/* ----------

Callers 1

exec_stmtsFunction · 0.85

Calls 3

exec_run_selectFunction · 0.85
exec_for_queryFunction · 0.85
SPI_cursor_closeFunction · 0.85

Tested by

no test coverage detected