PostgreSQL 18 中文参考文档(未翻译部分保留英文)🌐 切换到英文原版 →

VAR

VAR — define a variable

Synopsis

VAR varname IS ctype

描述

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

参数

varname #

A C variable name.

ctype #

A C type specification.

示例

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

兼容性

The VAR command is a PostgreSQL extension.