非常诡异的OCCI问题,linux下OK,AIX下格屁
我写了一个OCCI的程序,该程序在linux下面运行一切正常,但是同样的代码到AIX下再编译运行就出问题了.而且一次提交数量的不同,报的错也不同.
C/C++ code:
#include <iostream>
#include <occi.h>
using namespace std;
using namespace oracle::occi;
#define ARRAY_SIZE 10
int main()
{
Environment *pEnv = NULL;
Connection *pCon = NULL;
Statement *pStmt = NULL;
try
{
pEnv = Environment::createEnvironment ((Environment::Mode)(Environment::OBJECT|Environment::THREADED_UNMUTEXED));
pCon = pEnv->createConnection("xxxx", "xxxxx", "xxxxxxxx");
pStmt = pCon->createStatement("insert into table(code) values (:1);");
}
catch(SQLException &ex)
{
cout<<"Error number: "<< ex.getErrorCode() << endl;
cout<<ex.getMessage() << endl;
return -1;
}
int pServID[ARRAY_SIZE];
ub2 pLen[ARRAY_SIZE];
for(int i = 0; i < ARRAY_SIZE; ++i)
{
pServID[i] =i*2;
pLen[i] = sizeof(pServID[i]);
}
try
{
pStmt->setDataBuffer(1,pServID, OCCIINT, sizeof(int), pLen,(sb2*)NULL,(ub2*)NULL);
//ORA-32109: invalid column or parameter position
pStmt->executeArrayUpdate(ARRAY_SIZE);
pCon->commit();
相关问答:
写了个测试程序如下
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
如题,在WINDOWS底下的CODE会,但在LINUX下不知道如何实现,JS的代码应该是不一样的。 求教。
分不够再加。
http://topic.csdn.net/u/20100113/08/17ba1e71-4c33-43f6-91a5-0e031c86e5ed.html
linux ......
在ubuntu下可以很方便的使用man查看C函数的原型返回值什么的
但有一些关键字,比如time,clock,在使用man的时候就会进入shell关键字的帮助
请问如何在man time(或者其他和shell关键字有冲突的时候)使用C函数的帮 ......
我在Linux上装了Oracle数据库,其中有一个表,大约有90000条数据,用Oracle进行分页查询的时候,发现很慢
sql语句如下:
select *
from (select row_.*, rownum rownum_
from (select * ......