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

Function exec_stmt_dynfors

src/pl/plpgsql/src/pl_exec.c:4574–4594  ·  view source on GitHub ↗

---------- * exec_stmt_dynfors Execute a dynamic 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

4572 * ----------
4573 */
4574static int
4575exec_stmt_dynfors(PLpgSQL_execstate *estate, PLpgSQL_stmt_dynfors *stmt)
4576{
4577 Portal portal;
4578 int rc;
4579
4580 portal = exec_dynquery_with_params(estate, stmt->query, stmt->params,
4581 NULL, CURSOR_OPT_NO_SCROLL);
4582
4583 /*
4584 * Execute the loop
4585 */
4586 rc = exec_for_query(estate, (PLpgSQL_stmt_forq *) stmt, portal, true);
4587
4588 /*
4589 * Close the implicit cursor
4590 */
4591 SPI_cursor_close(portal);
4592
4593 return rc;
4594}
4595
4596
4597/* ----------

Callers 1

exec_stmtsFunction · 0.85

Calls 3

exec_for_queryFunction · 0.85
SPI_cursor_closeFunction · 0.85

Tested by

no test coverage detected