gpt4 book ai didi

database - postgresql execParams paramTypes 是什么意思?

转载 作者:行者123 更新时间:2023-11-29 13:38:10 24 4
gpt4 key购买 nike

我正在尝试使用 execParams 使用不同的数据类型执行插入 (C++),但它一直说插入失败。我相信这是因为它将我所有的数据类型解释为文本,因为我已将 paramTypes 设置为 NULL。文档说

If parameters are used, they are referred to in the command string as $1, $2, etc. nParams is the number of parameters supplied; it is the length of the arrays paramTypes[], paramValues[], paramLengths[], and paramFormats[]. (The array pointers may be NULL when nParams is zero.) paramTypes[] specifies, by OID, the data types to be assigned to the parameter symbols.

这些 OID 到底是什么?它们是否定义为表示不同数据类型的常量?

最佳答案

参见 the description of OID for postgresql .您可以通过执行以下查询来获取类型名称和 OID 的列表:

SELECT typname, oid FROM pg_type;

另请查看 the documentation for all the columns in pg_type ,以防万一。

关于database - postgresql execParams paramTypes 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1794052/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com