|
我也遇到同样的问题,按照两位搂主的方法试过了,但是好以下错误,我都弄了好几天了~在线等啊,急死我了
Action.c (42): undeclared identifier `OraDef1'
Action.c (42): type error in argument 3 to `lrdfnc_ora8_bind_col'; found `pointer to int' expected `const pointer to pointer to void'
Action.c (44): undeclared identifier `PrintRow0'
Action.c (44): type error in argument 6 to `lrdfnc_ora8_fetch'; found `int' expected `pointer to int function(const pointer to void,const unsigned long)'
c:\\documents and settings\\administrator\\\327\300\303\346\\oracle_blank\\oracle_blank\\\\combined_Oracle_blank.c (5): 4 errors, not writing pre_cci.ci
我的数据库版本orcale9i,lr版本8.1.4
代码如下:
static void FAR * OraEnv1;
static void FAR * OraSvc1;
static void FAR * OraSrv1;
static void FAR * OraSes1;
static void FAR * OraStm1;
static LRD_VAR_DESC NUM =
{LRD_VAR_DESC_EYECAT, 15, 23, LRD_DBTYPE_ORACLE, {1, 1, 0},
DT_NUMERIC};
Action()
{
unsigned long rownum;
unsigned long uliFetchedRows;
lrd_init(&InitInfo, DBTypeVersion);
lrd_initialize_db(LRD_DBTYPE_ORACLE, 2, 0);
lrd_env_init(LRD_DBTYPE_ORACLE, &OraEnv1, 0, 0);
lrd_ora8_handle_alloc(OraEnv1, SVCCTX, &OraSvc1, 0);
lrd_ora8_handle_alloc(OraEnv1, SERVER, &OraSrv1, 0);
lrd_ora8_handle_alloc(OraEnv1, SESSION, &OraSes1, 0);
lrd_server_attach(OraSrv1, "test", -1, 0, 0);
lrd_ora8_attr_set_from_handle(OraSvc1, SERVER, OraSrv1, 0, 0);
lrd_ora8_attr_set(OraSes1, USERNAME, "test", -1, 0);
lrd_ora8_attr_set(OraSes1, PASSWORD, "test12", -1, 0);
lrd_ora8_attr_set_from_handle(OraSvc1, SESSION, OraSes1, 0, 0);
lrd_session_begin(OraSvc1, OraSes1, 1, 0, 0);
lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm1,0);
//设定查询
lrd_ora8_stmt(OraStm1, "select count(*) from pb_agent_list\n", 1, 32, 0);
//执行查询
lrd_ora8_exec(OraSvc1, OraStm1, 0, 0,&rownum, 0, 0, 0, 0, 1);
lrd_ora8_bind_col(OraStm1, &OraDef1, 1, &NUM, 0, 0);
lrd_ora8_save_col (OraStm1, 1, 1, 0, "ROW");
lrd_ora8_fetch(OraStm1, -1, 15, &uliFetchedRows, PrintRow0, 2, 0, 0);
lr_output_message("value : %s", lr_eval_string("The count is: {ROW}")); |
|