cvs: phpdoc /ja/chapters install.xml /ja/functions math.xml mhash.xml sesam.xml

From: Date: Wed, 20 Dec 2000 10:01:00 +0000
Subject: cvs: phpdoc /ja/chapters install.xml /ja/functions math.xml mhash.xml sesam.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969333338@lists.php.net to get a copy of this message
hirokawa Wed Dec 20 02:01:00 2000 EDT Modified files: /phpdoc/ja/chapters install.xml /phpdoc/ja/functions math.xml mhash.xml sesam.xml Log: update translation.

Index: phpdoc/ja/chapters/install.xml diff -u phpdoc/ja/chapters/install.xml:1.17 phpdoc/ja/chapters/install.xml:1.18 --- phpdoc/ja/chapters/install.xml:1.17 Sun Nov 19 15:00:22 2000 +++ phpdoc/ja/chapters/install.xml Wed Dec 20 02:00:59 2000 @@ -2726,7 +2726,7 @@ ことができます。 </simpara> <para> - このガイドは、以下のWebã‚ーバーへのインストールを + このガイドは、以下のWebィüバーへのインストールを サポートしています。 <itemizedlist> <listitem> @@ -2763,28 +2763,32 @@ <listitem> <para> 配布ファイルを好きなディレクトリに展開して下さい。 - "C:\PHP\" が、良い例です。 + &quot;C:\PHP\&quot; が、良い例です。 </para> </listitem> <listitem> <para> - 'php.ini-dist' を '%WINDOWS%' ディレクトリにコピーし、 - 'php.ini' にリネームして下さい。 - '%WINDOWS%' ディレクトリは、通常、次のようになります。 + &apos;php.ini-dist&apos; を Windows 95/98の場合は、 + &apos;%WINDOWS%&apos; ディレクトリ、Windows NT または Windows + 2000の場合は、&apos;%SYSTEMROOT%&apos;ディレクトリコピーし、 + &apos;php.ini&apos; にリネームして下さい。 + &apos;%WINDOWS%&apos; または &apos;%SYSTEMROOT%&apos;ディレク + トリは、通常、次のようになります。 <simplelist> <member>Windows 95/98 では、c:\windows</member> - <member>NT サーバーでは、c:\winnt ~たは c:\winnt40</member> + <member>NT\2000 サーバーでは、c:\winnt または c:\winnt40</member> </simplelist> </para> </listitem> <listitem> <para> - 'php.ini' ファイルを編集して下さい。 + &apos;php.ini&apos; ファイルを編集して下さい。 <itemizedlist> <listitem> <simpara> - 'extension_dir' の設定値を php-install-dir または 'php_*.dll' を - 置いた場所に変更する必要があります。例えば、c:\php になります。 + &apos;extension_dir&apos; の設定値を php-install-dir または + &apos;php_*.dll&apos; を置いた場所に変更する必要があります。 + 例えば、c:\php になります。 </simpara> </listitem> <listitem> @@ -3187,7 +3191,7 @@ 設定し、Web サーバーでPHPを使用するように設定するに必要な情報を集 めます。IIS と NTワークステーションにおける PWS の場合、スクリプ トマップ設定を有するサーバーの全ノードのリストが表示され、PHPスク - リプト用マッピング‚’追加したいと思う場所のノードを選択することが + リプト用マッピング?追加したいと思う場所のノードを選択することが 可能です。 </simpara> Index: phpdoc/ja/functions/math.xml diff -u phpdoc/ja/functions/math.xml:1.13 phpdoc/ja/functions/math.xml:1.14 --- phpdoc/ja/functions/math.xml:1.13 Mon Dec 11 13:42:13 2000 +++ phpdoc/ja/functions/math.xml Wed Dec 20 02:00:59 2000 @@ -552,7 +552,7 @@ </funcsynopsis> <para> 引数 hex_string により指定された 16進数に等価な 10 進数を返します。 - HexDec は 16 進数を表す文字列を 10 進数に変換します。 + HexDec は 16 進数を表す文字åˆã‚’ 10 進数に変換します。 変換できる最大の数字は16進数の 7fffffff もしくは 10 進数の 2147483647 です。 </para> @@ -1021,10 +1021,12 @@ </informalexample> </para> <note> - <para> + <simpara> + パラメータ <parameter>precision</parameter> は、PHP 4でのみ利用 + 可能です。 (訳注:内部的な2進数表現と10進数表現の差により生じる丸め誤差の影響により 必ずしも小数点以下を四捨五入した結果を返さないことに注意して下さい。) - </para> + </simpara> </note> <simpara> <function>ceil</function> と Index: phpdoc/ja/functions/mhash.xml diff -u phpdoc/ja/functions/mhash.xml:1.5 phpdoc/ja/functions/mhash.xml:1.6 --- phpdoc/ja/functions/mhash.xml:1.5 Thu Oct 26 15:19:21 2000 +++ phpdoc/ja/functions/mhash.xml Wed Dec 20 02:00:59 2000 @@ -241,7 +241,7 @@ が返されます。HMACは、メッセージ認証時はキーに基づくハッシュ、また は指定したキーに基づく単なるメッセージダイジェストです。mhashでサ ポートされている全てのアルゴリズムがHMACモードで使用できるわけで - はなく、サポートされていない場合はエラーを返します。 + はありません。エラーの場合はエラーが返されます。 </para> </refsect1> </refentry> Index: phpdoc/ja/functions/sesam.xml diff -u phpdoc/ja/functions/sesam.xml:1.3 phpdoc/ja/functions/sesam.xml:1.4 --- phpdoc/ja/functions/sesam.xml:1.3 Sat Dec 16 19:34:25 2000 +++ phpdoc/ja/functions/sesam.xml Wed Dec 20 02:00:59 2000 @@ -364,14 +364,13 @@ <listitem> <simpara><command>DROP TABLE thename;</command></simpara> <simpara> - SESAMでは、in the <command>DROP TABLE</command> - command, the table name must be either followed by - the keyword <literal>RESTRICT</literal> or - <literal>CASCADE</literal>. When specifying - <literal>RESTRICT</literal>, an error is returned if - there are dependent objects (e.g., VIEWs), while with - <literal>CASCADE</literal>, dependent objects will be - deleted along with the specified table. + SESAMでは、<command>DROP TABLE</command> においてテーブル名の + 後にキーãƒÃƒÉ <literal>RESTRICT</literal> または + <literal>CASCADE</literal> のどちらかを後に付加する必要があり + ます。<literal>RESTRICT</literal> を指定した場合、(VIEWのよう + な)依存するオブジェクトがある場合にエラーが返されます。また、 + <literal>CASCADE</literal> を指定した場合、依存するオブジェク + トは指定したテーブルから削除されます。 </simpara> </listitem> </itemizedlist> @@ -379,22 +378,22 @@ </note> <note> <title> - Notes on the use of various SQL types + 様々なSQL型を使用する場合の注意 </title> <para> - SESAM does not currently support the BLOB type. A future - version of SESAM will have support for BLOB. + SESAM は現在BLOB型をサポートしていません。SESAMの将来のバージョン + は、BLOBをサポートする予定です。 </para> <para> - At the PHP interface, the following type conversions are - automatically applied when retrieving SQL fields: + PHP インターフェースでは、SQLフィールドを取得する際に次の型変換が + 自動的に適用されます。 <table> - <title>SQL to PHP Type Conversions</title> + <title>SQL から PHP への型変換</title> <tgroup cols="2"> <thead> <row> - <entry>SQL Type</entry> - <entry>PHP Type</entry> + <entry>SQL 型</entry> + <entry>PHP 型</entry> </row> </thead> <tbody> @@ -417,24 +416,23 @@ </tbody> </tgroup> </table> - When retrieving a complete row, the result is returned as an - array. Empty fields are not filled in, so you will have to - check for the existence of the individual fields yourself - (use <function>isset</function> or - <function>empty</function> to test for empty fields). - That allows more user control over the appearance of empty - fields (than in the case of an empty string as the - representation of an empty field). + レコード全体を取得する際、結果は配列として返されます。空のフィー + ルドには値が入っていないため、個々のフィールド自体の存在を調べる + 必要があります(空のフィールドかどうか調べるには、 + <function>isset</function> または <function>empty</function> を使 + 用して下さい) 。この手法は、(空のフィールドの表現として型の文字列 + を使用するよりも)空のフィールドの見え方をユーザが制御することが可 + 能となります。 </para> </note> <note> - <title>Support of SESAM's "multiple fields" feature</title> + <title>SESAM の "複数フィールド" 機能のサポート</title> <para> - The special "multiple fields" feature of SESAM allows a column to - consist of an array of fields. Such a "multiple field" column can - be created like this: + SESAM特有の"複数フィールド"機能により複数のフィールドの配列からな + るカラムを使用することが可能です。"複数フィールド"カラム亜は、次 + のように作成可能です。 <example> - <title>Creating a "multiple field" column</title> + <title>"複数フィールド"カラムを作成する</title> <programlisting role="sesam"> CREATE TABLE multi_field_test ( @@ -443,32 +441,30 @@ ) </programlisting> </example> - and can be filled in using: + 上のレコードに次のように代入することができます。 <example> - <title>Filling a "multiple field" column</title> + <title>"複数フィールド"カラムに代入する</title> <programlisting role="sesam"> INSERT INTO multi_field_test ( pkey, multi(2..3) ) VALUES ( 'Second', &lt;'first_val','second_val'&gt;) </programlisting> </example> - Note that (like in this case) leading empty sub-fields are ignored, - and the filled-in values are collapsed, so that in the above - example the result will appear as multi(1..2) instead of - multi(2..3). + (この場合のように)先頭の空のサブフィールドは無視され、代入された + 値は詰められることに注意して下さい。このため、上記の例の結果は、 + multi(2..3) ではなく、multi(1..2) となります。 </para> <para> - When retrieving a result row, "multiple columns" are accessed like - "inlined" additional columns. In the example above, "pkey" will have - the index 0, and the three "multi(1..3)" columns will be accessible - as indices 1 through 3. + 結果レコードを取得する際、"複数カラム"は"インラインの"付加カラム + のようにアクセスされます。上のにおいて、"pkey" は添字0を有し、3つ + の"multi(1..3)" カラムは添字1から3でアクセス可能です。 </para> </note> <para> - For specific SESAM details, please refer to - <ulink url="&url.sesam.en;">the SESAM/SQL-Server - documentation (english)</ulink> or - <ulink url="&url.sesam.de;">the SESAM/SQL-Server documentation (german)</ulink>, - both available online, or use the respective manuals. + SESAM固有の事項について詳細は、<ulink url="&url.sesam.en;">the + SESAM/SQL-Serverドキュメント(英語)</ulink> または + <ulink url="&url.sesam.de;">SESAM/SQL-Server ドキュメント(ドイツ語) + </ulink> を参照下さい。共にオンラインで参照可能です。もしくは、適 + 当なマニュアルを使用して下さい。 </para> </partintro> @@ -488,44 +484,43 @@ </funcprototype> </funcsynopsis> <para> - Returns <literal>TRUE</literal> if a connection to the SESAM database was made, or - <literal>FALSE</literal> on error. + SESAMデータベースへの接続が作成された場合に + <literal>TRUE</literal>、エラーの場合に <literal>FALSE</literal> + を返します。 </para> <para> - <function>sesam_connect</function> establishes a connection to an - SESAM database handler task. The connection is always - "persistant" in the sense that only the very first invocation will - actually load the driver from the configured SESAM OML PLAM - library. Subsequent calls will reuse the driver and will - immediately use the given catalog, schema, and user. + <function>sesam_connect</function> はSESAMデータベースハンドラタ + スクへの接続を確立します。接続は、最初の起動時にのみ設定された + SESAM OML PLAMライブラリから実際にドライバがロードされるという意 + 味で常に"持続的"です。この後のコールでは、ドライバは再利用され、 + 指定しカタログ、スキーマ、ユーザを直ちに使用されます。 </para> <para> - When creating a database, the <parameter>"catalog"</parameter> - name is specified in the - SESAM configuration directive <command>//ADD-SQL-DATABASE-CATALOG-LIST - ENTRY-1 = *CATALOG(CATALOG-NAME = catalogname,...)</command> + データベースを作成する際、<parameter>"catalog"</parameter> 名は、 + SESAM設定ディレクティブ <command>//ADD-SQL-DATABASE-CATALOG-LIST + ENTRY-1 = *CATALOG(CATALOG-NAME = catalogname,...)</command> で指 + 定します。 </para> <para> - The <parameter>"schema"</parameter> references the desired - database schema (see SESAM handbook). + <parameter>"schema"</parameter> には選択したデータベーススキーマ + を指定します。(SESAMハンドブックを参照) </para> <para> - The <parameter>"user"</parameter> argument references one of the - users which are allowed to access this - <parameter>"catalog"</parameter> / <parameter>"schema"</parameter> - combination. Note that <parameter>"user"</parameter> is completely - independent from both the system's user id's and from HTTP - user/password protection. It appears in the SESAM configuration - only. + <parameter>"user"</parameter> 引数には、この + <parameter>"catalog"</parameter> / + <parameter>"schema"</parameter> の組にアクセス可能なユーザの一人 + を指定します。<parameter>"user"</parameter>は、システムのユーザID + とHTTPユーザ/パスワード保護から共に完全に独立していことに注意して + 下さい。SESAM設定にのみ使用されます。 </para> <para> - See also <function>sesam_disconnect</function>. + <function>sesam_disconnect</function>も参照下さい。 <example> - <title>Connect to a SESAM database</title> + <title>SESAM データベースへの接続</title> <programlisting role="php"> &lt;?php if (! sesam_connect ("mycatalog", "myschema", "otto") - die("Unable to connect to SESAM"; + die("SESAMに接続できません"; ?&gt; </programlisting> </example> @@ -547,34 +542,34 @@ </funcprototype> </funcsynopsis> <para> - Returns: always <literal>TRUE</literal>. + 返り値: 常に <literal>TRUE</literal>。 </para> <para> - <function>sesam_disconnect</function> closes the logical link to a - SESAM database (without actually disconnecting and unloading the - driver). + <function>sesam_disconnect</function> は(実際に接続を断にしたり、 + ドライバをアンロードすることなく)SESAMデータベースへの論理リンク + を閉じます。 </para> <para> - Note that this isn't usually necessary, as the open connection is - automatically closed at the end of the script's execution. - Uncommitted data will be discarded, because an implicit - <function>sesam_rollback</function> is executed. + オープンされた接続はスクリプトの実行終了時に閉じられるため、この + 関数は通常不要です。コミットされていないデータは、暗黙のうちに + <function>sesam_rollback</function> が実行されるため、破棄されま + す。 </para> <para> - <function>sesam_disconnect</function> will not close the - persistent link, it will only invalidate the currently defined - <parameter>"catalog"</parameter>, <parameter>"schema"</parameter> - and <parameter>"user"</parameter> triple, so that any sesam - function called after <function>sesam_disconnect</function> will - fail. + <function>sesam_disconnect</function> は、持続的なリンクを閉じず、 + 現在、定義されている <parameter>"catalog"</parameter>、 + <parameter>"schema"</parameter>、<parameter>"user"</parameter> の + 組を無効にするだけです。このため、 + <function>sesam_disconnect</function> の後でコールされた SESAM 関 + 数は失敗します。 </para> <para> - See also: <function>sesam_connect</function>. + <function>sesam_connect</function>も参照下さい。 <example> - <title>Closing a SESAM connection</title> + <title>SESAM 接続を閉じる</title> <programlisting role="php"> if (sesam_connect ("mycatalog", "myschema", "otto")) { -... some queries and stuff ... +... クエリ等 ... sesam_disconnect(); } </programlisting> </example> @@ -597,35 +592,35 @@ </funcprototype> </funcsynopsis> <para> - Returns: <literal>TRUE</literal> if the values are valid, and the - <function>settransaction</function> operation was successful, - <literal>FALSE</literal> otherwise. + 返り値: <function>settransaction</function> 処理が成功して、 + 有効な場合に <literal>TRUE</literal>、その他の場合に + <literal>FALSE</literal>。 </para> <para> - <function>sesam_settransaction</function> overrides the default - values for the "isolation level" and "read-only" transaction - parameters (which are set in the SESAM configuration file), in - order to optimize subsequent queries and guarantee database - consistency. The overridden values are used for the next transaction - only. + <function>sesam_settransaction</function> は、(SESAM設定ファイル + で設定される)トランザクションパラメータ "isolation level" と + "read-only" のデフォルト値を上書きします。これは、連続するクエリ + を最適化し、データベースの統一性を保証するためです。上書きされた + 値は、次のトランザクションでのみ使用されます。 </para> <para> - <function>sesam_settransaction</function> can only be called before - starting a transaction, not after the transaction has been started - already. + <function>sesam_settransaction</function> は、トランザクションを + 開始する前にのみコールすることが可能で、既にトランザクションが開 + 始されている場合には、コールすることができません。 </para> <para> - To simplify the use in php scripts, the following constants have - been predefined in php (see SESAM handbook for detailed - explanation of the semantics): + PHPスクリプトの使用を簡単にするには、次の定数が、PHPで定義されて + います。(意味の詳細についてはSESAMハンドブックを参照) <table> - <title>Valid values for <parameter>"Isolation_Level"</parameter> parameter</title> + <title> + <parameter>"Isolation_Level"</parameter>パラメータの有効な値 + </title> <tgroup cols="3"> <thead> <row> - <entry>Value</entry> - <entry>Constant</entry> - <entry>Meaning</entry> + <entry>値</entry> + <entry>定数</entry> + <entry>意味</entry> </row> </thead> <tbody> @@ -653,13 +648,15 @@ </tgroup> </table> <table> - <title>Valid values for <parameter>"Read_Only"</parameter> parameter</title> + <title> + <parameter>"Read_Only"</parameter> パラメータの有効な値 + </title> <tgroup cols="3"> <thead> <row> - <entry>Value</entry> - <entry>Constant</entry> - <entry>Meaning</entry> + <entry>値</entry> + <entry>定数</entry> + <entry>意味</entry> </row> </thead> <tbody> @@ -678,13 +675,13 @@ </table> </para> <para> - The values set by <function>sesam_settransaction</function> will - override the default setting specified in the <link - linkend="ini.sesam-configfile">SESAM configuration file</link>. + <function>sesam_settransaction</function> により設定された値は、 + <link linkend="ini.sesam-configfile">SESAM 設定ファイル</link>で + 指定されたデフォルト設定を上書きします。 </para> <para> <example> - <title>Setting SESAM transaction parameters</title> + <title>SESAM トランザクションパラメータを設定する</title> <programlisting role="php"> &lt;?php sesam_settransaction(SESAM_TXISOL_REPEATABLE_READ, @@ -699,7 +696,9 @@ <refentry id="function.sesam-commit"> <refnamediv> <refname>sesam_commit</refname> - <refpurpose>SESAMデータベースへの待機中の更新処理をコミットする</refpurpose> + <refpurpose> + SESAMデータベースへの待機中の更新処理をコミットする + </refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -718,20 +717,17 @@ への更新処理をコミットします。 </para> <para> - 他のデータベースのように"自動コミット"機能がないため、 - - Note that there is no "auto-commit" feature as in other databases, - as it could lead to accidental data loss. Uncommitted data at - the end of the current script (or when calling - <function>sesam_disconnect</function>) will be discarded by an - implied <function>sesam_rollback</function> call. + 他のデータベースのように"自動コミット"機能がないため、事故により + データが失われる可能性があることに注意して下さい。カレントのスク + リプト実行終了時にコミットされていないデータは、暗黙の + <function>sesam_rollback</function> コールにより破棄されます。 </para> <para> </para> <para> - See also: <function>sesam_rollback</function>. + <function>sesam_rollback</function>も参照下さい。 <example> - <title>Committing an update to the SESAM database</title> + <title>SESAM データベースの更新をコミットする</title> <programlisting role="php"> &lt;?php if (sesam_connect ("mycatalog", "myschema", "otto")) { @@ -750,7 +746,9 @@ <refentry id="function.sesam-rollback"> <refnamediv> <refname>sesam_rollback</refname> - <refpurpose>Discard any pending updates to the SESAM database</refpurpose> + <refpurpose> + SESAMデータベースに対する待機中の更新を破棄する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -761,24 +759,22 @@ </funcprototype> </funcsynopsis> <para> - Returns: <literal>TRUE</literal> on success, - <literal>FALSE</literal> on errors + 返り値: 成功時に <literal>TRUE</literal>、エラー時に + <literal>FALSE</literal> </para> <para> - <function>sesam_rollback</function> discards any pending updates to - the database. Also affected are result cursors and result - descriptors. + <function>sesam_rollback</function> は、データベースへの待機中の + 更新を破棄します。結果カーソルと結果記述子も変更されます。 </para> <para> - At the end of each script, and as part of the - <function>sesam_disconnect</function> function, an implied - <function>sesam_rollback</function> is executed, discarding any - pending changes to the database. + スクリプトの終了時に、<function>sesam_disconnect</function> 関数 + から暗黙のうちに <function>sesam_rollback</function>が実行され、 + データベースの待機中の全ての変更は破棄されます。 </para> <para> - See also: <function>sesam_commit</function>. + <function>sesam_commit</function>も参照下さい。 <example> - <title>Discarding an update to the SESAM database</title> + <title>SESAM データベースへの更新を破棄する</title> <programlisting role="php"> &lt;?php if (sesam_connect ("mycatalog", "myschema", "otto")) { @@ -798,7 +794,7 @@ <refentry id="function.sesam-execimm"> <refnamediv> <refname>sesam_execimm</refname> - <refpurpose>Execute an "immediate" SQL-statement</refpurpose> + <refpurpose>SQL命令を直ちに実行する</refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -809,32 +805,30 @@ </funcprototype> </funcsynopsis> <para> - Returns: A SESAM "result identifier" on success, or - <literal>FALSE</literal> on error. + 返り値: 成功時にSESAM "結果ID"、エラー時に + <literal>FALSE</literal> </para> <para> - <function>sesam_execimm</function> executes an "immediate" - statement (i.e., a statement like UPDATE, INSERT or DELETE which - returns no result, and has no INPUT or OUTPUT variables). - "select type" queries can not be used with - <function>sesam_execimm</function>. Sets the - <parameter>affected_rows</parameter> value for retrieval by the - <function>sesam_affected_rows</function> function. - </para> - <para> - Note that <function>sesam_query</function> can handle both - "immediate" and "select-type" queries. Use - <function>sesam_execimm</function> only if you know beforehand - what type of statement will be executed. - An attempt to use SELECT type queries with - <function>sesam_execimm</function> will return - <literal>$err["sqlstate"] == "42SBW"</literal>. - </para> - <para> - The returned "result identifier" can not be used for retrieving - anything but the <function>sesam_affected_rows</function>; it is - only returned for symmetry with the - <function>sesam_query</function> function. + <function>sesam_execimm</function> は命令(すなわち、UPDATE、 + INSERT、DELETEのような結果を返さない命令や入出力変数がない命令)を + "直ちに"実行します。"select 型" クエリは、 + <function>sesam_execimm</function> で使用することはできません。 + <function>sesam_affected_rows</function> 関数により取得可能な + <parameter>affected_rows</parameter> の値を設定します。 + </para> + <para> + <function>sesam_query</function> は、"即時型"および"select型"クエ + リの両方を処理することができることに注意して下さい。実行される命 + 令の型が事前に分かっている場合にのみ + <function>sesam_execimm</function> を使用して下さい。SELECT型クエ + リを使用しようとすると、<function>sesam_execimm</function>は + <literal>$err["sqlstate"] == "42SBW"</literal>を返します。 + </para> + <para> + 返される"結果ID"は、何かを取得する際に使用することはできず、 + <function>sesam_affected_rows</function> を実行する際に使用します。 + このIDは、<function>sesam_query</function> 関数と対称性を保つため + にのみ返されます。 </para> <para> <informalexample> @@ -847,8 +841,8 @@ sesam_affected_rows($result)."\n"); </programlisting> </informalexample> - See also: <function>sesam_query</function> and - <function>sesam_affected_rows</function>. + <function>sesam_query</function> および + <function>sesam_affected_rows</function>も参照下さい。 </para> </refsect1> </refentry> @@ -856,13 +850,13 @@ <refentry id="function.sesam-query"> <refnamediv> <refname>sesam_query</refname> - <refpurpose>Perform a SESAM SQL query and prepare the result</refpurpose> + <refpurpose>SESAM SQL クエリを実行し、結果を準備する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>string <function>sesam_query</function></funcdef> + <funcdef>resource <function>sesam_query</function></funcdef> <paramdef>string <parameter>query</parameter></paramdef> <paramdef>boolean <parameter><optional>scrollable</optional></parameter> @@ -870,66 +864,62 @@ </funcprototype> </funcsynopsis> <para> - Returns: A SESAM "result identifier" on success, or - <literal>FALSE</literal> on error. + 返り値: 成功時にSESAM "結果ID" またはエラー時に + <literal>FALSE</literal>。 </para> <para> - A "result_id" resource is used by other functions to retrieve the - query results. + "result_id"リソースは、クエリ結果を取得する際に他の関数で使用され + ます。 </para> <para> - <function>sesam_query</function> sends a query to the currently - active database on the server. It can execute both - "immediate" SQL statements and "select type" queries. If an - "immediate" statement is executed, then no cursor is allocated, - and any subsequent <function>sesam_fetch_row</function> or - <function>sesam_fetch_result</function> call will return an empty - result (zero columns, indicating end-of-result). - For "select type" statements, a result descriptor and a - (scrollable or sequential, depending on the optional - boolean <parameter>scrollable</parameter> parameter) cursor will - be allocated. If <parameter>scrollable</parameter> is omitted, - the cursor will be sequential. + <function>sesam_query</function> は、クエリをサーバ上の現在アクティ + ブなデータベースに送信します。この関数は、"即時"SQL命令および + "select型"クエリの両方を実行可能です。"即時型"命令を実行した場合、 + カーソルは確保されず、この後に + <function>sesam_fetch_row</function> または + <function>sesam_fetch_result</function> をコールしても空の結果(結 + 果の終端を示すカラム数0)が返されます。"select型"命令の場合、結果 + 記述子および(オプションのパラメータ + <parameter>scrollable</parameter>の設定によりスクロール型または連 + 続型の)カーソルが確保されます。<parameter>scrollable</parameter> + が省略された場合、カーソルは連続型となります。 </para> <para> - When using "scrollable" cursors, the cursor can be freely - positioned on the result set. For each "scrollable" query, - there are global default values for the scrolling type - (initialized to: <literal>SESAM_SEEK_NEXT</literal>) and - the scrolling offset which can either be set once - by <function>sesam_seek_row</function> or - each time when fetching a row using - <function>sesam_fetch_row</function>. + "スクロール型"カーソルを使用している場合、カーソルは結果集合上を + 自由に移動可能です。各"スクロール型"クエリに関して、スクロール型 + のグローバルデフォルト値(<literal>SESAM_SEEK_NEXT</literal>に初期 + 化されています)と <function>sesam_seek_row</function> により一度 + 設定するか、<function>sesam_fetch_row</function> を使用してレコー + ドを取得する度に設定するスクロールオフセットがあります。 </para> <para> - For "immediate" statements, the number of affected - rows is saved for retrieval by the - <function>sesam_affected_rows</function> function. + "即時型"命令の場合、作用されたレコードの数が保存されます。この数 + は、<function>sesam_affected_rows</function> 関数で取得可能です。 </para> <para> - See also: <function>sesam_fetch_row</function> and - <function>sesam_fetch_result</function>. + <function>sesam_fetch_row</function> および + <function>sesam_fetch_result</function> も参照下さい。 <example> <title> - Show all rows of the "phone" table as a html table + "phone"テーブルの全てのレコードをHTMLテーブルとして表示 </title> <programlisting role="php"> &lt;?php if (!sesam_connect("phonedb", "demo", "otto")) - die("cannot connect"); + die("接続できません"); $result = sesam_query("select * from phone"); if (!$result) { $err = sesam_diagnostic(); die($err["errmsg"]); } echo "&lt;TABLE BORDER&gt;\n"; -// Add title header with column names above the result: +// 上の結果カラム名でタイトルヘッダを追加する if ($cols = sesam_field_array($result)) { echo " &lt;TR&gt;&lt;TH COLSPAN=".$cols["count"]."&gt;Result:&lt;/TH&gt;&lt;/TR&gt;\n"; echo " &lt;TR&gt;\n"; for ($col = 0; $col &lt; $cols["count"]; ++$col) { $colattr = $cols[$col]; - /* Span the table head over SESAM's "Multiple Fields": */ + /* SESAMの"複数テーブル"にまたがらテーブルヘッドを展開: */ if ($colattr["count"] &gt; 1) { echo " &lt;TH COLSPAN=".$colattr["count"]."&gt;".$colattr["name"]. "(1..".$colattr["count"].")&lt;/TH&gt;\n"; @@ -942,7 +932,7 @@ } do { - // Fetch the result in chunks of 100 rows max. + // 最大100レコード分の結果を取得 $ok = sesam_fetch_result($result,100); for ($row=0; $row &lt; $ok["rows"]; ++$row) { echo " &lt;TR&gt;\n"; @@ -954,9 +944,9 @@ } echo " &lt;/TR&gt;\n"; } -} while ($ok["truncated"]); // while there may be more data +} while ($ok["truncated"]); // まだデータがある可能性がある間 echo "&lt;/TABLE&gt;\n"; -// free result id +// 結果IDを開放 sesam_free_result($result); ?&gt; </programlisting> @@ -968,7 +958,7 @@ <refentry id="function.sesam-num-fields"> <refnamediv> <refname>sesam_num_fields</refname> - <refpurpose>Return the number of fields/columns in a result set</refpurpose> + <refpurpose>結果集合のフィールド/カラム数を返す</refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -978,23 +968,20 @@ <paramdef>string <parameter>result_id</parameter></paramdef> </funcprototype> </funcsynopsis> + <para> + "select型"クエリで <function>sesam_query</function>をコールした後、 + この関数により結果のカラム数を得ることが可能です。全体のカラム(ま + たはフィールド)の数を記述する整数を返します。 + </para> + <para> + "即時型"命令の場合、値0が返されます。SESAM"複数フィールド"カラム + は、それぞれの次元毎に数えられます。すなわち、"複数フィールド"の3 + カラムはカラム3つとして数えられます。 + </para> <para> - After calling <function>sesam_query</function> with a - "select type" query, this function gives you the - number of columns in the result. - Returns an integer describing the total number of columns (aka. - fields) in the current <parameter>result_id</parameter> result - set or <literal>FALSE</literal> on error. - </para> - <para> - For "immediate" statements, the value zero is returned. The SESAM - "multiple field" columns count as their respective dimension, - i.e., a three-column "multiple field" counts as three columns. - </para> - <para> - See also: <function>sesam_query</function> and - <function>sesam_field_array</function> for a way to distinguish - between "multiple field" columns and regular columns. + "複数フィールド"カラムよ標準カラムを区別するには、 + <function>sesam_query</function> および + <function>sesam_field_array</function> も参照下さい。 </para> </refsect1> </refentry> @@ -1003,7 +990,7 @@ <refnamediv> <refname>sesam_field_name</refname> <refpurpose> - Return one column name of the result set + 結果集合のカラム名を返す </refpurpose> </refnamediv> <refsect1> @@ -1016,28 +1003,31 @@ </funcprototype> </funcsynopsis> <para> - Returns the name of a field (i.e., the column name) in the result - set, or <literal>FALSE</literal> on error. + 結果集合の中のフィールド名(すなわち、カラム名)またはエラーの際に + <literal>FALSE</literal> を返します。 </para> <para> - For "immediate" queries, or for dynamic columns, an empty string - is returned. + "即時型"クエリまたは動的なカラムの場合、空の文字列が返されます。 </para> - <note><para> - The column index is zero-based, not one-based as in SESAM. - </para></note> + <note> + <para> + カラムの添字は、SESAMのように1から始まらず、0から始まります。 + </para> + </note> <para> - See also: <function>sesam_field_array</function>. It provides an - easier interface to access the column names and types, and allows - for detection of "multiple fields". + <function>sesam_field_array</function> も参照下さい。この関数は、 + カラム名および型により簡単にアクセスするインターフェースを提供し、 + "複数フィールド"の検出が可能になります。 </para> </refsect1> </refentry> - + <refentry id="function.sesam-diagnostic"> <refnamediv> <refname>sesam_diagnostic</refname> - <refpurpose>直近のSESAMコールに関するステータス情報を返す</refpurpose> + <refpurpose> + 直近のSESAMコールに関するステータス情報を返す + </refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -1048,48 +1038,53 @@ </funcprototype> </funcsynopsis> <para> - Returns an associative array of status and return codes for the - last SQL query/statement/command. - Elements of the array are: + 直近のSQLクエリ/命令/コマンドに関するステータスおよびエラーコード + を連想配列として返します。配列の要素は次のようになります。 <table> <title> - Status information returned by <function>sesam_diagnostic</function> + <function>sesam_diagnostic</function>により返されるステータス情報 </title> <tgroup cols="2"> <thead> <row> - <entry>Element</entry> - <entry>Contents</entry> + <entry>要素</entry> + <entry>内容</entry> </row> </thead> <tbody> <row> - <entry>$array["sqlstate"]</entry> - <entry>5 digit SQL return code (see the SESAM manual for the - description of the possible values of SQLSTATE)</entry> + <entry>$array["sqlstate"]</entry> + <entry> + 5 桁の SQL リターンコード (SQLSTATEの値の説明については、 + SESAMマニュアル参照) + </entry> </row> <row> - <entry>$array["rowcount"]</entry> - <entry>number of affected rows in last update/insert/delete - (set after "immediate" statements only) + <entry>$array["rowcount"]</entry> + <entry> + 直近のupdate/insert/deleteクエリで作用されたレコードの数 + ("即時型"命令の後でのみ設定されます) </entry> </row> <row> <entry>$array["errmsg"]</entry> - <entry>"human readable" error message string - (set after errors only) + <entry> + "可読な" エラーメッセージ文字列 + (エラーの後でのみ設定されます) </entry> </row> <row> <entry>$array["errcol"]</entry> - <entry>error column number of previous error - (0-based; or -1 if undefined. Set after errors only) + <entry> + 以前のエラーのエラーカラム番号 + (0から始まり、未定義の場合は-1。エラーの後でのみ設定されます) </entry> </row> <row> <entry>$array["errlin"]</entry> - <entry>error line number of previous error - (0-based; or -1 if undefined. Set after errors only) + <entry> + 前のエラーのエラー行番号 + (0から始まり、未定義の場合は-1。エラーの後でのみ設定されます) </entry> </row> </tbody> @@ -1097,20 +1092,18 @@ </table> </para> <para> - In the following example, a syntax error (E SEW42AE ILLEGAL - CHARACTER) is displayed by including the offending SQL statement - and pointing to the error location: + 次の例では、問題があるSQL命令を含み、エラー位置を指す構文エラー(E + SEW42AE ILLEGAL CHARACTER)が表示されます。 <example> - <title>Displaying SESAM error messages with error position</title> + <title>エラー位置を付けてSESAMエラーメッセージを表示</title> <programlisting role="php"> &lt;?php -// Function which prints a formatted error message, -// displaying a pointer to the syntax error in the -// SQL statement +// フォーマットされたエラーメッセージを出力する関数 +// SQL命令における構文エラーの場所を表示 function PrintReturncode($exec_str) { $err = Sesam_Diagnostic(); - $colspan=4; // 4 cols for: sqlstate, errlin, errcol, rowcount + $colspan=4; // sqlstate, errlin, errcol, rowcount 用の4つのカラム if ($err["errlin"] == -1) --$colspan; if ($err["errcol"] == -1) @@ -1124,7 +1117,7 @@ echo "&lt;TR&gt;&lt;TD COLSPAN=".$colspan."&gt;&lt;PRE&gt;\n"; $errstmt = $exec_str."\n"; for ($lin=0; $errstmt != ""; ++$lin) { - if ($lin != $err["errlin"]) { // $lin is less or greater than errlin + if ($lin != $err["errlin"]) { // $lin はerrlinより小さいかまたは大きい if (! ($i = strchr($errstmt, "\n"))) $i = ""; $line = substr($errstmt, 0, strlen($errstmt)-strlen($i)+1); @@ -1161,7 +1154,7 @@ } if (!sesam_connect("mycatalog", "phoneno", "otto")) - die("cannot connect"); + die("接続できません"); $stmt = "SELECT * FROM phone\n". " WHERE@ LASTNAME='KRAEMER'\n". @@ -1173,8 +1166,8 @@ </example> </para> <para> - See also: <function>sesam_errormsg</function> for simple access to the - error string only + エラー文字列に簡単にアクセスするためには、 + <function>sesam_errormsg</function> も参照下さい。 </para> </refsect1> </refentry> @@ -1198,9 +1191,10 @@ </funcprototype> </funcsynopsis> <para> - Returns a mixed array with the query result entries, optionally - limited to a maximum of <parameter>max_rows</parameter> rows. - Note that both row and column indexes are zero-based. + クエリ結果のエントリを種々の型の配列として返します。オプションで + 最大レコード数を <parameter>max_rows</parameter> に制限することが + 可能です。レコード番号およびカラム番号は共に0から始まることに注意 + して下さい。 <table> <title> <function>sesam_fetch_result</function>により返された種々の結果集合 @@ -1215,57 +1209,59 @@ <tbody> <row> <entry>int $arr["count"]</entry> - <entry>number of columns in result set (or zero if this was an - "immediate" query)</entry> + <entry> + 結果集合のカラム数 ("即時型"クエリの場合に0) + </entry> </row> <row> <entry>int $arr["rows"]</entry> - <entry>number of rows in result set (between zero and - <parameter>max_rows</parameter>)</entry> + <entry> + 結果集合のレコード数(0と<parameter>max_rows</parameter>の間) + </entry> </row> <row> <entry>boolean $arr["truncated"]</entry> - <entry><literal>TRUE</literal> if the number of rows was at least - <parameter>max_rows</parameter>, <literal>FALSE</literal> otherwise. Note - that even when this is <literal>TRUE</literal>, the next - <function>sesam_fetch_result</function> call may return - zero rows because there are no more result entries. - </entry> + <entry> + レコード数が<parameter>max_rows</parameter>以上の場合に + <literal>TRUE</literal>、そうでない場合に + <literal>FALSE</literal>。これが <literal>TRUE</literal>でな + い場合でも、結果エントリはもうないために次の + <function>sesam_fetch_result</function> はレコードを返さない + 可能性があります。 + </entry> </row> <row> <entry>mixed $arr[col][row]</entry> - <entry>result data for all the fields at - row(<literal>row</literal>) and - column(<literal>col</literal>), (where the integer - index <literal>row</literal> is - between 0 and <literal>$arr["rows"]-1</literal>, and - <literal>col</literal> is between 0 - and <literal>$arr["count"]-1</literal>). Fields - may be empty, so you must check for the existence of a - field by using the php <function>isset</function> - function. The type of the returned fields depend on the - respective SQL type declared for its column (see <link - linkend="ref.sesam">SESAM overview</link> for the - conversions applied). SESAM "multiple - fields" are "inlined" and treated like a sequence - of columns. + <entry> + レコード(<literal>row</literal>) および + カラム(<literal>col</literal>)にある全てのフィールドの結果デー + タ、(整数のレコード番号<literal>row</literal>は0から + <literal>$arr["rows"]-1</literal>の間であり、 + <literal>col</literal> は 0 から + <literal>$arr["count"]-1</literal>の間です)。フィールドは空 + である可能性があり、このため、PHPの + <function>isset</function> 関数を使用してフィールドが存在す + るかどうか確認する必要があります。返されるフィールドの型は、 + そのカラムのSQL型宣言(適用される変換については<link + linkend="ref.sesam">SESAM 概要</link>参照)に依存します。 + SESAM "複数フィールド" は"インライン"であり、カラムの番号と + 同様に処理されます。 </entry> </row> </tbody> </tgroup> </table> - Note that the amount of memory used up by a large query may be - gigantic. Use the <parameter>max_rows</parameter> parameter to - limit the maximum number of rows returned, unless you are - absolutely sure that your result will not use up all available - memory. + 大きなクエリで使用されるメモリの最大値は、巨大なものになる可能性 + があることに注意して下さい。結果が利用可能な全メモリを消費しない + ことが確実である場合以外は、返されるレコード数の最大値を制限する + ために <parameter>max_rows</parameter> パラメータを使用して下さい。 </para> <para> - See also: <function>sesam_fetch_row</function>, and - <function>sesam_field_array</function> to check for "multiple - fields". See the description of the - <function>sesam_query</function> function for a complete example - using <function>sesam_fetch_result</function>. + "複数フィールド"を確認するために + <function>sesam_fetch_row</function>および + <function>sesam_field_array</function> も参照下さい。 + <function>sesam_fetch_result</function>の完全な例については、 + <function>sesam_query</function> 関数の説明を参照下さい。 </para> </refsect1> </refentry> @@ -1286,31 +1282,30 @@ </funcprototype> </funcsynopsis> <para> - <parameter>result_id</parameter> is a valid result id returned by - <function>sesam_query</function>. + <parameter>result_id</parameter> は、 + <function>sesam_query</function> により返された有効な結果IDです。 </para> <para> - Returns the number of rows affected by a query associated with - <parameter>result_id</parameter>. + <parameter>result_id</parameter> に関連するクエリにより作用された + レコード数を返します。 </para> <para> - The <function>sesam_affected_rows</function> function can only - return useful values when used in combination with "immediate" SQL - statements (updating operations like <literal>INSERT</literal>, - <literal>UPDATE</literal> and <literal>DELETE</literal>) because - SESAM does not deliver any "affected rows" information for "select - type" queries. - The number returned is the number of affected rows. + <function>sesam_affected_rows</function> 関数は、"即時型"SQL命令 + (<literal>INSERT</literal>、<literal>UPDATE</literal>、 + <literal>DELETE</literal>のような更新処理)の組合せで使用された場 + 合にのみ有用な値を返します。これは、SESAMが"select型"クエリに関し + て"作用されたレコード"に関する情報を返さないためです。返される数 + は作用されたレコードの数です。 </para> <para> - See also: <function>sesam_query</function> and - <function>sesam_execimm</function> + <function>sesam_query</function> および + <function>sesam_execimm</function> も参照下さい。 </para> <informalexample> <programlisting role="php"> $result = sesam_execimm ("DELETE FROM PHONE WHERE LASTNAME = '".strtoupper($name)."'"); if (! $result) { - ... error ... + ... エラー ... } print sesam_affected_rows($result). " entries with last name ".$name." deleted.\n" @@ -1333,8 +1328,7 @@ </funcprototype> </funcsynopsis> <para> - Returns the SESAM error message associated with the most - recent SESAM error. + 直近のSESAMエラーに関連する SESAMエラーメッセージを返します。 </para> <informalexample> <programlisting role="php"> @@ -1343,8 +1337,8 @@ </programlisting> </informalexample> <para> - See also: <function>sesam_diagnostic</function> for the full set - of SESAM SQL status information + SESAM SQLステータス情報の完全な集合については、 + <function>sesam_diagnostic</function> も参照下さい。 </para> </refsect1> </refentry> @@ -1365,180 +1359,172 @@ </funcprototype> </funcsynopsis> <para> - <parameter>result_id</parameter> is a valid result id returned by - <function>sesam_query</function>. + <parameter>result_id</parameter> は、 + <function>sesam_query</function> により返された有効な結果IDです。 </para> <para> - Returns a mixed associative/indexed array with meta information - (column name, type, precision, ...) about individual columns of the result after the - query associated with <parameter>result_id</parameter>. + <parameter>result_id</parameter>に関連したクエリの後で、結果の個々 + のカラムに関するメタ情報(カラム名、型、精度、...)を有する連想/æ·» + 字配列を返します。 </para> <para> <table> <title> - Mixed result set returned by <function>sesam_field_array</function> + <function>sesam_field_array</function> で返された結果集合 </title> <tgroup cols="2"> <thead> <row> - <entry>Array Element</entry> - <entry>Contents</entry> + <entry>配列要素</entry> + <entry>定数</entry> </row> </thead> <tbody> <row> <entry>int $arr["count"]</entry> - <entry>Total number of columns in result set (or zero if - this was an "immediate" query). SESAM "multiple - fields" are "inlined" and treated like the - respective number of columns. + <entry> + 結果集合におけるカラム数の合計 (または"即時型"クエリの場合に + 0)。 SESAM "複数フィールド"はインライン化されており、対応す + るカラム番号と同様に処理されます。 </entry> </row> <row> <entry>string $arr[col]["name"]</entry> - <entry>column name for column(<literal>col</literal>), - where <literal>col</literal> is between 0 and - <literal>$arr["count"]-1</literal>. The returned - value can be the empty string (for dynamically - computed columns). SESAM "multiple fields" are - "inlined" and treated like the respective number of - columns, each with the same column name. + <entry> + カラム(<literal>col</literal>)のカラム名、ただし、 + <literal>col</literal> は、0 から + <literal>$arr["count"]-1</literal>の間です。返される値は、 + (動的に計算されるカラムの場合、)空の文字列となる可能性があり + ます。SESAM "複数フィールド" は"インライン化"されており、カ + ラム番号と同様に同じカラム名で処理されます。 </entry> </row> <row> <entry>string $arr[col]["count"]</entry> - <entry>The "count" attribute describes the repetition - factor when the column has been declared as a - "multiple field". Usually, the "count" attribute is - 1. The first column of a "multiple field" column - however contains the number of repetitions (the - second and following column of the "multiple field" - contain a "count" attribute of 1). This can be used - to detect "multiple fields" in the result set. See - the example shown in the - <function>sesam_query</function> description for a - sample use of the "count" attribute. - </entry> + <entry> + 属性 "count" は、カラムが"複数フィールド"として宣言された場 + 合の繰り返し数を記述します。通常、"count"属性は1です。しかし、 + "複数フィールド"カラムの最初のカラムは繰返し数を有します。 + ("複数フィールド"の2番目以降のカラムは1という"count"属性を有 + します)この属性は、結果集合の中で"複数フィールド"を検出する + ために使用可能です。"count"属性の使用例については、 + <function>sesam_query</function> の説明に示されている例を参 + 照下さい。 + </entry> </row> <row> <entry>string $arr[col]["type"]</entry> - <entry>php variable type of the data for - column(<literal>col</literal>), where - <literal>col</literal> is between 0 - and <literal>$arr["count"]-1</literal>. The returned - value can be one of - <itemizedlist> - <listitem> - <simpara>"integer"</simpara> - </listitem> - <listitem> - <simpara>"double"</simpara> - </listitem> - <listitem> - <simpara>"string"</simpara> - </listitem> - </itemizedlist> - depending on the SQL type of the result. SESAM - "multiple fields" are "inlined" and treated like the - respective number of columns, each with the same php - type. - </entry> - </row> - <row> - <entry>string $arr[col]["sqltype"]</entry> - <entry>SQL variable type of the column data for - column(<literal>col</literal>), where - <literal>col</literal> is between 0 - and <literal>$arr["count"]-1</literal>. The returned - value can be one of - <itemizedlist> - <listitem> - <simpara>"CHARACTER"</simpara> - </listitem> - <listitem> - <simpara>"VARCHAR"</simpara> - </listitem> - <listitem> - <simpara>"NUMERIC"</simpara> - </listitem> - <listitem> - <simpara>"DECIMAL"</simpara> - </listitem> - <listitem> - <simpara>"INTEGER"</simpara> - </listitem> - <listitem> - <simpara>"SMALLINT"</simpara> - </listitem> - <listitem> - <simpara>"FLOAT"</simpara> - </listitem> - <listitem> - <simpara>"REAL"</simpara> - </listitem> - <listitem> - <simpara>"DOUBLE"</simpara> - </listitem> - <listitem> - <simpara>"DATE"</simpara> - </listitem> - <listitem> - <simpara>"TIME"</simpara> - </listitem> - <listitem> - <simpara>"TIMESTAMP"</simpara> - </listitem> - </itemizedlist> - describing the SQL type of the result. SESAM - "multiple fields" are "inlined" and treated like the - respective number of columns, each with the same SQL - type. + <entry> + カラム(<literal>col</literal>)に関するデータのPHP 変数型、た + だし、<literal>col</literal> は 0 と + <literal>$arr["count"]-1</literal> の間です。値は、結果のSQL + 型に基づき以下のどれかとなります。 + <itemizedlist> + <listitem> + <simpara>"integer"</simpara> + </listitem> + <listitem> + <simpara>"double"</simpara> + </listitem> + <listitem> + <simpara>"string"</simpara> + </listitem> + </itemizedlist> + SESAM "複数フィールド"は"インライン化"されており、同じカラム + 数を有し、同じPHP型の場合と同様に処理されます。 + </entry> + </row> + <row> + <entry>string $arr[col]["sqltype"]</entry> + <entry> + SQL variable type of the column data for + カラム(<literal>col</literal>)に関するカラムデータのSQL変数 + 型。ただし、<literal>col</literal> は 0 から + and <literal>$arr["count"]-1</literal>の間になります。返され + る値は、結果のSQL型を記述する次のどれかとなります。 + <itemizedlist> + <listitem> + <simpara>"CHARACTER"</simpara> + </listitem> + <listitem> + <simpara>"VARCHAR"</simpara> + </listitem> + <listitem> + <simpara>"NUMERIC"</simpara> + </listitem> + <listitem> + <simpara>"DECIMAL"</simpara> + </listitem> + <listitem> + <simpara>"INTEGER"</simpara> + </listitem> + <listitem> + <simpara>"SMALLINT"</simpara> + </listitem> + <listitem> + <simpara>"FLOAT"</simpara> + </listitem> + <listitem> + <simpara>"REAL"</simpara> + </listitem> + <listitem> + <simpara>"DOUBLE"</simpara> + </listitem> + <listitem> + <simpara>"DATE"</simpara> + </listitem> + <listitem> + <simpara>"TIME"</simpara> + </listitem> + <listitem> + <simpara>"TIMESTAMP"</simpara> + </listitem> + </itemizedlist> + SESAM "複数フィールド"は"インライン化"されており、同じカラム + 数、同じPHP型の場合と同様に処理されます。 </entry> </row> <row> <entry>string $arr[col]["length"]</entry> - <entry>The SQL "length" attribute of the SQL variable in - column(<literal>col</literal>), where - <literal>col</literal> is between 0 and - <literal>$arr["count"]-1</literal>. The "length" - attribute is used with "CHARACTER" and "VARCHAR" SQL - types to specify the (maximum) length of the string - variable. SESAM "multiple fields" are "inlined" and - treated like the respective number of columns, each with - the same length attribute. - </entry> + <entry> + カラム(<literal>col</literal>)のSQL変数のSQL "length" 属性。 + ただし、<literal>col</literal> は、0 から + <literal>$arr["count"]-1</literal>の間です。"length"属性は、 + 文字列変数の(最大)長さを指定するために"CHARACTER" および + "VARCHAR" SQL型を指定して使用されます。 + SESAM "複数フィールド"は"インライン化"されており、同じカラム + 数、同じPHP型の場合と同様に処理されます。 + </entry> </row> <row> <entry>string $arr[col]["precision"]</entry> - <entry>The "precision" attribute of the SQL variable in - column(<literal>col</literal>), where - <literal>col</literal> is between 0 and - <literal>$arr["count"]-1</literal>. The "precision" - attribute is used with numeric and time data types. - SESAM "multiple fields" are "inlined" and - treated like the respective number of columns, each with - the same precision attribute. - </entry> + <entry> + カラム(<literal>col</literal>にあるSQL変数,の + "precision" 属性。ただし、<literal>col</literal> は、0から + <literal>$arr["count"]-1</literal>の間です。"precision"属性 + は、数値および時間データ型で使用されます。 + SESAM "複数フィールド"は"インライン化"されており、同じカラム + 数、同じPHP型の場合と同様に処理されます。 + </entry> </row> <row> <entry>string $arr[col]["scale"]</entry> - <entry>The "scale" attribute of the SQL variable in - column(<literal>col</literal>), where - <literal>col</literal> is between 0 and - <literal>$arr["count"]-1</literal>. The "scale" - attribute is used with numeric data types. - SESAM "multiple fields" are "inlined" and - treated like the respective number of columns, each with - the same scale attribute. - </entry> + <entry> + カラム(<literal>col</literal>)にあるSQL変数の"scale" 属性。 + ただし、<literal>col</literal> は、0 から + <literal>$arr["count"]-1</literal>の間です。"scale"属性は、 + 数値データ型で使用されます。 + SESAM "複数フィールド"は"インライン化"されており、同じカラム + 数、同じPHP型の場合と同様に処理されます。 + </entry> </row> </tbody> </tgroup> </table> </para> <para> - See the <function>sesam_query</function> function - for an example of the <function>sesam_field_array</function> use. + <function>sesam_field_array</function> の使用例については、 + <function>sesam_query</function> 関数を参照下さい。 </para> </refsect1> </refentry> @@ -1546,7 +1532,7 @@ <refentry id="function.sesam-fetch-row"> <refnamediv> <refname>sesam_fetch_row</refname> - <refpurpose>レコードを1件配列として取得</refpurpose> + <refpurpose>1件分のレコードを配列として取得</refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -1563,132 +1549,137 @@ </funcprototype> </funcsynopsis> <para> - Returns an array that corresponds to the fetched row, - or <literal>FALSE</literal> if there are no more rows. + 取得したレコードを含む配列またはもうレコードがない場合に + <literal>FALSE</literal> を返します。 </para> - <para>The number of columns in the result set is returned in an - associative array element $array["count"]. Because some of the - result columns may be empty, the - <function>count</function> function can not be used on - the result row returned by - <function>sesam_fetch_row</function>. + <para> + 結果集合のカラム数が連想配列の要素 $array["count"] で返されます。 + いくつかのカラムは空である可能性があるため、 + <function>sesam_fetch_row</function> により返された結果レコードに + 対して <function>count</function> 関数を使用することはできません。 </para> <para> - <parameter>result_id</parameter> is a valid result id returned by - <function>sesam_query</function> (select type queries only!). + <parameter>result_id</parameter> は、 + <function>sesam_query</function> (select 型クエリのみ!)により返さ + れた有効な結果IDです。 </para> <para> - <parameter><optional>whence</optional></parameter> is an - optional parameter for a fetch operation on "scrollable" - cursors, which can be set to the following predefined - constants: + <parameter><optional>whence</optional></parameter> は、"スクロー + ル型"カーソルで取得処理を行うためのオプションパラメータで、次のよ + うな定義済みの定数を設定することが可能です。 <table> - <title>Valid values for <parameter>"whence"</parameter> parameter</title> + <title><parameter>"whence"</parameter> パラメータで有効な値</title> <tgroup cols="3"> <thead> <row> - <entry>Value</entry> - <entry>Constant</entry> - <entry>Meaning</entry> + <entry>値</entry> + <entry>定数</entry> + <entry>意味</entry> </row> </thead> <tbody> <row> - <entry>0</entry> - <entry><literal>SESAM_SEEK_NEXT</literal></entry> - <entry>read sequentially (after fetch, the internal default is - set to <literal>SESAM_SEEK_NEXT</literal>) - </entry> + <entry>0</entry> + <entry><literal>SESAM_SEEK_NEXT</literal></entry> + <entry> + 連続的に読み込む(取得後、内部デフォルト値は + <literal>SESAM_SEEK_NEXT</literal>に設定されます) + </entry> + </row> + <row> + <entry>1</entry> + <entry><literal>SESAM_SEEK_PRIOR</literal></entry> + <entry> + 連続的に後向きに読み込む (取得後、内部デフォルト値は + <literal>SESAM_SEEK_PRIOR</literal>に設定されます) + </entry> + </row> + <row> + <entry>2</entry> + <entry><literal>SESAM_SEEK_FIRST</literal></entry> + <entry> + 最初のレコードに移動(取得後、デフォルト値は + <literal>SESAM_SEEK_NEXT</literal>に設定されます) + </entry> + </row> + <row> + <entry>3</entry> + <entry><literal>SESAM_SEEK_LAST</literal></entry> + <entry> + 最後のレコードに移動 (取得後、デフォルト値は + <literal>SESAM_SEEK_PRIOR</literal>に設定されます) + </entry> + </row> + <row> + <entry>4</entry> + <entry><literal>SESAM_SEEK_ABSOLUTE</literal></entry> + <entry> + <parameter>offset</parameter> (0が先頭。取得後、内部デフォル + ト値は、<literal>SESAM_SEEK_ABSOLUTE</literal> に設定して下 + さい。内部のオフセット値は、自動的に増加します)で指定した絶 + 対レコード番号に移動します。 + </entry> + </row> + <row> + <entry>5</entry> + <entry><literal>SESAM_SEEK_RELATIVE</literal></entry> + <entry> + カレントのスクロール位置に対して相対位置に移動。ただし、 + <parameter>offset</parameter> は正または負の値を指定可能です。 + </entry> </row> - <row> - <entry>1</entry> - <entry><literal>SESAM_SEEK_PRIOR</literal></entry> - <entry>read sequentially backwards (after fetch, the internal - default is set to <literal>SESAM_SEEK_PRIOR</literal>) - </entry> - </row> - <row> - <entry>2</entry> - <entry><literal>SESAM_SEEK_FIRST</literal></entry> - <entry>rewind to first row (after fetch, the default is set to - <literal>SESAM_SEEK_NEXT</literal>)</entry> - </row> - <row> - <entry>3</entry> - <entry><literal>SESAM_SEEK_LAST</literal></entry> - <entry>seek to last row (after fetch, the default is set to - <literal>SESAM_SEEK_PRIOR</literal>)</entry> - </row> - <row> - <entry>4</entry> - <entry><literal>SESAM_SEEK_ABSOLUTE</literal></entry> - <entry>seek to absolute row number given as - <parameter>offset</parameter> (Zero-based. After fetch, - the internal default is - set to <literal>SESAM_SEEK_ABSOLUTE</literal>, and the - internal offset value is auto-incremented)</entry> - </row> - <row> - <entry>5</entry> - <entry><literal>SESAM_SEEK_RELATIVE</literal></entry> - <entry>seek relative to current scroll position, where - <parameter>offset</parameter> can be a positive or - negative offset value.</entry> - </row> </tbody> </tgroup> </table> - This parameter is only valid for "scrollable" cursors. + このパラメータは、"スクロール型"カーソルでのみ有効です。 </para> <para> - When using "scrollable" cursors, the cursor can be freely - positioned on the result set. If the - <parameter><optional>whence</optional></parameter> parameter - is omitted, the global default values for the scrolling type - (initialized to: <literal>SESAM_SEEK_NEXT</literal>, and - settable by <function>sesam_seek_row</function>) are used. If - <parameter><optional>whence</optional></parameter> is - supplied, its value replaces the global default. - </para> - <para> - <parameter><optional>offset</optional></parameter> is an - optional parameter which is only evaluated (and required) - if <parameter><optional>whence</optional></parameter> is - either <literal>SESAM_SEEK_RELATIVE</literal> or - <literal>SESAM_SEEK_ABSOLUTE</literal>. This - parameter is only valid for "scrollable" cursors. - </para> - <para> - <function>sesam_fetch_row</function> fetches one row of data - from the result associated with the specified result - identifier. The row is returned as an array (indexed by - values between <literal>0</literal> and - <literal>$array["count"]-1</literal>). Fields may be empty, - so you must check for the existence of a field by using the - php <function>isset</function> function. The type of the - returned fields depend on the respective SQL type declared for - its column (see <link linkend="ref.sesam">SESAM - overview</link> for the conversions applied). SESAM "multiple - fields" are "inlined" and treated like a sequence of columns. - </para> - <para> - Subsequent calls to <function>sesam_fetch_row</function> would - return the next (or prior, or n'th next/prior, depending on - the scroll attributes) row in the result set, or - <literal>FALSE</literal> if there are no - more rows. + "スクロール型"カーソルを使用している場合、カーソルは結果集合を自 + 由に移動可能です。 + <parameter><optional>whence</optional></parameter> パラメータが省 + 略された場合、スクロールの型には、グローバルなデフォルト値 + (<literal>SESAM_SEEK_NEXT</literal>に初期化されており、 + <function>sesam_seek_row</function>で設定可能です) が使用されます。 + <parameter><optional>whence</optional></parameter> が指定された場 + 合、その値はグローバルデフォルト値に置換されます。 + </para> + <para> + <parameter><optional>offset</optional></parameter> は、オプション + のパラメータであり、 + <parameter><optional>whence</optional></parameter> が + <literal>SESAM_SEEK_RELATIVE</literal> または + <literal>SESAM_SEEK_ABSOLUTE</literal> のどちらかである場合にのみ + 評価されます(そして必要とされます)。このパラメータは、"スクロール + 型"カーソルでのみ有効です。 + </para> + <para> + <function>sesam_fetch_row</function> は、指定した結果IDが指す結果 + から1件分のレコードのデータを取得します。レコードは、( + <literal>0</literal> から <literal>$array["count"]-1</literal> を + 添字とした)配列として返されます。フィールドは空である可能性がある + ため、PHP の <function>isset</function> 関数を使用してフィールド + の存在を確認する必要があります。返されるフィールドの型は、そのカ + ラムを宣言したSQL型に依存します。(適用される変換については、<link + linkend="ref.sesam">SESAMの概要</link> を参照下さい。 + SESAM "複数フィールド" は "インライン化" されており、連続するカラ + ムのように処理されます。 + </para> + <para> + <function>sesam_fetch_row</function> を連けてコールした場合、結果 + 集合の次の(スクロール属性に応じて前またはn番目の前/後)レコードま + たはレコードがもうない場合に <literal>FALSE</literal>を返します。 </para> <example> - <title>SESAM fetch rows</title> + <title>SESAM レコードを取得</title> <programlisting role="php"> &lt;?php $result = sesam_query (&quot;SELECT * FROM phone\n&quot;. &quot; WHERE LASTNAME='&quot;.strtoupper($name).&quot;'\n&quot;. &quot; ORDER BY FIRSTNAME&quot;, 1); if (! $result) { - ... error ... + ... エラー ... } -// print the table in backward order +// 逆順にテーブルを出力 print &quot;&lt;TABLE BORDER&gt;\n&quot;; $row = sesam_fetch_row ($result, SESAM_SEEK_LAST); while (is_array($row)) { @@ -1697,7 +1688,7 @@ print &quot; &lt;TD&gt;&quot;.htmlspecialchars($row[$col]).&quot;&lt;/TD&gt;\n&quot;; } print &quot; &lt;/TR&gt;\n&quot;; - // use implied SESAM_SEEK_PRIOR + // 暗黙の SESAM_SEEK_PRIOR を使用 $row = sesam_fetch_row ($result); } print &quot;&lt;/TABLE&gt;\n&quot;; @@ -1706,9 +1697,9 @@ </programlisting> </example> <para> - See also: <function>sesam_fetch_array</function> which returns - an associative array, and <function>sesam_fetch_result</function> - which returns many rows per invocation. + 連想配列を返す <function>sesam_fetch_array</function>、そして、 + 一度に多くのレコードを返す + <function>sesam_fetch_result</function> も参照下さい。 </para> </refsect1> </refentry> @@ -1733,73 +1724,66 @@ </funcprototype> </funcsynopsis> <para> - Returns an array that corresponds to the fetched row, - or <literal>FALSE</literal> if there are no more rows. + 取得したレコードに対応する配列またはレコードがもうない場合には + <literal>FALSE</literal> を返します。 </para> <para> - <function>sesam_fetch_array</function> is an alternative - version of <function>sesam_fetch_row</function>. Instead - of storing the data in the numeric indices of the result - array, it stores the data in associative indices, using the - field names as keys. + <function>sesam_fetch_array</function> は、 + <function>sesam_fetch_row</function> の連想配列版です。データを結 + 果配列の数値添字に保存する代わりに、データをフィールド名をキーと + して連想配列に保存します。 </para> <para> - <parameter>result_id</parameter> is a valid result id returned by - <function>sesam_query</function> (select type queries only!). + <parameter>result_id</parameter> は、 + <function>sesam_query</function> (select 型クエリのみ!)により返さ + れた有効な結果IDです。 </para> <para> - For the valid values of the optional - <parameter><optional>whence</optional></parameter>and - <parameter><optional>offset</optional></parameter> - parameters, see the <function>sesam_fetch_row</function> - function for details. + オプションの <parameter><optional>whence</optional></parameter> + および <parameter><optional>offset</optional></parameter> パラメー + タの有効な値の詳細については、関数 + <function>sesam_fetch_row</function> を参照下さい。 </para> <para> - <function>sesam_fetch_array</function> fetches one row of data from - the result associated with the specified result identifier. The - row is returned as an associative array. Each result - column is stored with an associative index equal to its - column (aka. field) name. The column names are converted to lower case. - + <function>sesam_fetch_array</function> は、 + 指定した結果IDが指す結果から1件分のレコードを取得します。レコード + は、連想配列として返されます。各結果カラムは、そのカラム(または + フィールド)名に等しい連想配列の要素に保存されます。カラム名は、小 + 文字に変換されます。 </para> <para> - Columns without a field name (e.g., results of arithmetic - operations) and empty fields are not stored in the array. - Also, if two or more columns of the result have the same - column names, the later column will take precedence. In - this situation, either call - <function>sesam_fetch_row</function> or make an alias for - the column. + フィールド名がないカラム(例えば、数値演算の結果)および空のフィー + ルドは、配列に保存されません。また、2つ以上の結果がカラム名に同じ + カラム名がある場合、最後のカラムが優先されます。この場合、 + <function>sesam_fetch_row</function>をコールするかそのカラムへの + エイリアスを作成して下さい。 <informalexample> <programlisting> -SELECT TBL1.COL AS FOO, TBL2.COL AS BAR FROM TBL1, TBL2</programlisting> +SELECT TBL1.COL AS FOO, TBL2.COL AS BAR FROM TBL1, TBL2 + </programlisting> </informalexample> </para> <para> - A special handling allows fetching "multiple field" - columns (which would otherwise all have the same column - names). For each column of a "multiple field", the - index name is constructed by appending the string "(n)" - where n is the sub-index of the multiple field column, - ranging from 1 to its declared repetition factor. The indices - are NOT zero based, in order to match the nomenclature - used in the respective query syntax. - For a column declared as: + 特別な処理により"複数フィールド"カラム(もしくは同じカラム名を有す + るカラム)を取得することが可能になります。"複数フィールド"の各カラ + ムに関して、添字名は、文字列"(n)"を付加することにより構築されます。 + ただし、n は複数フィールドのカラムの副添字であり、1から宣言済みの + 反復数までの範囲となります。クエリ構文で使用される表記に一致させ + るために添字はゼロを基準にしていません。 + 次のように宣言されているあるカラムの場合、 <informalexample> <programlisting role="sesam"> -CREATE TABLE ... ( ... MULTI(3) INT )</programlisting> +CREATE TABLE ... ( ... MULTI(3) INT ) + </programlisting> </informalexample> - the associative indices used for the individual "multiple field" - columns would be <literal>"multi(1)"</literal>, - <literal>"multi(2)"</literal>, and - <literal>"multi(3)"</literal> respectively. + 個々の"複数フィールド"カラムに関して連想添字は、それぞれ + <literal>"multi(1)"</literal>,<literal>"multi(2)"</literal>, + <literal>"multi(3)"</literal> になります。 </para> <para> - Subsequent calls to <function>sesam_fetch_array</function> would - return the next (or prior, or n'th next/prior, depending on - the scroll attributes) row in the result set, or - <literal>FALSE</literal> if there are no - more rows. + <function>sesam_fetch_array</function> を続けてコールした場合、結 + 果集合の次の(スクロール属性に応じて前またはn番目の前/後)レコードま + たはレコードがもうない場合に <literal>FALSE</literal>を返します。 </para> <example> <title>SESAM 取得配列</title> @@ -1809,9 +1793,9 @@ &quot; WHERE LASTNAME='&quot;.strtoupper($name).&quot;'\n&quot;. &quot; ORDER BY FIRSTNAME&quot;, 1); if (! $result) { - ... error ... + ... エラー ... } -// print the table: +// テーブルを出力します print &quot;&lt;TABLE BORDER&gt;\n&quot;; while (($row = sesam_fetch_array ($result)) && count($row) &gt; 0) { print &quot; &lt;TR&gt;\n&quot;; @@ -1826,8 +1810,7 @@ </programlisting> </example> <para> - See also: <function>sesam_fetch_row</function> which returns - an indexed array. + 添字配列を返す <function>sesam_fetch_row</function> も参照下さい。 </para> </refsect1> </refentry> @@ -1857,79 +1840,90 @@ した際に"スクロール可能な"カーソルが要求された場合のみ) </para> <para> - <parameter>whence</parameter> sets the global default value - for the scrolling type, it specifies the scroll type - to use in subsequent fetch operations on "scrollable" - cursors, which can be set to the following predefined - constants: + <parameter>whence</parameter> は、この後の"スクロール型"カーソル + の取得処理で使用されるスクロールの型を指定するスクロール型のグロー + バルなデフォルト値を設定し、次のような定義済みの定数を設定します。 <table> - <title>Valid values for <parameter>"whence"</parameter> parameter</title> + <title><parameter>"whence"</parameter> パラメータの有効な値</title> <tgroup cols="3"> <thead> <row> - <entry>Value</entry> - <entry>Constant</entry> - <entry>Meaning</entry> + <entry>値</entry> + <entry>定数</entry> + <entry>意味</entry> </row> </thead> <tbody> <row> - <entry>0</entry> - <entry><literal>SESAM_SEEK_NEXT</literal></entry> - <entry>read sequentially - </entry> + <entry>0</entry> + <entry><literal>SESAM_SEEK_NEXT</literal></entry> + <entry> + 連続的に読み込む + </entry> + </row> + <row> + <entry>1</entry> + <entry><literal>SESAM_SEEK_PRIOR</literal></entry> + <entry> + 連続的に後向きに読む + </entry> + </row> + <row> + <entry>1</entry> + <entry><literal>SESAM_SEEK_PRIOR</literal></entry> + <entry> + 連続的に後向きに読み込む (取得後、内部デフォルト値は + <literal>SESAM_SEEK_PRIOR</literal>に設定されます) + </entry> + </row> + <row> + <entry>2</entry> + <entry><literal>SESAM_SEEK_FIRST</literal></entry> + <entry> + 最初のレコードに移動(取得後、デフォルト値は + <literal>SESAM_SEEK_NEXT</literal>に設定されます) + </entry> + </row> + <row> + <entry>3</entry> + <entry><literal>SESAM_SEEK_LAST</literal></entry> + <entry> + 最後のレコードに移動 (取得後、デフォルト値は + <literal>SESAM_SEEK_PRIOR</literal>に設定されます) + </entry> + </row> + <row> + <entry>4</entry> + <entry><literal>SESAM_SEEK_ABSOLUTE</literal></entry> + <entry> + <parameter>offset</parameter> (0が先頭。取得後、内部デフォル + ト値は、<literal>SESAM_SEEK_ABSOLUTE</literal> に設定して下 + さい。内部のオフセット値は、自動的に増加します)で指定した絶 + 対レコード番号に移動します。 + </entry> + </row> + <row> + <entry>5</entry> + <entry><literal>SESAM_SEEK_RELATIVE</literal></entry> + <entry> + カレントのスクロール位置に対して相対位置に移動。ただし、 + <parameter>offset</parameter> は正または負の値を指定可能です。 + </entry> </row> - <row> - <entry>1</entry> - <entry><literal>SESAM_SEEK_PRIOR</literal></entry> - <entry>read sequentially backwards - </entry> - </row> - <row> - <entry>2</entry> - <entry><literal>SESAM_SEEK_FIRST</literal></entry> - <entry>fetch first row (after fetch, the default - is set to - <literal>SESAM_SEEK_NEXT</literal>)</entry> - </row> - <row> - <entry>3</entry> - <entry><literal>SESAM_SEEK_LAST</literal></entry> - <entry>fetch last row (after fetch, the default is - set to - <literal>SESAM_SEEK_PRIOR</literal>)</entry> - </row> - <row> - <entry>4</entry> - <entry><literal>SESAM_SEEK_ABSOLUTE</literal></entry> - <entry>fetch absolute row number given as - <parameter>offset</parameter> (Zero-based. After - fetch, the default is set to - <literal>SESAM_SEEK_ABSOLUTE</literal>, and the - offset value is auto-incremented)</entry> - </row> - <row> - <entry>5</entry> - <entry><literal>SESAM_SEEK_RELATIVE</literal></entry> - <entry>fetch relative to current scroll position, where - <parameter>offset</parameter> can be a positive or - negative offset value (this also sets the default - "offset" value for subsequent fetches).</entry> - </row> </tbody> </tgroup> </table> </para> <para> - <parameter><optional>offset</optional></parameter> is an - optional parameter which is only evaluated (and required) - if <parameter>whence</parameter> is - either <literal>SESAM_SEEK_RELATIVE</literal> or - <literal>SESAM_SEEK_ABSOLUTE</literal>. + <parameter><optional>offset</optional></parameter> は、オプション + のパラメータであり、<parameter>whence</parameter> が + <literal>SESAM_SEEK_RELATIVE</literal> または + <literal>SESAM_SEEK_ABSOLUTE</literal> のどちらかである場合にのみ + 評価されます(また必要とされます)。 </para> </refsect1> </refentry> - + <refentry id="function.sesam-free-result"> <refnamediv> <refname>sesam_free_result</refname>
« previous php.doc (#969333338) next »