Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
1456c5b5
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1456c5b5
编写于
11月 10, 2006
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve formatting of PQexecParams argument descriptions, per
Theo Kramer.
上级
2c2faa17
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
103 addition
and
28 deletion
+103
-28
doc/src/sgml/libpq.sgml
doc/src/sgml/libpq.sgml
+103
-28
未找到文件。
doc/src/sgml/libpq.sgml
浏览文件 @
1456c5b5
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.2
19 2006/10/23 18:10:31 petere
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.2
20 2006/11/10 22:15:26 tgl
Exp $ -->
<chapter id="libpq">
<title><application>libpq</application> - C Library</title>
...
...
@@ -956,7 +956,7 @@ Applications may use this to determine the version of the database server they
are connected to. The number is formed by converting the major, minor, and
revision numbers into two-decimal-digit numbers and appending them
together. For example, version 8.1.5 will be returned as 80105, and version
8.
1 will be returned as 801
00 (leading zeroes are not shown). Zero is
8.
2 will be returned as 802
00 (leading zeroes are not shown). Zero is
returned if the connection is bad.
</para>
</listitem>
...
...
@@ -1138,41 +1138,116 @@ connections; it will fail when using protocol 2.0.
</para>
<para>
If parameters are used, they are referred to in the command string
as <literal>$1</>, <literal>$2</>, etc.
<parameter>nParams</> is the number of parameters supplied; it is the length
of the arrays <parameter>paramTypes[]</>, <parameter>paramValues[]</>,
<parameter>paramLengths[]</>, and <parameter>paramFormats[]</>. (The
array pointers may be <symbol>NULL</symbol> when <parameter>nParams</> is zero.)
<parameter>paramTypes[]</> specifies, by OID, the data types to be assigned to
the parameter symbols. If <parameter>paramTypes</> is <symbol>NULL</symbol>, or any particular
element in the array is zero, the server assigns a data type to the parameter
symbol in the same way it would do for an untyped literal string.
<parameter>paramValues[]</> specifies the actual values of the parameters.
A null pointer in this array means the corresponding parameter is null;
otherwise the pointer points to a zero-terminated text string (for text
format) or binary data in the format expected by the server (for binary
format).
<parameter>paramLengths[]</> specifies the actual data lengths of
binary-format parameters. It is ignored for null parameters and text-format
parameters. The array pointer may be null when there are no binary
parameters.
<parameter>paramFormats[]</> specifies whether parameters are text (put a zero
in the array) or binary (put a one in the array). If the array pointer is
null then all parameters are presumed to be text.
<parameter>resultFormat</> is zero to obtain results in text format, or one to
obtain results in binary format. (There is not currently a provision to
obtain different result columns in different formats, although that is
possible in the underlying protocol.)
The function arguments are:
<variablelist>
<varlistentry>
<term><parameter>conn</parameter></term>
<listitem>
<para>
The connection object to send the command through.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>command</parameter></term>
<listitem>
<para>
The SQL command string to be executed. If parameters are used, they are
referred to in the command string as <literal>$1</>, <literal>$2</>,
etc.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>nParams</parameter></term>
<listitem>
<para>
The number of parameters supplied; it is the length of the arrays
<parameter>paramTypes[]</>, <parameter>paramValues[]</>,
<parameter>paramLengths[]</>, and <parameter>paramFormats[]</>. (The
array pointers may be <symbol>NULL</symbol> when <parameter>nParams</>
is zero.)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>paramTypes[]</parameter></term>
<listitem>
<para>
Specifies, by OID, the data types to be assigned to the parameter
symbols. If <parameter>paramTypes</> is <symbol>NULL</symbol>, or any
particular element in the array is zero, the server infers a data type
for the parameter symbol in the same way it would do for an untyped
literal string.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>paramValues[]</parameter></term>
<listitem>
<para>
Specifies the actual values of the parameters.
A null pointer in this array means the corresponding parameter is null;
otherwise the pointer points to a zero-terminated text string (for text
format) or binary data in the format expected by the server (for binary
format).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>paramLengths[]</parameter></term>
<listitem>
<para>
Specifies the actual data lengths of binary-format parameters.
It is ignored for null parameters and text-format parameters.
The array pointer may be null when there are no binary parameters.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>paramFormats[]</parameter></term>
<listitem>
<para>
Specifies whether parameters are text (put a zero in the array entry for
the corresponding parameter) or binary (put a one in the array entry for
the corresponding parameter). If the array pointer is null then all
parameters are presumed to be text strings.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>resultFormat</parameter></term>
<listitem>
<para>
Specify zero to obtain results in text format, or one to obtain results
in binary format. (There is not currently a provision to obtain
different result columns in different formats, although that is
possible in the underlying protocol.)
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
The primary advantage of <function>PQexecParams</> over <function>PQexec</>
is that parameter values may be separated from the command string, thus
avoiding the need for tedious and error-prone quoting and escaping.
</para>
<para>
Unlike <function>PQexec</>, <function>PQexecParams</> allows at most one SQL
command in the given string. (There can be semicolons in it, but not more
than one nonempty command.) This is a limitation of the underlying protocol,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录