您的位置:首页 >> 软件技术 >> 软件培训 >> Oracle认证 >> 正文
Oracle认证 RSS
 

Oracle常用的OCI函数下

http://www.rdxx.com 06年04月22日 23:13 考试大 我要投稿

关键词: 常用 , Oracle , OCI , 函数

Eg:单条查询 
sql: select username,age from student  where username=:p1; 
如果此字段有可能有空值,则 
hDefine = NULL; 
swResult = OCIDefineByPos(stmtp &hDefine, errhp, 1, tstd.username, sizeof(tstd.username), SQLT_CHR, & sb2aInd[0], NULL, NULL, OCI_DEFAULT); 

如果此字段没有空值,则 
hDefine = NULL; 
swResult = OCIDefineByPos(stmtp &hDefine, errhp, 1, tstd.username, sizeof(tstd.username), SQLT_CHR, NULL, NULL, NULL, OCI_DEFAULT); 
 批量查询 
select username,age from student  where age>30; 
hDefine = NULL; 
swResult = OCIDefineByPos(stmtp, &hDefine, errhp, 1, &tstd[0].username, 
sizeof(tstd[0].usenmae), SQLT_CHR, NULL, NULL, NULL, OCI_DEFAULT); 
swResult = OCIDefineArrayOfStruct(hDefine, errhp, sizeof(tstd[0]), 0, 0, 0); 
11.提取结果 
sword OCIStmtFetch ( 
OCIStmt     *stmtp,//语句句柄 
                    OCIError    *errhp, 
                    ub4         nrows, //从当前位置处开始一次提取的记录数,对于数据变量,可以>1,否则不能>1 
                    ub2         orientation,//提取的方向:OCI_FETCH_NEXT 
ub4         mode //OCI_DEFAULT 
  ) 

共4页  第1页 第2页 第3页 第4页


 
 
标签: 常用 , Oracle , OCI , 函数 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站