---------- * exec_stmt_dynfors Execute a dynamic query, assign each * tuple to a record or row and * execute a group of statements * for it. * ---------- */
| 4572 | * ---------- |
| 4573 | */ |
| 4574 | static int |
| 4575 | exec_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 | /* ---------- |
no test coverage detected