---
name: "SPI_getargcount"
section: "3"
platform: "linux"
package: "postgresql"
version: "18.6-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/SPI_getargcount"
---

# SPI\_getargcount(3)

return the number of arguments needed by a statement prepared by SPI\_prepare

## NAME

SPI\_getargcount - return the number of arguments needed by a statement prepared by **SPI\_prepare**

## SYNOPSIS

```
int SPI_getargcount(SPIPlanPtr plan)
```

## DESCRIPTION

**SPI\_getargcount** returns the number of arguments needed to execute a statement prepared by **SPI\_prepare**.

## ARGUMENTS

SPIPlanPtr *plan*

prepared statement (returned by **SPI\_prepare**)

## RETURN VALUE

The count of expected arguments for the *plan*. If the *plan* is NULL or invalid, *SPI\_result* is set to SPI\_ERROR\_ARGUMENT and -1 is returned.
