• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1509
  • Last Modified:

what's wrong with it?

hi, all
pls point the wrong in the unit:
declare list_index number(2);
itemname varchar(40);
cur_Disp_Name varchar(40);
cur_Field_Name varchar(40);
CompareName varchar2(40);
FieldType varchar2(12);
found boolean:=false;
begin
      list_index:=To_Number(Name_In('Field_Pop_List'));
      Cur_Disp_Name:=get_list_element_label('Field_Pop_List',list_index);
      ItemName:=get_block_property(:global.blk_name,First_Item);--get the first field name
      --set values to field name pop list with a cycle
      CompareName:=get_item_property(:global.blk_name||'.'||ItemName,Prompt_Text);
      cur_Field_Name:=get_item_property(:global.blk_name||'.'||ItemName,column_name);
      FieldType:=get_item_property(:global.blk_name||'.'||cur_Field_Name,DataType);
      loop
             if Cur_Disp_Name=CompareName or Cur_Disp_Name=cur_Field_Name then
                   found:=true;
                  -- message(FieldType);
                  -- pause;
                   exit;
             end if;
             ItemName:=get_Item_property(:global.blk_name||'.'||ItemName,NextItem);
         CompareName:=get_item_property(:global.blk_name||'.'||ItemName,Prompt_Text);
         cur_Field_Name:=get_item_property(:global.blk_name||'.'||ItemName,column_name);
         FieldType:=get_item_property(:global.blk_name||'.'||cur_Field_Name,DataType);
      exit when(ItemName=get_block_property(:global.blk_name,Last_Item));
      end loop;
      if found=false then
             if Cur_Disp_Name=CompareName or Cur_Disp_Name=cur_Field_Name then
                   found:=true;
                   message(cur_field_name);
                   pause;
             end if;
      end if;
      -- set the compare droplist's value
      if UPPER(FieldType)='CHAR' OR UPPER(FieldType)='VARCHAR2' then
      clear_list('Block2.Compare_Combo_List');
      ADD_LIST_ELEMENT('Block2.Compare_Combo_List',1,'“™˜°',1);
      ELSIF UPPER(FieldType)='DATE' or UPPER(FieldType)='NUMBER' then
      clear_list('Block2.Compare_Combo_List');
      ADD_LIST_ELEMENT('Block2.Compare_Combo_List',6,'•s“™˜°',6);
      ELSE
      clear_list('Block2.Compare_Combo_List');
      ADD_LIST_ELEMENT('Block2.Compare_Combo_List',1,'“™˜°',1);      
     end if;
----THE WRONG BLOCK,HOW TO CORRECT IT?????????      
if UPPER(FieldType)='DATE' then
             set_item_property('condition_input_text',format_mask,'yyyy/mm/dd');
        elsif UPPER(FieldType)='NUMBER' then
             set_item_property('condition_input_text',format_mask,'FM999999');
       ELSE
           NULL;
      end if;
end;
0
zhangrui
Asked:
zhangrui
1 Solution
 
Helena Markováprogrammer-analystCommented:
I think that the only thing is missing a block:

if UPPER(FieldType)='DATE' then
            set_item_property('YOUR_BLOCK.condition_input_text',format_mask,'yyyy/mm/dd');
elsif UPPER(FieldType)='NUMBER' then
            set_item_property('YOUR_BLOCK.condition_input_text',format_mask,'FM999999');
ELSE
          NULL;
end if;

Henka
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now