1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.15 $ -->
<reference id="ref.ifx">
<title>Informix 関数</title>
<titleabbrev>Informix</titleabbrev>
<partintro>
<para>
Informix (IDS) 7.x, SE 7.x, Universal Server (IUS) 9.x ,IDS 2000
用のInformixドライバは、informix拡張機能用ディレクトリの"ifx.ec"
および"php3_ifx.h"に実装されています。
IDS 7.xのサポートは、BYTEおよびTEXTカラムを完全にサポートしており、
完成度はかなり高いです。
IUS 9.xのサポートは、部分的に完成しています。つまり、
新しいデータ型はサポートされていますが、SLOBおよびCLOBのサポートについては
まだ作業中です。
</para>
<note>
<title>設定に関する注意</title>
<para>
PHP Informix ドライバをコンパイルするには、何らかのバージョンのESQL/C
が必要です。7.2x以降のバージョンに付属するESQL/Cは問題なく使用できます。
現在では、ESQL/CはInformixクライアントSDKに含まれています。
</para>
<para>
"configure" スクリプトを実行する前に、必ず"INFORMIXDIR" 変数を設定し、
PATHに$INFORMIXDIR/bin を設定しておいてください。
</para>
<para>
"configure --with_informix=yes" を実行した場合、
configure スクリプトは、ライブラリおよびインクルードディレクトリを
自動検出します。
環境変数 "IFX_LIBDIR", "IFX_LIBS", "IFX_INCDIR" を指定することにより、
この検出結果を上書きすることが可能です。
configure スクリプトは、Informix サーバーのバージョンを検出しようと
もします。
Informix のバージョンが 9.00 以上である場合、条件コンパイル用変数
"HAVE_IFX_IUS" が設定されます。
</para>
</note>
<note>
<title>実行時に考慮すべき点</title>
<para>
Informix用環境変数INFORMIXDIRおよびINFORMIXSERVERがPHP ifxドライバ
で利用可能であり、INFORMIXのバイナリがあるディレクトリにパスが
通っていることを確認して下さい。テストを始める前に
<function>phpinfo()</function>と書いたスクリプトを実行し、
これを確認して下さい。
<function>phpinfo()</function> があるスクリプトは、これらの環境変数
の一覧を出力します。これは、CGI版のPHPおよびApache mod_phpで共に
行われます。これらの環境変数はApacheのスタートアップスクリプトで設定
する必要があります。
</para>
<para>
また、Informix共有ライブラリがローダーで利用可能である必要があります。
(LD_LINBRARY_PATHまたはld.so.conf/ldconfigを確認して下さい)
</para>
</note>
<note>
<title>BLOB (TEXT および BYTE カラム)の使用に関する注意</title>
<para>
通常、BLOB はBLOB ID により指定されます。
select クエリーは、BYTE および TEXT カラム毎に "blob id" を返します。
( "ifx_blobinfile(0);" により) メモリー上で BLOB を得ることを選択した場合、
"string_var = ifx_get_blob($blob_id);" で内容を得ることができます。
ファイルから BLOB カラムの内容を取得したい場合、
"ifx_blobinfile(1);" を使用して下さい。
"ifx_get_blob($blob_id);" によりファイル名を得ることができます。
BLOB の内容を得る際には、通常のファイル入出力を行ってください。
</para>
<para>
insert/update クエリーに関しては、
"ifx_create_blob(..);" により自分で "blob id" を作成する必要があります。
その後、blob id を配列に代入し、
クエリー文字列の中の blob カラムを疑問符 (?) で置換します。
updates/inserts の場合、ifx_update_blob(...) で blob の内容を設定する
のが便利でしょう。
</para>
<para>
BLOB カラムの動作は、設定用変数で変更することができます。
これらの変数は、実行時にも設定可能です。
</para>
<para>
</para>
<para>
設定変数 : ifx.textasvarchar
</para>
<para>
設定変数 : ifx.byteasvarchar
</para>
<para>
</para>
<para>
ランタイム関数 :
</para>
<para>
ifx_textasvarchar(0) : TEXT カラムを有する select クエリーに blob
id を使用する
</para>
<para>
ifx_byteasvarchar(0) : BYTE カラムを有する select クエリーに blob
id を使用する
</para>
<para>
ifx_textasvarchar(1) : TEXTカラムをVARCHARカラムとして返します。
このため、selectクエリーにおいてblob idを使用する必要はありません。
</para>
<para>
ifx_byteasvarchar(1) : BYTEカラムをVARCHARカラムとして返します。
このため、selectクエリーにおいてblob idを使用する必要はありません。
</para>
<para>
</para>
<para>
設定変数 : ifx.blobinfile
</para>
<para>
ランタイム関数 :
</para>
<para>
ifx_blobinfile_mode(0) : メモリーに BYTE カラムを返す, blob id によ
りその内容を取り出す
</para>
<para>
ifx_blobinfile_mode(1) : メモリーに BYTE カラムを返す, blob id によ
りそのファイル名を取り出す
</para>
<para>
ifx_text/byteasvarchar を 1 に設定した場合、
通常の(しかしやや長い) VARCHAR フィールドのように
select クエリーで TEXT や BYTE カラムを使用することが可能です。
全ての文字列は、PHP で "数えられる" ので、これにより、"バイナリ・セー
フ"が維持されます。
これを正しく処理するのはあなた次第です。
返されるデータには何でも含むことができますが、その内容について
責任を負うことになります。
</para>
<para>
ifx_blobinfile を 1 に設定した場合、blob の内容を得るために
ifx_get_blob(..) により返されたファイル名を使用して下さい。
この場合、行を取得する際に Informix により作成されたテンポラリファイル
を削除する責任があります。取得された新規の行は、BYTE カラム毎に新
規のテンポラリファイルを作成します。
</para>
<para>
テンポラリファイルの位置は、環境変数 "blobdir" により設定すること
ができます。デフォルトは、"." (カレントディレクトリ)です。
putenv(blobdir="tmpblob"); のようにすることにより、誤って残ってし
まったテンポラリファイルを削除することが容易になります。(テンポラ
リファイルの名前は "blb" で始まります)
</para>
</note>
<note>
<title>自動的に "char" (SQLCHAR および SQLNCHAR) データを取り去る</title>
<para>
これは、次の設定変数により設定することが可能です。
</para>
<para>
ifx.charasvarchar : 最後尾のスペースを何らかの削除処理を行わずに
自動的に取り去る場合に1に設定します。
</para>
</note>
<note>
<title>&null; 値</title>
<para>
設定変数 ifx.nullformat (およびランタイム関数
<function>ifx_nullformat</function>) を&true;に設定した場合、文字列
"&null;" として &null; カラムを返します。&false;に設定した場合は空文字
列を返します。これにより、&null;カラムと空のカラムを識別することが
可能となります。
</para>
</note>
</partintro>
<refentry id="function.ifx-connect">
<refnamediv>
<refname>ifx_connect</refname>
<refpurpose>Informix サーバーへの接続をオープンする</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_connect</methodname>
<methodparam><type>string</type><parameter>
<replaceable><optional>database</optional></replaceable>
</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>userid</optional></replaceable>
</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>password</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
成功時に接続 ID を、エラー時に &false; を返します。
</para>
<para>
<function>ifx_connect</function> は、Informix サーバーへの接続を
確立します。全ての引数はオプションであり、指定されない場合には、
<link linkend="configuration.file">設定ファイル</link>にて指定された値
がデフォルト値として設定されます。
(ホストに関して ifx.default_host (定義されていない場合、Informix
ライブラリは、環境変数<envar>INFORMIXSERVER</envar>を参照します)
, ユーザーに関して ifx.default_user,
パスワードに関して ifx.default_password (定義されていない場合は無し)
となります。
</para>
<para>
同じ引数で
<function>ifx_connect</function> を2回目にコールした際には、
新規のリンクは確立されず、代わりに既にオープンされたリンクの
リンク ID が返されます。
</para>
<para>
サーバーへのリンクは、<function>ifx_close</function> のコールに
より明示的に事前に閉じない限り、スクリプトの実行終了直後に閉じられます。
</para>
<para>
<function>ifx_pconnect</function>,
<function>ifx_close</function> も参照下さい。
<example>
<title>Informix データベースへの接続</title>
<programlisting role="php">
<![CDATA[
$conn_id = ifx_connect ("mydb@ol_srv1", "imyself", "mypassword");
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-pconnect">
<refnamediv>
<refname>ifx_pconnect</refname>
<refpurpose>持続的 Informix 接続をオープンする</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_pconnect</methodname>
<methodparam><type>string</type><parameter>
<replaceable><optional>database</optional></replaceable>
</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>userid</optional></replaceable>
</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>password</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
返り値: 成功時に正の Informix 持続的リンク ID 、エラー時に &false;
</para>
<para>
<function>ifx_pconnect</function> は、二つの大きな違いはあるものの、
<function>ifx_connect</function> と非常に似た動作をします。
</para>
<para>
この関数は、PHP が Apache モジュールとして実行されていない場合、
<function>ifx_connect</function> とほとんど似た動作をします。
まず、接続時に、関数は、既にオープンされている同じホスト、ユーザ名、
パスワード の(持続的)リンク探します。
そのリンクが見つかった場合、新規に接続をオープンする代わりに
おの ID が返されます。
</para>
<para>
第二に、SQL サーバーへの接続は、スクリプトの実行終了時に閉じられません。
代わりにリンクは、後の使用のためにオープンされたままとなります。
(<function>ifx_close</function> は <function>ifx_pconnect</function>
により確立されたリンクを閉じません。)
</para>
<para>
この型のリンクは、このため、'持続的' であると呼ばれます。
</para>
<para>
<function>ifx_connect</function> も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-close">
<refnamediv>
<refname>ifx_close</refname>
<refpurpose>Informix 接続を閉じる</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_close</methodname>
<methodparam><type>int</type><parameter>
<replaceable><optional>link_identifier</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
返り値: 常に &true;。
</para>
<para>
<function>ifx_close</function> は、
指定したリンク ID が関連する Informix データベースへの接続を
閉じます。
リンク ID が指定されない場合、最後にオープンされたリンクが仮定されます。
</para>
<para>
非持続的関数としてオープンされたリンクはスクリプトの実行終了時に
自動的に閉じられるため、
この関数は通常の場合は必要ではないことに注意して下さい。
</para>
<para>
<function>ifx_close</function> は、<function>ifx_pconnect</function>
により作成された持続的リンクは閉じません。
</para>
<para>
<function>ifx_connect</function>,
<function>ifx_pconnect</function> も参照下さい。
<example>
<title>Informix 接続を閉じる</title>
<programlisting role="php">
<![CDATA[
$conn_id = ifx_connect (mydb@ol_srv, "itsme", "mypassword");
... クエリー等を実行 ...
ifx_close($conn_id);
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-query">
<refnamediv>
<refname>ifx_query</refname>
<refpurpose>Informix クエリーを送信する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_query</methodname>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
<methodparam><type>int</type><parameter>
<replaceable><optional>link_identifier</optional></replaceable>
</parameter></methodparam>
<methodparam><type>int</type><parameter>
<replaceable><optional>cursor_type</optional></replaceable>
</parameter></methodparam>
<methodparam><type>mixed</type><parameter>
<replaceable><optional>blobidarray</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
返り値: 成功時に正の Informix 結果 ID、エラー時に &false;
</para>
<para>
リソース "result_id" は、クエリー結果を取得するために
他の関数により使用されます。
<function>ifx_affected_rows</function> 関数による取得を行うために
"affected_rows" をセットします。
</para>
<para>
<function>ifx_query</function> は、サーバー上の指定したリンク ID
が指す現在アクティブなデータベースにクエリーを送信します。リンク
ID が指定されない場合は、最後にオープンされたリンクを仮定します。
リンクがオープンされていない場合、この関数は、
<function>ifx_connect</function> がコールされた時と同様にリンクを
確立しようと試み、それを使用します。
</para>
<para>
接続 <parameter>conn_id</parameter> において
<parameter>query</parameter>を実行します。"select 型" のクエリー
では、カーソルが定義され、オープンされます。オプションの
<parameter>cursor_type</parameter> パラメータにより、そのカーソル
を"スクロール" または "ホールド" カーソルとすることができます。こ
のオプションはビットマスクであり、IFX_SCROLL, IFX_HOLD, または両
方とも指定することができます。select でないクエリーは、"直ちに実
行"されます。IFX_SCROLL および IFX_HOLD は定数シンボルのため引用
符で括る必要はありません。このパラメータを省略した場合、カーソル
は通常のシーケンシャルカーソルになります。
</para>
<para>
どちらのタイプのクエリーにおいても、(予測または実際の数として)
作用された行の数は、<function>ifx_affected_rows</function> により
取得するために保存されます。
</para>
<para>
もし、update クエリーにおいて BLOB (BYTE または TEXT) カラムがあ
る場合、対応する "BLOB ID" を有する
<parameter>blobidarray</parameter> パラメータを追加することが可能
です。この場合、クエリーテキストのこれらのカラムを "?" で置換する
ことが必要です。
</para>
<para>
TEXT (または BYTE) カラムの内容が許すならば、
"ifx_textasvarchar(1)" または "ifx_byteasvarchar(1)" を使用するこ
とも可能です。これにより、TEXT (または BYTE) カラムは、select ク
エリーの通常の(しかし長い)VARCHAR カラムと同様に処理され、BLOB ID
で悩むこともなくなります。
</para>
<para>
ifx_textasvarchar(0) または ifx_byteasvarchar(0) (デフォルト値)
の場合、select クエリーは、BLOB ID (整数値) に属するものとして
BLOB カラムを返します。BLOB 関数により文字列またはファイルとして
BLOB の値を得ることが可能です。(以下を参照)
</para>
<para>
<function>ifx_connect</function> も参照下さい。
<example>
<title>"orders" テーブルの全行を HTML テーブルとして表示する</title>
<programlisting role="php">
<![CDATA[
ifx_textasvarchar(1); // BLOB 用に "text mode" を使用する
$res_id = ifx_query("select * from orders", $conn_id);
if (! $res_id) {
printf("Can't select orders : %s\n<br>%s<br>\n", ifx_error());
ifx_error();
ifx_errormsg();
die;
}
ifx_htmltbl_result($res_id, "border=\"1\"");
ifx_free_result($res_id);
]]>
</programlisting>
</example>
<example>
<title>値を "catalog" テーブルに挿入する</title>
<programlisting role="php">
<![CDATA[
// バイトおよびテキストカラムに関する BLOB ID を作成する。
$textid = ifx_create_blob(0, 0, "Text column in memory");
$byteid = ifx_create_blob(1, 0, "Byte column in memory");
// blob id を blobid 配列に保存
$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) {
... エラー ...
}
// 結果 id を解放
ifx_free_result($res_id);
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-prepare">
<refnamediv>
<refname>ifx_prepare</refname>
<refpurpose>SQL 文を実行用に準備する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_prepare</methodname>
<methodparam><type>string</type><parameter>query</parameter></methodparam>
<methodparam><type>int</type><parameter>conn_id</parameter></methodparam>
<methodparam><type>int</type><parameter>
<replaceable><optional>cursor_def</optional></replaceable>
</parameter></methodparam>
<methodparam><type>mixed</type><parameter>blobidarray</parameter></methodparam>
</methodsynopsis>
<para>
<function>ifx_do</function> で使用するために整数
<parameter>result_id</parameter> を返します。
<function>ifx_affected_rows</function> 関数による取得を可能にする
ために<parameter>affected_rows</parameter> をセットします。
</para>
<para>
接続 <parameter>conn_id</parameter> に関して
<parameter>query</parameter>を準備します。"select 型" クエリーの
場合、カーソルが宣言され、オープンされます。オプションの
<parameter>cursor_type</parameter> パラメータにより、そのカーソル
を "スクロール" または "ホールド" カーソルとすることができます。
このオプションはビットマスクであり、IFX_SCROLL, IFX_HOLD, または
両方とも指定することができます。
select でないクエリーは、"直ちに実行"されます。
</para>
<para>
どちらのタイプのクエリーにおいても、(予測または実際の数として)
作用された行の数は、<function>ifx_affected_rows</function> により
取得可能とするために保存されます。
</para>
<para>
もし、クエリーにおいて BLOB (BYTE または TEXT) カラムがある場合、
対応する "BLOB ID" を有する<parameter>blobidarray</parameter> パ
ラメータを追加することが可能です。この場合、クエリーテキストのこ
れらのカラムを "?" で置換することが必要です。
</para>
<para>
TEXT (または BYTE) カラムの内容が許すならば、
"ifx_textasvarchar(1)" または "ifx_byteasvarchar(1)" を使用するこ
とも可能です。
これにより、TEXT (または BYTE) カラムは、select クエリーの
通常の(しかし長い)VARCHAR カラムと同様に処理され、
BLOB ID で悩むこともなくなります。
</para>
<para>
ifx_textasvarchar(0) または ifx_byteasvarchar(0) (デフォルト値)
の場合、select クエリーは、BLOB ID (整数値) に属するものとして
BLOB カラムを返します。
BLOB 関数により文字列またはファイルとして BLOB の値を得ることが可能です。
</para>
<para>
<function>ifx_do</function> も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-do">
<refnamediv>
<refname>ifx_do</refname>
<refpurpose>事前に準備された SQL 文を実行する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_do</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
成功時に &true;、エラーの時に &false; を返す。
</para>
<para>
事前に準備されたクエリーを実行し、カーソルをオープンします。
</para>
<para>
エラーの際に、<parameter>result_id</parameter> を解放しないで下さい。
</para>
<para>
select 文でない場合に、<function>ifx_affected_rows</function>
に数を設定します。
これは、<function>ifx_affected_rows</function> で取得可能です。
</para>
<para>
<function>ifx_prepare</function> も参照下さい。例があります。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-error">
<refnamediv>
<refname>ifx_error</refname>
<refpurpose>直近の Informix コールのエラーコードを返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>ifx_error</methodname>
<void/>
</methodsynopsis>
<para>
Informix エラーコード (SQLSTATE & SQLCODE) は次のようなフォーマッ
トとなります :
</para>
<para>
x [SQLSTATE = aa bbb SQLCODE=cccc]
</para>
<para>
ただし、x = 空白 : エラーなし
</para>
<para>
E : エラー
</para>
<para>
N : データがもうない
</para>
<para>
W : 警告
</para>
<para>
? : 未定義
</para>
<para>
文字 "x" が空白以外の文字だった場合、SQLSTATE および SQLCODE は、
エラーをより詳細に記述します。
</para>
<para>
SQLSTATE および SQLCODE の詳細については、Informix マニュアルを
参照下さい。
</para>
<para>
文の一般的な結果を記述する一文字からなる文字列および直近に実行さ
れた SQL 文に関する SQLSTATE および SQLCODE の両方を返します。文
字列のフォーマットは、
"(char) [SQLSTATE=(2桁の数値) (3桁の数値) SQLCODE=(1桁の数値)]"
となります。最初の文字は、'<literal> </literal>'
(空白) (成功), '<literal>W</literal>' (その文において警告を生
じた), '<literal>E</literal>' (その文の実行時にエラーを発生した)
,'<literal>N</literal>' (その文はデータを全く返さなかった) となり
ます。
</para>
<para>
<function>ifx_errormsg</function> も参照下さい。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-errormsg">
<refnamediv>
<refname>ifx_errormsg</refname>
<refpurpose>直近の Informix コールのエラーメッセージを返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>string</type><methodname>ifx_errormsg</methodname>
<methodparam><type>int</type><parameter>
<replaceable><optional>errorcode</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
直近の Informix エラーに関する Informix エラーメッセージ、または、
オプションの "<parameter>errorcode</parameter>" パラメータが指定された
場合、"<parameter>errorcode</parameter>" に対応するエラーメッセージ
が返されます。
</para>
<para>
<function>ifx_error</function> も参照下さい。
</para>
<informalexample>
<programlisting role="php">
printf("%s\n<br>", ifx_errormsg(-201));
</programlisting>
</informalexample>
</refsect1>
</refentry>
<refentry id="function.ifx-affected-rows">
<refnamediv>
<refname>ifx_affected_rows</refname>
<refpurpose>クエリーで作用された行の数を得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_affected_rows</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter>は、
<function>ifx_query</function>または
<function>ifx_prepare</function> により返される有効な結果 ID です。
</para>
<para>
<parameter>result_id</parameter> に関連するクエリーにより作用され
た行の数を返します。
</para>
<para>
insert, update ,delete の場合、その数は、実際に作用された行の数
(sqlerrd[2]) です。select の場合、これは推定値 (sqlerrd[0])です。
この値を信用してはいけません。データベースサーバーは、SELECTによ
り実際に返される行の数を返すことはありません。これは、この段階(オ
プティマイザがクエリー手順を定義している場合には、"PREPARE"を行っ
た直後)では、行の取得を始めてさえもいないためです。
</para>
<para>
<function>ifx_prepare</function> の実行後にクエリー結果を適当な量
に制限するために使用すると便利です。
</para>
<para>
<function>ifx_num_rows</function> も参照下さい。
</para>
<example>
<title>Informix affected rows</title>
<programlisting role="php">
<![CDATA[
$rid = ifx_prepare ("select * from emp
where name like " . $name, $connid);
if (! $rid) {
... error ...
}
$rowcount = ifx_affected_rows ($rid);
if ($rowcount > 1000) {
printf ("Too many rows in result set (%d)\n<br>", $rowcount);
die ("Please restrict your query<br>\n");
}
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ifx-getsqlca">
<refnamediv>
<refname>ifx_getsqlca</refname>
<refpurpose>クエリ実行後、sqlca.sqlerrd[0..5] の値を得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>ifx_getsqlca</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter> は、
<function>ifx_query</function> または
<function>ifx_prepare</function> から返される有効な結果IDです。
</para>
<para>
<parameter>result_id</parameter> に関連するクエリを実行した後の
sqlca.sqlerrd[0] から sqlca.sqlerrd[5] に関する擬似レコード(連想
配列)を返します。
</para>
<para>
insert、update、delete の場合、クエリが実行された後、サーバーにより
設定される場合と同様にレコードの値が返されます。
これにより、作用を受けた行の下図および連番の挿入値にアクセスすることが
可能となります。
SELECT の場合、この値はPREPARE 文の後で保存された値となります。
この値から作用を受けた行の数の"推測"値が分かります。
ifx ドライバにより適当な時に保存された値が取得されるため、
この関数を使用することにより、
"select dbinfo('sqlca.sqlerrdx')" クエリを実行するオーバーヘッドを
防止することができます。
</para>
<example>
<title>Informix sqlca.sqlerrd[x] の値を取得する</title>
<programlisting role="php">
<![CDATA[
/* 'sometable' の最初のカラムは連番であると仮定する */
$qid = ifx_query("insert into sometable
values(0, '2nd column', 'another column') ", $connid));
if (! $qid) {
... error ...
}
$sqlca = ifx_getsqlca ($qid);
$serial_value = $sqlca["sqlerrd1"];
echo "挿入された行の続き番号は : " . "$serial_value<br>\n";
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ifx-fetch-row">
<refnamediv>
<refname>ifx_fetch_row</refname>
<refpurpose>配列として行を得る</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>ifx_fetch_row</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>mixed</type><parameter>
<replaceable><optional>position</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
取得された行に対応する連想配列または、行がもうない場合に &false; を
返します。
</para>
<para>
BLOB カラムが、<function>ifx_get_blob</function> で使用するために
整数値 BLOB ID として返されます。ただし、ifx_textasvarchar(1) ま
たは ifx_byteasvarchar(1) を指定している場合を除きます。この場合、
BLOB は、文字列として返されます。エラーの場合、&false; が返されます。
</para>
<para>
<parameter>result_id</parameter> は、
<function>ifx_query</function> または
<function>ifx_prepare</function> (select 型のクエリーのみ!)
により返された有効な結果 ID です。
</para>
<para>
<parameter>position</parameter>は、オプション
パラメータで、"スクロール" カーソルで "取得" 操作を行うためのもので、
次のようになります。
"NEXT", "PREVIOUS", "CURRENT", "FIRST", "LAST" ,または番号。
番号を指定した場合、"絶対" 行の取得が行われます。このパラメータは、
オプションであり、SCROLL カーソルの場合にのみ有効です。
</para>
<para>
<function>ifx_fetch_row</function> は、指定された結果 ID が関連する
結果から1行文のデータを取得します。
各結果カラムは、オフセット 0 から始まる配列オフセットに保存されます。
カラム名がキーとなります。
</para>
<para>
<function>ifx_fetch_row</function> を続けてコールした場合、結果セッÈの
次の行が返されるます。
行がもうない場合は、&false; が返されます。
</para>
<example>
<title>Informix 行の取得</title>
<programlisting role="php">
<![CDATA[
$rid = ifx_prepare ("select * from emp where name like " . $name,
$connid, IFX_SCROLL);
if (! $rid) {
... error ...
}
$rowcount = ifx_affected_rows($rid);
if ($rowcount > 1000) {
printf ("Too many rows in result set (%d)\n<br>", $rowcount);
die ("Please restrict your query<br>\n");
}
if (! ifx_do ($rid)) {
... error ...
}
$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<br>");
$row = ifx_fetch_row ($rid, "NEXT");
}
ifx_free_result ($rid);
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ifx-htmltbl-result">
<refnamediv>
<refname>ifx_htmltbl_result</refname>
<refpurpose>
クエリー結果の全行を HTML テーブルにフォーマットする
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_htmltbl_result</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>string</type><parameter>
<replaceable><optional>html_table_options</optional></replaceable>
</parameter></methodparam>
</methodsynopsis>
<para>
取得された行の数またはエラーの場合に &false; を返します。
</para>
<para>
クエリー結果 <parameter>result_id</parameter> の全ての行を
HTML テーブルにフォーマットします。オプションの 2番目の引数は、
<table> タグのオプションとする文字列です。
</para>
<example>
<title>Informix 結果を HTML テーブルとして出力</title>
<programlisting role="php">
<![CDATA[
$rid = ifx_prepare ("select * from emp where name like " . $name,
$connid, IFX_SCROLL);
if (! $rid) {
... error ...
}
$rowcount = ifx_affected_rows ($rid);
if ($rowcount > 1000) {
printf ("Too many rows in result set (%d)\n<br>", $rowcount);
die ("Please restrict your query<br>\n");
}
if (! ifx_do($rid) {
... error ...
}
ifx_htmltbl_result ($rid, "border=\"2\"");
ifx_free_result($rid);
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ifx-fieldtypes">
<refnamediv>
<refname>ifx_fieldtypes</refname>
<refpurpose>Informix SQL フィールドのリスト</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>ifx_fieldtypes</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter> のクエリーについてフィールド名を
キーとし、SQL フィールド型をデータとした連想配列を返します。エラー
の場合に&false;を返します。
</para>
<example>
<title>フィールド名および SQL フィールド型</title>
<programlisting role="php">
<![CDATA[
$types = ifx_fieldtypes ($resultid);
if (! isset ($types)) {
... エラー処理 ...
}
for ($i = 0; $i < count($types); $i++) {
$fname = key($types);
printf("%s :\t type = %s\n", $fname, $types[$fname]);
next($types);
}
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ifx-fieldproperties">
<refnamediv>
<refname>ifx_fieldproperties</refname>
<refpurpose>SQL フィールドプロパティのリスト</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>array</type><methodname>ifx_fieldproperties</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter> のクエリーについてフィールド名を
キーとし、SQL フィールドプロパティをデータとした連想配列を返しま
す。エラーの場合に&false;を返します。
</para>
<para>
クエリー中の全てのフィールドの Informix SQL フィールドプロパティ
を連想配列として返します。コード化されるプロパティを次に示します。
"SQLTYPE;length;precision;scale;ISNULLABLE" ただし、SQLTYPE は、
"SQLVCHAR" 等の Informix 型。ISNULLABLE は、"Y" または "N" となり
ます。
</para>
<example>
<title>Informix SQL フィールドプロパティ</title>
<programlisting role="php">
<![CDATA[
$properties = ifx_fieldproperties ($resultid);
if (! isset($properties)) {
... error ...
}
for ($i = 0; $i < count($properties); $i++) {
$fname = key ($properties);
printf ("%s:\t type = %s\n", $fname, $properties[$fname]);
next ($properties);
}
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.ifx-num-fields">
<refnamediv>
<refname>ifx_num_fields</refname>
<refpurpose>クエリーのカラム数を返します</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_num_fields</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter> に関するクエリー結果のカラム数または
エラーの場合に&false;を返します。
</para>
<para>
クエリーを準備または実行された後、この関数をコールすることにより、
クエリー結果中でカラム数が得られます。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-num-rows">
<refnamediv>
<refname>ifx_num_rows</refname>
<refpurpose>クエリーから既に取得された行の数を数える</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_num_rows</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<function>ifx_query</function> または <function>ifx_do</function>
クエリーの後、<parameter>result_id</parameter> を有する
クエリーに関してこれまで取得された行の数を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-free-result">
<refnamediv>
<refname>ifx_free_result</refname>
<refpurpose>クエリーに関するリソースを解放する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_free_result</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter> に間連するクエリーの
リソースを解放します。エラーの場合に&false;を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-create-char">
<refnamediv>
<refname>ifx_create_char</refname>
<refpurpose>文字オブジェクトを作成する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_create_char</methodname>
<methodparam><type>string</type><parameter>param</parameter></methodparam>
</methodsynopsis>
<para>
文字オブジェクトを作成します。<parameter>param</parameter> は、
内容となる文字とする必要があります。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-free-char">
<refnamediv>
<refname>ifx_free_char</refname>
<refpurpose>文字オブジェクトを削除する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_free_char</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
指定したオブジェクト ID <parameter>bid</parameter>に関する文字オ
ブジェクトを削除します。エラーの場合は &false;、それ以外は &true; を
返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-update-char">
<refnamediv>
<refname>ifx_update_char</refname>
<refpurpose>文字オブジェクトの内容を更新する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_update_char</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
<methodparam><type>string</type><parameter>content</parameter></methodparam>
</methodsynopsis>
<para>
指定した文字オブジェクト <parameter>bid</parameter> に関して
文字オブジェクトの内容を更新します。
<parameter>content</parameter> は新規のデータを有する文字列です。
エラーの場合に &false;、それ以外の場合に &true; を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-get-char">
<refnamediv>
<refname>ifx_get_char</refname>
<refpurpose>文字オブジェクトの内容を返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_get_char</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
指定した文字オブジェクト ID <parameter>bid</parameter> について
文字オブジェクトの内容を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-create-blob">
<refnamediv>
<refname>ifx_create_blob</refname>
<refpurpose>BLOB オブジェクトを作成する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_create_blob</methodname>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>string</type><parameter>param</parameter></methodparam>
</methodsynopsis>
<para>
BLOB オブジェクトを作成します。
</para>
<para>
type: 1 = TEXT, 0 = BYTE
</para>
<para>
mode: 0 = BLOB オブジェクトはメモリーに内容を保持する,
1 = BLOB オブジェクトはファイルに内容を保持する。
</para>
<para>
param: mode = 0 の場合: 内容へのポインタ
mode = 1 の場合: ファイル文字列へのポインタ
</para>
<para>
エラーの場合に &false;、それ以外の場合に新規の BLOB オブジェクト ID を
返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-copy-blob">
<refnamediv>
<refname>ifx_copy_blob</refname>
<refpurpose>指定した BLOB オブジェクトを2重化する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_copy_blob</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
指定した BLOB オブジェクトを2重化します。
<parameter>bid</parameter> は BLOB オブジェクトの ID です。
</para>
<para>
エラーの場合に &false;、それ以外の場合に新規の BLOB オブジェクト ID を
返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-free-blob">
<refnamediv>
<refname>ifx_free_blob</refname>
<refpurpose>BLOB オブジェクトを削除する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_free_blob</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
指定された BLOB オブジェクト ID
<parameter>bid</parameter> の BLOB オブジェクトを削除します。
エラーの場合に &false;、それ以外の場合に &true; を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-get-blob">
<refnamediv>
<refname>ifx_get_blob</refname>
<refpurpose>BLOB オブジェクトの内容を返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifx_get_blob</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
指定した BLOB オブジェクト ID <parameter>bid</parameter>
に関する BLOB オブジェクトの内容を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-update-blob">
<refnamediv>
<refname>ifx_update_blob</refname>
<refpurpose>BLOB オブジェクトの内容を更新する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<methodname>ifx_update_blob</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
<methodparam><type>string</type><parameter>content</parameter></methodparam>
</methodsynopsis>
<para>
指定したBLOB オブジェクト ID <parameter>bid</parameter>
に関する BLOB オブジェクトの内容を更新します。
<parameter>content</parameter> は、新規データの文字列です。
エラーの場合に &false;、それ以外の場合に &true; を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-blobinfile-mode">
<refnamediv>
<refname>ifx_blobinfile_mode</refname>
<refpurpose>
全ての select クエリーに関するデフォルトの BLOB モードを設定する
</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>ifx_blobinfile_mode</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
全ての select クエリーに関するデフォルトの BLOB モードを設定します。
モード "0" は、BLOB をメモリーに保存することを意味し、
モード "1" は、BLOB をファイルに保存することを意味します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-textasvarchar">
<refnamediv>
<refname>ifx_textasvarchar</refname>
<refpurpose>デフォルトのテキストモードを設定する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>ifx_textasvarchar</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
全ての select クエリーに関するデフォルトのテキストモードを設定します。
モード "0" は、BLOB を返し、"1" は、テキストの内容を有する varchar を
返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-byteasvarchar">
<refnamediv>
<refname>ifx_byteasvarchar</refname>
<refpurpose>デフォルトのバイトモードを設定する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>ifx_byteasvarchar</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
全ての select クエリーに関するデフォルトのバイトモードを設定します。
モード "0" は。LOB ID を返し、モード "1" がテキストの内容を有する
varchar を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifx-nullformat">
<refnamediv>
<refname>ifx_nullformat</refname>
<refpurpose>S取得する行のデフォルトの返り値を設定する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>void</type><methodname>ifx_nullformat</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
取得する行のデフォルトの返り値を &null; 値に設定します。
モード "0" は "" を返し、モード "1" は "&null;" を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-create-slob">
<refnamediv>
<refname>ifxus_create_slob</refname>
<refpurpose>SLOB オブジェクトを作成し、オープンする</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_create_slob</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
SLOB オブジェクトを作成し、オープンします。
モードは、1 = LO_RDONLY, 2 =
LO_WRONLY, 4 = LO_APPEND, 8 = LO_RDWR, 16 = LO_BUFFER, 32 =
LO_NOBUFFER -> or-mask となります。
IFX_LO_RDONLY, IFX_LO_WRONLY 等の名前の定数を使用することも可能です。
エラーの場合に &false;、その他の場合に新しい SLOB オブジェクト ID を
返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-free-slob">
<refnamediv>
<refname>ifxus_free_slob</refname>
<refpurpose>SLOB オブジェクトを削除する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_free_slob</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
SLOB オブジェクトを削除します。<parameter>bid</parameter> は
SLOB オブジェクトの ID です。
エラーの場合に &false;、その他の場合に &true; を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-close-slob">
<refnamediv>
<refname>ifxus_close_slob</refname>
<refpurpose>SLOB オブジェクトを削除する</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_close_slob</methodname>
<methodparam><type>int</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
指定した SLOB オブジェクト ID <parameter>bid</parameter>
の SLOB オブジェクトを削除します。
エラーの場合に &false;、その他の場合に &true; を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-open-slob">
<refnamediv>
<refname>ifxus_open_slob</refname>
<refpurpose>SLOB オブジェクトをオープンする</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_open_slob</methodname>
<methodparam><type>long</type><parameter>bid</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
SLOB オブジェクトをオープンします。
<parameter>bid</parameter> は存在する SLOB ID である必要があります。
モードは、1 = LO_RDONLY, 2 = LO_WRONLY, 4 =
LO_APPEND, 8 = LO_RDWR, 16 = LO_BUFFER, 32 = LO_NOBUFFER ->
or-mask となります。
エラーの場合に &false;、その他の場合に新しい SLOB オブジェクト ID を
返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-tell-slob">
<refnamediv>
<refname>ifxus_tell_slob</refname>
<refpurpose>カレントのファイルまたはシーク位置を返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_tell_slob</methodname>
<methodparam><type>long</type><parameter>bid</parameter></methodparam>
</methodsynopsis>
<para>
オープンされた SLOB オブジェクトに関してカレントのファイルまたは
シーク位置を返します。<parameter>bid</parameter> は存在する SLOB
ID である必要があります。エラーの場合に&false;、その他の場合にシー
ク位置を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-seek-slob">
<refnamediv>
<refname>ifxus_seek_slob</refname>
<refpurpose>現在のファイル位置またはシーク位置を返す</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_seek_slob</methodname>
<methodparam><type>long</type><parameter>bid</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>long</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
オープンされた SLOB オブジェクトに関するカレントのファイルまたは
シーク位置を設定します。<parameter>bid</parameter> は存在する
SLOB ID である必要があります。モードは、0 = LO_SEEK_SET, 1 =
LO_SEEK_CUR, 2 = LO_SEEK_END となり、
<parameter>offset</parameter> はバイトオフセットです。
エラーの場合に &false;、その他の場合にシーク位置を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-read-slob">
<refnamediv>
<refname>ifxus_read_slob</refname>
<refpurpose>SLOB オブジェクトから n バイト読みこむ</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_read_slob</methodname>
<methodparam><type>long</type><parameter>bid</parameter></methodparam>
<methodparam><type>long</type><parameter>nbytes</parameter></methodparam>
</methodsynopsis>
<para>
SLOB オブジェクトから n バイト読みこみます。
<parameter>bid</parameter> は存在する SLOB ID であり、
<parameter>nbytes</parameter> は読みこむバイト数です。
エラーの場合に &false;、その他の場合にその文字列を返します。
</para>
</refsect1>
</refentry>
<refentry id="function.ifxus-write-slob">
<refnamediv>
<refname>ifxus_write_slob</refname>
<refpurpose>SLOB オブジェクトに文字列を書きこむ</refpurpose>
</refnamediv>
<refsect1>
<title>説明</title>
<methodsynopsis>
<type>int</type><methodname>ifxus_write_slob</methodname>
<methodparam><type>long</type><parameter>bid</parameter></methodparam>
<methodparam><type>string</type><parameter>content</parameter></methodparam>
</methodsynopsis>
<para>
SLOBオブジェクトを文字列に書きこみます。
<parameter>bid</parameter>は存在する SLOB ID 、
<parameter>content</parameter> は書きこむ内容です。エラーの場合に
&false;、その他の場合に書きこんだバイト数を返します。
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|