Binding OTL4.0 otl_流绑定问题
我有一个关于使用otl_流绑定变量的问题。 无论我如何绑定,使用索引或命名顺序/命名都不会影响要更新的列。它似乎总是循序渐进的 您可以看到在Binding OTL4.0 otl_流绑定问题,binding,otl,Binding,Otl,我有一个关于使用otl_流绑定变量的问题。 无论我如何绑定,使用索引或命名顺序/命名都不会影响要更新的列。它似乎总是循序渐进的 您可以看到在otl\u流中列名已被切换。然而 postgres DB显示两个插入产生相同的结果 操作系统:Windows OTL:4.0 Visual Studio 2013 站台:x64 ODBC:PostgreSQL ANSI(x64)9.03.04.00 有什么想法吗? 亲切问候奥克·德克 #include <iostream> #include &l
otl\u流中
列名已被切换。然而
postgres DB显示两个插入产生相同的结果
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
using namespace std;
// #define OTL_ODBC_UNIX // uncomment this line if UnixODBC is used
#define OTL_ODBC_ALTERNATE_RPC
#if !defined(_WIN32) && !defined(_WIN64)
#define OTL_ODBC
#else
#define OTL_ODBC_POSTGRESQL // required with PG ODBC on Windows
#endif
#include "otlv4_h2\otlv4.h"
int _tmain(int argc, _TCHAR* argv[])
{
otl_connect db;
otl_connect::otl_initialize(); // initialize ODBC environment
try{
db.rlogon("Driver=PostgreSQL ANSI;Server=localhost;Database=Horus;UID=postgres;PWD=12odsc7a");
otl_cursor::direct_exec
(
db,
"drop table test_tab",
otl_exception::disabled // disable OTL exceptions
); // drop table
db.commit();
otl_cursor::direct_exec
(
db,
"create table test_tab(f1 int, f2 int)"
); // create table
db.commit();
otl_stream ostr1(1, // no buffers
"insert into test_tab values(:f1<int>,:f2<int>)",
db
);
ostr1 << 1 << 2;
db.commit();
otl_stream ostr2(1, // no buffers
"insert into test_tab values(:f2<int>,:f1<int>)",
db
);
ostr2 << 1 << 2;
db.commit();
}
catch (otl_exception& p){ // intercept OTL exceptions
cerr << p.msg << endl; // print out error message
cerr << p.stm_text << endl; // print out SQL that caused the error
cerr << p.sqlstate << endl; // print out SQLSTATE message
cerr << p.var_info << endl; // print out the variable that caused the error
}
db.logoff(); // disconnect from ODBC
return 0;
}
#包括
#包括
#包括
#包括
使用名称空间std;
//#define OTL_ODBC_UNIX//如果使用UnixODBC,则取消对此行的注释
#定义OTL\uODBC\uAlternate\uRPC
#如果!已定义(_WIN32)&&!已定义(_WIN64)
#定义OTL_ODBC
#否则
#在Windows上使用PG ODBC定义OTL_ODBC_POSTGRESQL//必需
#恩迪夫
#包括“otlv4\u h2\otlv4.h”
int _tmain(int argc,_TCHAR*argv[]
{
otl_连接数据库;
otl_connect::otl_initialize();//初始化ODBC环境
试一试{
db.rlogon(“Driver=PostgreSQL-ANSI;Server=localhost;Database=Horus;UID=postgres;PWD=12odsc7a”);
otl_游标::直接执行
(
db,
“下拉表测试选项卡”,
otl_异常::禁用//禁用otl异常
);//放下桌子
db.commit();
otl_游标::直接执行
(
db,
创建表测试选项卡(f1整数,f2整数)
);//创建表
db.commit();
otl_流OST1(1,//无缓冲区
“插入测试选项卡值(:f1,:f2)”,
分贝
);
ostr1我无法解决这个问题,因此转到了soci
问候