Postgresql 中文操作指南

SPI_getargtypeid

SPI_getargtypeid — 返回由 SPI_prepare 准备的语句的自变量的数据类型 OID

SPI_getargtypeid — return the data type OID for an argument of a statement prepared by SPI_prepare

Synopsis

Oid SPI_getargtypeid(SPIPlanPtr plan, int argIndex)

Description

SPI_getargtypeid 返回了一个 OID,它代表了 argIndex 号参数的类型,该参数是由 SPI_prepare 准备好的语句。第一个参数从零开始。

SPI_getargtypeid returns the OID representing the type for the argIndex'th argument of a statement prepared by SPI_prepare. First argument is at index zero.

Arguments

  • SPIPlanPtr _plan_

    • prepared statement (returned by SPI_prepare)

  • int _argIndex_

    • zero based index of the argument

Return Value

给定索引中参数的类型 OID。如果 planNULL 或无效,或 argIndex 小于 0 或不小于为 plan 声明的参数数,则将 SPI_result 设置为 SPI_ERROR_ARGUMENT 并返回 InvalidOid

The type OID of the argument at the given index. If the plan is NULL or invalid, or argIndex is less than 0 or not less than the number of arguments declared for the plan, SPI_result is set to SPI_ERROR_ARGUMENT and InvalidOid is returned.