Postgresql 中文操作指南

VAR

VAR — 定义变量

VAR — define a variable

Synopsis

VAR varname IS ctype

Description

VAR 命令为宿主变量分配新的 C 数据类型。宿主变量必须在声明部分中预先声明。

The VAR command assigns a new C data type to a host variable. The host variable must be previously declared in a declare section.

Parameters

  • varname #

    • A C variable name.

  • ctype #

    • A C type specification.

Examples

Exec sql begin declare section;
short a;
exec sql end declare section;
EXEC SQL VAR a IS int;

Compatibility

VAR 命令是 PostgreSQL 扩展。

The VAR command is a PostgreSQL extension.