function _ConvertFieldType(&$fld, $ftype, $flen, $fscale, $fsubtype, $fprecision, $dialect3)
	{
		$fscale = abs($fscale);
		$fld->max_length = $flen;
		$fld->scale = null;
		switch($ftype){
			case 7:
			case 8:
				if ($dialect3) {
					switch($fsubtype){
						case 0:
							$fld->type = ($ftype == 7 ? 'smallint' : 'integer');
							break;
						case 1:
							$fld->type = 'numeric';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
						case 2:
							$fld->type = 'decimal';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
					} // switch
				} else {
					if ($fscale !=0) {
						$fld->type = 'decimal';
						$fld->scale = $fscale;
						$fld->max_length = ($ftype == 7 ? 4 : 9);
					} else {
						$fld->type = ($ftype == 7 ? 'smallint' : 'integer');
					}
				}
				break;
			case 16:
				if ($dialect3) {
					switch($fsubtype){
						case 0:
							$fld->type = 'decimal';
							$fld->max_length = 18;
							$fld->scale = 0;
							break;
						case 1:
							$fld->type = 'numeric';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
						case 2:
							$fld->type = 'decimal';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
					} // switch
				}
				break;
			case 10:
				$fld->type = 'float';
				break;
			case 14:
				$fld->type = 'char';
				break;
			case 27:
				if ($fscale !=0) {
					$fld->type = 'decimal';
					$fld->max_length = 15;
					$fld->scale = 5;
				} else {
					$fld->type = 'double';
				}
				break;
			case 35:
				if ($dialect3) {
					$fld->type = 'timestamp';
				} else {
					$fld->type = 'date';
				}
				break;
			case 12:
				$fld->type = 'date';
				break;
			case 13:
				$fld->type = 'time';
				break;
			case 37:
				$fld->type = 'varchar';
				break;
			case 40:
				$fld->type = 'cstring';
				break;
			case 261:
				$fld->type = 'blob';
				$fld->max_length = -1;
				break;
		} // switch
	}
function _ConvertFieldType(&$fld, $ftype, $flen, $fscale, $fsubtype, $fprecision, $dialect3)
	{
		$fscale = abs($fscale);
		$fld->max_length = $flen;
		$fld->scale = null;
		switch($ftype){
			case 7:
			case 8:
				if ($dialect3) {
					switch($fsubtype){
						case 0:
							$fld->type = ($ftype == 7 ? 'smallint' : 'integer');
							break;
						case 1:
							$fld->type = 'numeric';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
						case 2:
							$fld->type = 'decimal';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
					} // switch
				} else {
					if ($fscale !=0) {
						$fld->type = 'decimal';
						$fld->scale = $fscale;
						$fld->max_length = ($ftype == 7 ? 4 : 9);
					} else {
						$fld->type = ($ftype == 7 ? 'smallint' : 'integer');
					}
				}
				break;
			case 16:
				if ($dialect3) {
					switch($fsubtype){
						case 0:
							$fld->type = 'decimal';
							$fld->max_length = 18;
							$fld->scale = 0;
							break;
						case 1:
							$fld->type = 'numeric';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
						case 2:
							$fld->type = 'decimal';
							$fld->max_length = $fprecision;
							$fld->scale = $fscale;
							break;
					} // switch
				}
				break;
			case 10:
				$fld->type = 'float';
				break;
			case 14:
				$fld->type = 'char';
				break;
			case 27:
				if ($fscale !=0) {
					$fld->type = 'decimal';
					$fld->max_length = 15;
					$fld->scale = 5;
				} else {
					$fld->type = 'double';
				}
				break;
			case 35:
				if ($dialect3) {
					$fld->type = 'timestamp';
				} else {
					$fld->type = 'date';
				}
				break;
			case 12:
				$fld->type = 'date';
				break;
			case 13:
				$fld->type = 'time';
				break;
			case 37:
				$fld->type = 'varchar';
				break;
			case 40:
				$fld->type = 'cstring';
				break;
			case 261:
				$fld->type = 'blob';
				$fld->max_length = -1;
				break;
		} // switch
	}
function _ConvertFieldType ( & $ fld , $ ftype , $ flen , $ fscale , $ fsubtype , $ fprecision , $ dialect3 ) { $ fscale = abs ( $ fscale ) ; $ fld -> max_length = $ flen ; $ fld -> scale = null ; switch ( $ ftype ) { case 7 : case 8 : if ( $ dialect3 ) { switch ( $ fsubtype ) { case 0 : $ fld -> type = ( $ ftype == 7 ? 'smallint' : 'integer' ) ; break ; case 1 : $ fld -> type = 'numeric' ; $ fld -> max_length = $ fprecision ; $ fld -> scale = $ fscale ; break ; case 2 : $ fld -> type = 'decimal' ; $ fld -> max_length = $ fprecision ; $ fld -> scale = $ fscale ; break ; } // switch } else { if ( $ fscale != 0 ) { $ fld -> type = 'decimal' ; $ fld -> scale = $ fscale ; $ fld -> max_length = ( $ ftype == 7 ? 4 : 9 ) ; } else { $ fld -> type = ( $ ftype == 7 ? 'smallint' : 'integer' ) ; } } break ; case 16 : if ( $ dialect3 ) { switch ( $ fsubtype ) { case 0 : $ fld -> type = 'decimal' ; $ fld -> max_length = 18 ; $ fld -> scale = 0 ; break ; case 1 : $ fld -> type = 'numeric' ; $ fld -> max_length = $ fprecision ; $ fld -> scale = $ fscale ; break ; case 2 : $ fld -> type = 'decimal' ; $ fld -> max_length = $ fprecision ; $ fld -> scale = $ fscale ; break ; } // switch } break ; case 10 : $ fld -> type = 'float' ; break ; case 14 : $ fld -> type = 'char' ; break ; case 27 : if ( $ fscale != 0 ) { $ fld -> type = 'decimal' ; $ fld -> max_length = 15 ; $ fld -> scale = 5 ; } else { $ fld -> type = 'double' ; } break ; case 35 : if ( $ dialect3 ) { $ fld -> type = 'timestamp' ; } else { $ fld -> type = 'date' ; } break ; case 12 : $ fld -> type = 'date' ; break ; case 13 : $ fld -> type = 'time' ; break ; case 37 : $ fld -> type = 'varchar' ; break ; case 40 : $ fld -> type = 'cstring' ; break ; case 261 : $ fld -> type = 'blob' ; $ fld -> max_length = - 1 ; break ; } // switch }
OPN STUFF start
OPN STUFF start