GetFieldDefType

설명

지정된 필드에 저장할 수 있는 데이터 유형을 식별합니다.

GetFieldDefNames 메소드를 사용하여 올바른 필드 이름의 목록을 얻을 수 있습니다.

레코드 유형은 해당 데이터 레코드의 각 필드에 저장할 수 있는 데이터 유형을 제어합니다. 필드에는 문자열, 숫자, 시간소인, 참조 등을 저장할 수 있습니다. (전체 목록은 FieldType 상수를 참조하십시오.)

EntityDef 오브젝트의 다른 부분처럼, 관리자는 Rational ClearQuest Designer를 사용하여 정의된 필드를 설정합니다. API에서 직접 설정할 수 없습니다.

구문

VBScript

entitydef.GetFieldDefType field_def_name 

Perl

$entitydef->GetFieldDefType(field_def_name); 
ID
설명
entitydef
스키마의 레코드 유형에 해당하는 EntityDef 오브젝트입니다.
field_def_name
entitydef의 유효한 필드 이름을 식별하는 문자열입니다.
Return value
이름 지정된 필드에 저장될 수 있는 데이터 유형을 지정하는 Long 값. 값은 FieldType 상수 중 하나에 해당합니다.

예제

VBScript

set sessionObj = GetSession 
set entityDefObj = sessionObj.GetEntityDef(GetEntityDefName())

sessionObj.OutputDebugString "Integer fields of " & _
            entityDefObj.GetName()

' List the field names in the record that contain integers
nameList = entityDefObj.GetFieldDefNames()
For Each fieldName in nameList
   fieldType = entityDefObj.GetFieldDefType(fieldName)
   if fieldType = AD_INT Then
      sessionObj.OutputDebugString fieldName
   End If 
Next

Perl

$sessionObj = $entity->GetSession();

$entityDefObj =
      $sessionObj->GetEntityDef($entity->GetEntityDefName());



$sessionObj->OutputDebugString("Integer fields of ".$entityDefObj.GetName());



# List the field names in the record that contain integers

$nameList = $entityDefObj->GetFieldDefNames();



foreach $fieldName (@$nameList)
   {
 $fieldType = $entityDefObj->GetFieldDefType($fieldName);

 if ($fieldType eq $CQPerlExt::CQ_INT)

  {

  $sessionObj->OutputDebugString($fieldName);

  }

 } 

피드백