#include #include #include #include "oci.h"
static ocienv *p_env;
static ocierror *p_err;
static ocisvcctx *p_svc;
static ocistmt *p_sql;
static ocidefine *p_dfn = (ocidefine *) 0;
static ocibind *p_bnd = (ocibind *) 0;
int main()
else
printf("connection success!\n");
rc = ocihandlealloc( (dvoid *) p_env, (dvoid **) &p_sql,
oci_htype_stmt, (size_t) 0, (dvoid **) 0);
char sql = "select * from test";
rc = ocistmtprepare(p_sql, p_err, sql,
(ub4) strlen(sql) , (ub4) oci_ntv_syntax, (ub4) oci_default);
p_bvi = 10;
rc = ocidefinebypos(p_sql, &p_dfn, p_err, 1, p_sli, 1024, sqlt_str, (dvoid *) 0, (ub2 *)0,
(ub2 *)0, oci_default);
rc = ocidefinebypos(p_sql, &p_dfn, p_err, 2, p_sli2, 1024, sqlt_str, (dvoid *) 0, (ub2 *)0,
(ub2 *)0, oci_default);
rc = ocistmtexecute(p_svc, p_sql, p_err, (ub4) 1, (ub4) 0,
(const ocisnapshot *) null, (ocisnapshot *) null, oci_default);
ub4 columncount;
ociattrget((dvoid*)p_sql, (ub4)oci_htype_stmt, (dvoid*)&columncount, (ub4 *) 0, (ub4)oci_attr_param_count, p_err);
printf(" coulumcount=%d\n",columncount);
ub4 pos;
ub2 dtype;
ub2 dsize;
text *name;
ub4 name_length;
ociparam *pparam;
char realname[1024];
pos = 1;
while (ociparamget(p_sql, oci_htype_stmt, p_err, (dvoid *)&pparam, pos) == oci_success)
while (rc != oci_no_data)
rc = ocilogoff(p_svc, p_err);
rc = ocihandlefree((dvoid *) p_sql, oci_htype_stmt);
rc = ocihandlefree((dvoid *) p_svc, oci_htype_svcctx);
rc = ocihandlefree((dvoid *) p_err, oci_htype_error);
return;
}
原文: Oracle 1 安裝和解除安裝
oracle的環境 將兩個壓縮包一起解壓到電腦某個位置的同乙個資料夾 雙擊setup.exe進行安裝 這裡電子郵件可以不用填,接收安全更新勾選掉 安裝的時候選擇乙個位置,還有口令,接下來基本next就可以完成 1 開始 設定 控制面板 管理工具 服務 停止所有oracle服務。2 開始 程式 ora...
常用SQL語句(oracle)(1)
查詢表結構 select column name,data type,data length from user tab cols where table name test desc 表名 變動表 新增列 alter table table name add column name datatyp...
Oracle 1 啟動資料庫
目錄 一 連線資料庫 二 啟動資料庫 三 關閉資料庫 四 幫助 sqlplus sys password as sysdba conn user password as sysdba2.1 startup nomout mount open force resetrict pfile filenam...