downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

oci_field_scale> <oci_field_name
Last updated: Fri, 13 Nov 2009

view this page in

oci_field_precision

(PHP 5, PECL OCI8 >= 1.1.0)

oci_field_precisionフィールドの精度を問い合わせる

説明

int oci_field_precision ( resource $statement , int $field )

field の精度を返します。

FLOAT 型カラムの精度は 0 でなく桁数は -127 となります。 もし精度が 0 の場合、カラムは NUMBER 型、そうでなければ NUMBER(精度, 桁数) となります。

パラメータ

statement

有効な OCI ステートメント ID。

field

フィールド番号 (1 から始まる) あるいは名前のいずれか。

返り値

精度を表す整数値、あるいはエラー時に FALSE を返します。

注意

注意: PHP バージョン 5.0.0 以前では、代わりに ocicolumnprecision() を使用しなければなりません。 まだこの名前を使用することができ、下位互換性のため oci_field_precision() への別名として残されていますが、 推奨されません。

参考



add a note add a note User Contributed Notes
oci_field_precision
webmaster at smwebdesigns dot com
15-Oct-2007 09:58
I did not test well before posting previous code.  This if statement works and the other does not.

if( ocicolumnscale($R, $i ) != 129 )
{
    $int_decimal = ocicolumnscale($R, $i );
    $int_length = ocicolumnprecision($R, $i) - $int_decimal;
}
webmaster at smwebdesigns dot com
12-Oct-2007 04:39
I've found that when using ocicolumnprecision or oci_field_precision it will not show you the decimal places if you are are reading from tables with decimals.  You can use ocicolumnscale or oci_field_scale to find the decimal.

if( ocicolumnscale($R, $i ) > 0 )
{
    $int_decimal = ocicolumnscale($R, $i );
    $int_length = ocicolumnprecision($R, $i) - $int_decimal;
}

oci_field_scale> <oci_field_name
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites