?? single.c
字號:
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <math.h>#include <pthread.h>#include "dbfunc.h"#define MODULE_NAME "SINGLE"static char connect[20]="dbuser/oracle";void Func();int main(){ Func(); exit(0);} void Func(){ int result; emp_t emp; if((result=DbsConnect(connect))!=DB_OK) { printf("connect fail, sqlcode:%d\n", result); goto FUNC_END; } emp.no=0; result=DbsEMP_UPD_Info(&emp); if(result!=DB_OK && result!=DB_NOTFOUND) { printf("database error, sqlcode:%d\n", result); DbsRollback(); goto FUNC_END; } if(result==DB_NOTFOUND) { printf("not found\n"); goto FUNC_END; } DbsCommit(); emp.no=0; result=DbsEMP_SEL_Info(&emp); if(result!=DB_OK && result!=DB_NOTFOUND) { printf("database error, sqlcode:%d\n", result); goto FUNC_END; } if(result==DB_NOTFOUND) { printf("not found\n"); goto FUNC_END; } printf("no:%012.0lf name:%s, update time:%s\n", emp.no, emp.name, emp.upd_ts); FUNC_END: DbsDisconn(); return;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -