Informix 數(shù)據(jù)庫函數(shù)庫(一)ifx_connect ifx_connect 打開 Informix 服務(wù)器連接。 語法: int ifx_connect(string [database], string [userid], string [password]); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)建立與 Informix 服務(wù)器的連接。其中所有的參數(shù)都可省略。若全部參數(shù)都省略時,使用系統(tǒng)的 php3.ini 或是 php.ini (視 PHP 版本決定) 中 ifx.default_host 指定的機(jī)器,或是環(huán)境變量 $INFORMIXSERVER;ifx.default_user 為用戶賬號;ifx.default_password 為用戶密碼。而參數(shù) database、userid 及 password 分別為數(shù)據(jù)庫的名字、登入賬號及使用密碼。當(dāng)然,在使用本函數(shù)之后,盡早使用 ifx_close() 關(guān)閉 Informix 數(shù)據(jù)庫比較好。連接成功則返回連接代碼,失敗則返回 false 值。 使用范例 本例只有連上數(shù)據(jù)庫,什么事都沒做。 $conn_id = ifx_pconnect("mydb@ol_srv1", "imyself", "mypassword"); ifx_close($conn_id); ?> 參考 ifx_pconnect() ifx_close()
Informix 數(shù)據(jù)庫函數(shù)庫(二)ifx_pconnect Informix 數(shù)據(jù)庫函數(shù)庫 ifx_pconnect 打開 Informix 服務(wù)器持續(xù)連接。 語法: int ifx_pconnect(string [database], string [userid], string [password]); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)與 ifx_connect() 很類似。不同的地方在于使用本函數(shù)打開數(shù)據(jù)庫時,程序會先尋找是否曾經(jīng)執(zhí)行過本函數(shù),若執(zhí)行過則返回先前執(zhí)行的 ID。另一個不同的地方是本函數(shù)無法使用 ifx_close() 關(guān)閉數(shù)據(jù)庫。 參考 ifx_connect() ifx_close() Informix 數(shù)據(jù)庫函數(shù)庫(三)ifx_close ifx_close 關(guān)閉 Informix 服務(wù)器連接。 語法: boolean ifx_close(int [link_identifier]); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)關(guān)閉與 Informix 數(shù)據(jù)庫服務(wù)器的連接。若無指定參數(shù) link_identifier 則會關(guān)閉最后的一筆連接。用 ifx_pconnect() 連接則無法使用本函數(shù)關(guān)閉。本函數(shù)可以省略,當(dāng) PHP 整頁程序結(jié)束后,將會自動關(guān)閉與數(shù)據(jù)庫的非永久性 (non-persistent) 連接。返回值均為 true。 Informix 數(shù)據(jù)庫函數(shù)庫(四)ifx_query ifx_query 送出一個 query 字符串。 語法: int ifx_query(string query, int [link_identifier], int [cursor_type], mixed [blobidarray]); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)送出 query 字符串供 Informix 做相關(guān)的處理步驟。若沒有指定 link_identifier 參數(shù),則程序會自動尋找最近打開的 ID。參數(shù) cursor_type 可省略,其值有 IFX_SCROLL 與 IFX_HOLD 二種。若有 BLOB 的字段要加在 query 指令之中,可使用 blobidarray 參數(shù),指定 BLOB 的代碼。 使用范例 例一: <?php // 之前的程序省略 ifx_textasvarchar(1); // 使用文字模式 (text mode) 的 blobs $res_id = ifx_query("select * from orders", $conn_id); if (! $res_id) { printf("無法取出 orders 資料表 : %s\n<br>%s<br>\n", ifx_error()); ifx_errormsg(); die; } ifx_htmltbl_result($res_id, "border=\"1\""); ifx_free_result($res_id); // 之后的程序省略 ?> 例二: <?php // 之前的程序省略 // // 為二進(jìn)位及文字建立 BLOB 代碼 $textid = ifx_create_blob(0, 0, "Text column in memory"); $byteid = ifx_create_blob(1, 0, "Byte column in memory"); $blobidarray[] = $textid; $blobidarray[] = $byteid; $query = "insert into catalog (stock_num, manu_code, " ."cat_descr,cat_picture) values(1,'HRO',?,?)"; $res_id = ifx_query($query, $conn_id, $blobidarray); if (! $res_id) { // 錯誤處理 } ifx_free_result($res_id); // 之后程序省略 ?> Informix 數(shù)據(jù)庫函數(shù)庫(五)ifx_prepare() ifx_prepare 準(zhǔn)備 query 字符串。 語法: int ifx_prepare(string query, int link_identifier, int [cursor_type], mixed blobidarray); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)準(zhǔn)備 query 字符串供 Informix 接著做相關(guān)的處理。若沒有指定 link_identifier 參數(shù),則程序會自動尋找最近打開的 ID。參數(shù) cursor_type 可省略,其值有 IFX_SCROLL 與 IFX_HOLD 二種。若有 BLOB 的字段要加在 query 指令之中,可使用 blobidarray 參數(shù),指定 BLOB 的代碼。返回值可供 ifx_do() 使用。 Informix 數(shù)據(jù)庫函數(shù)庫(六)ifx_do ifx_do 執(zhí)行已準(zhǔn)備 query 字符串。 語法: boolean ifx_do(int result_id); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來執(zhí)行已經(jīng)由 ifx_prepare() 函數(shù)所準(zhǔn)備的字符串。參數(shù) result_id 即為 ifx_prepare() 所返回的待執(zhí)行代碼。成功則返回 true,失敗返回 false 值。
Informix 數(shù)據(jù)庫函數(shù)庫(七)ifx_error ifx_error 取得 Informix 最后的錯誤。 語法: string ifx_error(void); 返回值: 字符串 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來取得 Informix 數(shù)據(jù)庫最后的錯誤信息,本函數(shù)無須加入任何參數(shù)。返回的字符串如以下的格式 X [SQLSTATE=aa bbb SQLCODE=c] 其中的 X 代表錯誤信息的種類,見下表 字符 代表種類 空格 無錯誤 E 錯誤 (Error) N 無資料 W 警告 (Warning) 其它未定義 至于 aa、bbb、c 表示數(shù)字資料,并分別為二位、三位及一位數(shù)。更多有關(guān)細(xì)節(jié)參考 Informix 手冊中有關(guān) SQLSTATE 與 SQLCODE 的信息。 參考 ifx_errormsg() Informix 數(shù)據(jù)庫函數(shù)庫(八)ifx_errormsg ifx_errormsg 取得 Informix 最后錯誤信息。 語法: string ifx_errormsg(int [errorcode]); 返回值: 字符串 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來取得 Informix 數(shù)據(jù)庫最后的錯誤信息字符串。參數(shù) errorcode 代表錯誤代碼。 使用范例 本例為部份程序 printf("%s\n ", ifx_errormsg(-201)); ?> 參考 ifx_error() Informix 數(shù)據(jù)庫函數(shù)庫(九)ifx_affected_rows ifx_affected_rows 得到 Informix 最后操作影響的列數(shù)目。 語法: int ifx_affected_rows(int result_id); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)可得到 Informix 最后查詢操作 INSERT、UPDATE 或 DELETE 所影響的列 (row) 數(shù)目。若最后使用的是 SELECT,則用本函數(shù)得到的數(shù)目為估計值,而非精確的數(shù)目,欲得到 SELECT 返回的數(shù)目需使用 ifx_num_rows() 函數(shù)。 使用范例 本例為部份程序 $rid = ifx_prepare ("select * from userinfo where name like " . $name, $connid); if (! $rid) { // 錯誤處理的部份 } $rowcount = ifx_affected_rows ($rid); if ($rowcount > 1000) { printf ("返回資料太多,共 %d 筆\n ", $rowcount); die ("請重新執(zhí)行 SQL 指令 \n"); } ?> 參考 ifx_num_rows() Informix 數(shù)據(jù)庫函數(shù)庫(十)ifx_getsqlca ifx_getsqlca 取得 query 后的 sqlca 信息。 語法: array ifx_getsqlca(int result_id); 返回值: 數(shù)組 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 函數(shù)可得到 Informix 最后查詢操作后的 sqlca 結(jié)構(gòu) (struct) 中的相關(guān)信息。參數(shù) result_id 是經(jīng)過 ifx_query() 及 ifx_prepare() 的返回代號。本函數(shù)返回的數(shù)組其實就是 sqlca.sqlerrd[0] 到 sqlca.sqlerrd[5] 等六個元素的數(shù)組。 使用范例 下例為部份程序 <?php $qid = ifx_query("insert into sometable values(0, '2nd column', 'another column' ", $connid); if (! $qid) { // 錯誤處理 } $sqlca = ifx_getsqlca ($qid); $serial_value = $sqlca["sqlerrd1"]; echo "插入列序號為: " . $serial_value<br>n"; Informix 數(shù)據(jù)庫函數(shù)庫(十一)ifx_fetch_row ifx_fetch_row 返回單列的各字段。 語法: array ifx_fetch_row(int result_id, mixed [position]); 返回值: 數(shù)組 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來將查詢結(jié)果 result 之單列拆到數(shù)組變量中。數(shù)組的索引是數(shù)字索引,第一個的索引值是 0。若 result 沒有資料,則返回 false 值。參數(shù) position 可省略,是所謂的卷動游標(biāo) (scroll cursor),可能值為:NEXT、PREVIOUS、CURRENT、FIRST 或者 LAST;亦可能為數(shù)字,表示指定為第幾列。 使用范例 以下的范例為連上 Informix 數(shù)據(jù)庫后的步驟 $rid = ifx_prepare("select * from emp where name like ".$name, $connid, IFX_SCROLL); if (! $rid) { // 錯誤處理 } $rowcount = ifx_affected_rows($rid); if ($rowcount > 1000) { printf ("返回資料太多,共 %d 筆\n ", $rowcount); die ("請重新執(zhí)行 SQL 指令 \n"); } if (! ifx_do ($rid)) { // 錯誤處理 } $row = ifx_fetch_row($rid, "NEXT"); while (is_array($row)) { for(reset($row); $fieldname=key($row); next($row)) { $fieldvalue = $row[$fieldname]; printf("%s = %s,", $fieldname, $fieldvalue); } printf("\n "); $row = ifx_fetch_row($rid, "NEXT"); } ifx_free_result($rid); ?> Informix 數(shù)據(jù)庫函數(shù)庫(十二)ifx_htmltbl_result ifx_htmltbl_result 將 query 返回資料轉(zhuǎn)成 HTML 表格。 語法: int ifx_htmltbl_result(int result_id, string [html_table_options]); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來將 query 查詢結(jié)果格式化成 HTML 標(biāo)記格式的表格形式。參數(shù) html_table_options 可省略,為 標(biāo)記中的參數(shù)選項。成功則返回列數(shù),失敗則返回 false 值。 使用范例 以下的范例中, 標(biāo)記的參數(shù)設(shè)表格邊寬為 2。 $rid = ifx_prepare("select * from emp where name like ".$name, $connid, IFX_SCROLL); if (! $rid) { // 錯誤處理 } $rowcount = ifx_affected_rows($rid); if ($rowcount > 1000) { printf ("返回資料太多,共 %d 筆\n ", $rowcount); die ("請重新執(zhí)行 SQL 指令 \n"); } if (! ifx_do($rid) { // 錯誤處理 } ifx_htmltbl_result($rid, "border=\"2\""); ifx_free_result($rid); Informix 數(shù)據(jù)庫函數(shù)庫(十三)ifx_fieldtypes ifx_fieldtypes 列出 Informix 的 SQL 字段。 語法: array ifx_fieldtypes(int result_id); 返回值: 數(shù)組 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)可以獲得 Informix 的 SQL 指令返回的字段。參數(shù) result_id 是經(jīng)過 ifx_query() 或 ifx_prepare() 的返回代號。 使用范例 本例為程序的一部份 $types = ifx_fieldtypes($resultid); if (! isset($types)) { // 錯誤處理 } for ($i = 0; $i < count($types); $i++) { $fname = key($types); printf("%s :\t 類型為: %s\n", $fname, $types[$fname]); next($types); }
Informix 數(shù)據(jù)庫函數(shù)庫(十四)ifx_fieldproperties ifx_fieldproperties 列出 Informix 的 SQL 字段屬性。 語法: array ifx_fieldproperties(int result_id); 返回值: 數(shù)組 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)可以獲得 Informix 的 SQL 指令返回字段的屬性。參數(shù) result_id 是經(jīng)過 ifx_query() 或 ifx_prepare() 的返回代號。 使用范例 本例為程序的一部份 $properties = ifx_fieldtypes($resultid); if (! isset($properties)) { // 錯誤處理 } for ($i = 0; $i < count($properties); $i++) { $fname = key($properties); printf("%s:\t type = %s\n", $fname, $properties[$fname]); next($properties); }
Informix 數(shù)據(jù)庫函數(shù)庫(十五)ifx_num_fields ifx_num_fields 取得返回字段的數(shù)目。 語法: int ifx_num_fields(int result_id); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)可以得到返回字段的數(shù)目。參數(shù) result_id 是經(jīng)過 ifx_query() 或 ifx_prepare() 的返回代號。若發(fā)生錯誤則返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(十六)ifx_num_rows ifx_num_rows 取得返回列的數(shù)目。 語法: int ifx_num_rows(int result_id); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)可以得到 Informix 數(shù)據(jù)庫返回列的數(shù)目。參數(shù) result_id 是經(jīng)過 ifx_query() 或 ifx_do() 的返回代號。若發(fā)生錯誤則返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(十七)ifx_free_result ifx_free_result 釋放返回占用內(nèi)存。 語法: boolean ifx_free_result(int result_id); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)可以釋放目前 Informix 數(shù)據(jù)庫 query 返回所占用的內(nèi)存。一般只有在非常擔(dān)心在內(nèi)存的使用上可能會不足的情形下才會用本函數(shù),因為 PHP 程序會在結(jié)束時自動釋放。發(fā)生錯誤則返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(十八)ifx_create_char ifx_create_char 建立字符類。 語法: int ifx_create_char(string param); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來建立字符 (char) 類。參數(shù) param 為字符的內(nèi)容。成功則返回字符的類代碼,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(十九)ifx_free_char Informix 數(shù)據(jù)庫函數(shù)庫 ifx_free_char 刪除字符類。 語法: boolean ifx_free_char(int bid); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來刪除字符 (char) 類。參數(shù) bid 為字符的類代碼。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十)ifx_update_char ifx_update_char 更改字符類。 語法: boolean ifx_update_char(int bid, string content); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來更改字符 (char) 類。參數(shù) bid 為字符的類代碼。參數(shù) content 為欲使用的新字符。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十一)ifx_get_char ifx_get_char 取得字符類。 語法: string ifx_get_char(int bid); 返回值: 字符串 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來取得字符 (char) 類。參數(shù) bid 為字符的類代碼。返回值為字符的內(nèi)容。 Informix 數(shù)據(jù)庫函數(shù)庫(二十二)ifx_create_blob ifx_create_blob 建立長位類。 語法: int ifx_create_blob(int type, int mode, string param); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來建立長位 (blob) 類。參數(shù) type 表示 blob 的類型,1 表文字資料;0 表位資料。參數(shù) mode 為長位資料的存放處,0 表在內(nèi)存;1 表在文件中。參數(shù) param 為 blob 的內(nèi)容,若 mode 為 0 則為內(nèi)存指針;若 mode 為 1 則為文件名。成功則返回長位的類代碼,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十三)ifx_copy_blob ifx_copy_blob 復(fù)制長位類。 語法: int ifx_copy_blob(int bid); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來復(fù)制長位 (blob) 類。參數(shù) bid 為 blob 類代碼。成功則返回新的長位類代碼,失敗返回 false 值。
Informix 數(shù)據(jù)庫函數(shù)庫(二十四)ifx_free_blob ifx_free_blob 刪除長位類。 語法: boolean ifx_free_blob(int bid); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來刪除長位 (blob) 類。參數(shù) bid 為 blob 類代碼。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十五)ifx_get_blob ifx_get_blob 取得長位類。 語法: string ifx_get_blob(int bid); 返回值: 字符串 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來取得長位 (blob) 類。參數(shù) bid 為長位的類代碼。返回值為 blob 類的內(nèi)容。 Informix 數(shù)據(jù)庫函數(shù)庫(二十六)ifx_update_blob ifx_update_blob 更改長位類。 語法: boolean ifx_update_blob(int bid, string content); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來更改長位 (blob) 類。參數(shù) bid 為 blob 類代碼。參數(shù) content 為欲使用新的 blob 資料。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十七)ifx_blobinfile_mode ifx_blobinfile_mode 配置長位類模式。 語法: boolean ifx_blobinfile_mode(int mode); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來配置所有 select 的 SQL 指令用到的長位 (blob) 類模式默認(rèn)值。參數(shù) mode 的值為儲存 blob 資料的地點, 0 表在內(nèi)存;1 表在文件中。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十八)ifx_textasvarchar ifx_textasvarchar 配置文字模式默認(rèn)值。 語法: boolean ifx_textasvarchar(int mode); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來配置所有 select 的 SQL 指令用到的文字 (text) 類模式默認(rèn)值。參數(shù) mode 的值為 0 表返回 blob 的代碼;1 表返回 varchar 字符串。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(二十九)ifx_byteasvarchar ifx_byteasvarchar 配置位組模式默認(rèn)值。 語法: boolean ifx_byteasvarchar(int mode); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來配置所有 select 的 SQL 指令用到的位組 (byte) 類模式默認(rèn)值。參數(shù) mode 的值為 0 表返回 blob 的代碼;1 表返回 varchar 字符串。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十)ifx_nullformat ifx_nullformat 配置空字符模式默認(rèn)值。 語法: boolean ifx_nullformat(int mode); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來配置所有 select 的 SQL 指令用到的空字符 (null) 類模式默認(rèn)值。參數(shù) mode 的值為 0 表返回 "" (空字符串);1 表返回 NULL 字符串。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十一)ifx_create_blob ifx_create_blob 建立長位類。 語法: int ifx_create_blob(int type, int mode, string param); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 函數(shù)用來建立長位 (blob) 類。參數(shù) type 表示 blob 的類型,1 表文字資料;0 表位資料。參數(shù) mode 為長位資料的存放處,0 表在內(nèi)存;1 表在文件中。參數(shù) param 為 blob 的內(nèi)容,若 mode 為 0 則為內(nèi)存指針;若 mode 為 1 則為文件名。成功則返回長位的類代碼,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十二)ifxus_close_slob ifxus_close_slob 刪除 slob 類。 語法: boolean ifxus_close_slob(int bid); 返回值: 布爾值 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來刪除 slob 類。參數(shù) bid 為 slob 類代碼。執(zhí)行成功則返回 true 值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十三)ifxus_open_slob ifxus_open_slob 打開 slob 類。 語法: int ifxus_open_slob(long bid, int mode); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來打開 slob 類。參數(shù) bid 為 slob 類代碼。參數(shù) mode 值如下表 數(shù)值 常量 1 LO_RDONLY 2 LO_WRONLY 4 LO_APPEND 8 LO_RDWR 16 LO_BUFFER 32 LO_NOBUFFER 當(dāng)然也 mode 可以直接使用常量值,如 IFX_LO_RDONLY。若有需要,可使用數(shù)字相加,使 mode 值更有變化。成功則返回 slob 的類代碼,失敗返回 false 值。
Informix 數(shù)據(jù)庫函數(shù)庫(三十四)ifxus_tell_slob ifxus_tell_slob 返回目前文件或找尋位置。 語法: int ifxus_tell_slob(long bid); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)返回目前文件或者找尋文件的位置。參數(shù) bid 為 slob 類代碼。執(zhí)行成功則返回代碼值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十五)ifxus_seek_slob ifxus_seek_slob 配置目前文件或找尋位置。 語法: int ifxus_seek_blob(long bid, int mode, long offset); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來配置目前文件或找尋文件的位置。參數(shù) bid 為 slob 類代碼。參數(shù) mode 的值如下:0 表 LO_SEEK_SET、1 表 LO_SEEK_CUR、2 表 LO_SEEK_END。參數(shù) offset 為位組偏移值。執(zhí)行成功則返回代碼值,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十六)ifxus_read_slob ifxus_read_slob 讀取指定數(shù)目的 slob 類。 語法: string ifxus_read_slob(long bid, long nbytes); 返回值: 字符串 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)用來讀取指定位數(shù)的 slob 類。參數(shù) bid 為 slob 類代碼。參數(shù) nbytes 為位組數(shù)目。執(zhí)行成功則返回 slob 部份字符串,失敗返回 false 值。 Informix 數(shù)據(jù)庫函數(shù)庫(三十七)ifxus_write_slob ifxus_write_slob 將字符串寫入 slob 類中。 語法: int ifxus_write_slob(long bid, string content); 返回值: 整數(shù) 函數(shù)種類: 數(shù)據(jù)庫功能 內(nèi)容說明 本函數(shù)將指定字符串寫入 slob 類之中。參數(shù) bid 為 slob 類代碼。參數(shù) content 為待寫入字符串。執(zhí)行成功則返回寫入字符數(shù),失敗返回 false 值。
|
|
|