SPI\_is\_cursor\_plan

|      SPI\_is\_cursor\_plan      |                        |                         |                  |                                  |
|:-------------------------------:|------------------------|-------------------------|------------------|----------------------------------|
|[Prev](spi-spi-getargtypeid.html)|[Up](spi-interface.html)|47.1. Interface Functions|[Home](index.html)| [Next](spi-spi-execute-plan.html)|

---

[]()

## SPI\_is\_cursor\_plan

SPI\_is\_cursor\_plan — return `true` if a statement prepared by `SPI_prepare` can be used with `SPI_cursor_open`

## Synopsis

```
bool SPI_is_cursor_plan(SPIPlanPtr plan)

```

## Description

`SPI_is_cursor_plan` returns `true` if a statement prepared by `SPI_prepare` can be passed as an argument to `SPI_cursor_open`, or `false` if that is not the case. The criteria are that the *`plan`* represents one single command and that this command returns tuples to the caller; for example, `SELECT` is allowed unless it contains an `INTO` clause, and `UPDATE` is allowed only if it contains a `RETURNING` clause.

## Arguments

`SPIPlanPtr *`plan`*`

 prepared statement (returned by `SPI_prepare`)

## Return Value

`true` or `false` to indicate if the *`plan`* can produce a cursor or not, with `SPI_result` set to zero. If it is not possible to determine the answer (for example, if the *`plan`* is `NULL` or invalid, or if called when not connected to SPI), then `SPI_result` is set to a suitable error code and `false` is returned.

---

|[Prev](spi-spi-getargtypeid.html)|[Up](spi-interface.html)| [Next](spi-spi-execute-plan.html)|
|:--------------------------------|:----------------------:|---------------------------------:|
|        SPI\_getargtypeid        |   [Home](index.html)   |        SPI\_execute\_plan        |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>