oci 乙個里程碑

2021-04-23 02:07:42 字數 2049 閱讀 4546

#include   "stdlib.h"  

#include   "ocidfn.h"  

#include   "ocidem.h"  

#include   "oratypes.h"  

#include   "ocidem.h"  

#include   "ociapr.h"  

#include   "ocikpr.h"  

#include   "oci.h"  

#include  

#include  

char   user[31];  

char   pass_word[31];  

char   servername[31];  

char*  sqlstat   =   "select  out_date,rownum    from   kt_card_sign_file t where  rownum<10";  

ocienv    *envhp   =   null; //環境控制代碼  

ocierror  *errhp   =   null; //錯誤控制代碼  

ociserver *srvhp   =   null; //伺服器控制代碼  

ocisvcctx *svchp   =   null; //服務環境控制代碼  

sword     status;  

void   error_proc(dvoid   *errhp,   sword   status)  

}  

int envinit()

void   main   ()  

//申請語句控制代碼  

error_proc(errhp, ocihandlealloc((dvoid *)envhp, (dvoid **)&stmthp, oci_htype_stmt,0,0));  

//準備sql語句  

error_proc(errhp,ocistmtprepare(stmthp,errhp,reinterpret_cast(sqlstat),  

(ub4)strlen((char *)sqlstat),oci_ntv_syntax,oci_default));  

//執行sql語句  

if   ((status=ocistmtexecute(svchp,stmthp,errhp,(ub4)0,  

(ub4)0,(const ocisnapshot *)null, (ocisnapshot *)null,oci_default)) && status != oci_success_with_info)  

//得到字段引數

error_proc(errhp, ociparamget(stmthp,oci_htype_stmt, errhp,  (dvoid **)&mypard, (ub4) 1));

//得到字段屬性(資料長度,資料型別等)

error_proc(errhp, ociattrget((dvoid*) mypard, (ub4) oci_dtype_param,

(dvoid*) &datelen, (ub4 *) 0, (ub4) oci_attr_data_size,

(ocierror *) errhp  ));

date = (text *) malloc((int) datelen + 1);

//設定輸出變數

error_proc(errhp,ocidefinebypos(stmthp, &defhp, errhp,1, (ub1 *) date, datelen+1,sqlt_chr, (dvoid *) 0,

0,(ub2 *) 0, oci_default));

//遍歷resultset

while(ocistmtfetch(stmthp,errhp,1, oci_fetch_next, oci_default) !=oci_no_data )

//斷開連線  

error_proc(errhp,ocilogoff(svchp,errhp));  

return;  

}  

算是個里程碑吧

從08年5月28日正式來到天正這家公司.第一天就趕上,專案立項會.29日,到浦發的資料中心,寫了一天,eds需求.30日 周五 就請假,拿勞動手冊去了.6月2日 開始正式寫需求.6月3日 我負責的兩個模組,在和甲方開會的時候都被砍了.是模組本身問題.開會的時候我都還沒來得及解說,就定了.確定新的模組...

中文銳推榜的乙個里程碑

鄭昀 玩聚rt 20090618 今天,terryxxy 發訊息 恭喜 rtmeme follower 上2000 fw zhengyun 是的,玩聚中文銳推榜的twitter訊息發布機械人 rtmeme 的訂閱人數超過了2000人。我期望 rtmeme 能成為欲 微部落格有趣之處的新使用者必 fo...

中文銳推榜的乙個里程碑

鄭昀 玩聚rt 20090618 今天,terryxxy 發訊息 恭喜 rtmeme follower 上2000 fw zhengyun 是的,玩聚中文銳推榜的twitter訊息發布機械人 rtmeme 的訂閱人數超過了2000人。我期望 rtmeme 能成為欲 微部落格有趣之處的新使用者必 fo...