This discussion is archived
8 Replies Latest reply: Dec 24, 2012 1:05 AM by 880435 RSS

Data Base block field

880435 Newbie
Currently Being Moderated
Hi All,

I need simple query which i found difficult to solve please guide.


I have one database block in which five database field

1. item1
2. item2
3. item3
4. item4
5. item5

in which i just replace data from i field to another is such a way that each field contain two button

1. copy
2. paste

when i select item1 then copy paste button enable and when i press copy button then item1 field data copy when when i select item5 button will enable and when i press button paste then data of item1 field data copy to item5 field and item5 field data copy to item1 field (simply replace of data), now the problem is when i copy of item1 data and paste to item5 its working fine but i unable to replace data item5 to item1 how can i do this.

Thanks
  • 1. Re: Data Base block field
    yoonas Expert
    Currently Being Moderated
    Hi,

    What problem are you facing when you you replace item1 data with item5 data?

    Regards
    Yoonas
  • 2. Re: Data Base block field
    880435 Newbie
    Currently Being Moderated
    Yes how to replace of data between two fields.

    User can select item5 and copy that data to item7 with replacement option.

    How to find when user select item7 from item5
  • 3. Re: Data Base block field
    yoonas Expert
    Currently Being Moderated
    Hi,

    Not very clear with your requirement,
    If you are trying to swap values each other, first you have to save the value of the field you are copying to in a variable then use the temporary variable value to copy back.

    Regards
    Yoonas
  • 4. Re: Data Base block field
    880435 Newbie
    Currently Being Moderated
    but how to replace each other

    let me describe you detail

    how to find previous field in which i replace data...??
    if i use variable then this variable how to replace it...??
  • 5. Re: Data Base block field
    yoonas Expert
    Currently Being Moderated
    Hi,
    DECLARE
     TEMP varchar2 ( 15 ) ;
    BEGIN
     TEMP := :ITEM7 ;
     :ITEM7 :=:ITEM5 ;
     :ITEM5 :=TEMP;
    END;
  • 6. Re: Data Base block field
    880435 Newbie
    Currently Being Moderated
    DECLARE
    TEMP varchar2 ( 15 ) ;
    BEGIN
    TEMP := :ITEM7 ;
    :ITEM7 :=:ITEM5 ;
    :ITEM5 :=TEMP;
    END;


    this is not as simple as u define
    actually i have told u i have no. of item field and we don't no which field i came if i use variable then ok but next how to this variable use can assign as replacement


    I AM USING COPY BUTTON TRIGGER
         
    BEGIN
         go_item('item1');
         :v_value :=:system.current_value;
         :v_curr_field :=:system.current_item;
    END;



    I AM USING PASTE BUTTON TRIGGER

    DECLARE
         
    BEGIN
         
    :ITEM1:=:V_VALUE;


    END;
  • 7. Re: Data Base block field
    yoonas Expert
    Currently Being Moderated
    Hi,

    Let me put the way i understood

    So if a user wants to copy from item1 to item 3
    clicks on the item1 first then press copy button
    clicks on item3
    clicks the paste button


    i created a parameter called temp to store the destination field value

    copy button trigger

    :parameter.temp := :item3

    paste button trigger

    :item3 := :item1 ;

    :item1 := :parameter.temp ;




    Regards
    Yoonas
  • 8. Re: Data Base block field
    880435 Newbie
    Currently Being Moderated
    i think i unable to clear u

    actually when i copy the field i hold the field of the copy but when i paste then how to assign or replace value like


    :v_previous_field :=:system.current_item;



    how to reassign value to v_previous_field


    how to assign field

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points