Shuttle point - save the changes

The shuttle point integrated is a good way to view and edit data to multiple values. If the data comes from a single line and column (delimited), using the internal order process line Fetch and automatic DML to read/write, it work well.

But what happens if the data from multiple lines in a source table? Say 10 lines are selected (right hand of shuttle) off a 50 LOV. The Source of the element of the shuttle has just the query to retrieve the 10 lines and the APEX engine automatically converts multiple values into 1 delimited value required by the shuttle.

But when it comes to saving the changes in the shuttle, there is no easy way to identify what has changed. Say I deselect the option 1 and select 2 new items in the left side of the shuttle. Value of the element in the session state is delimited by colon 1 string containing the currently selected values. How this translates into the ELIMINATION of 1 and 2 INSERTs necessary against the base table?

I can think of to save the front-subimit value in a hidden element, comparing it to the value of after-submit and stuff like that, but that seems a lot of work. What this kind of thing done effectively?

Thank you

HELEN wrote:

But when it comes to saving the changes in the shuttle, there is no easy way to identify what has changed. Say I deselect the option 1 and select 2 new items in the left side of the shuttle. Value of the element in the session state is delimited by colon 1 string containing the currently selected values. How this translates into the ELIMINATION of 1 and 2 INSERTs necessary against the base table?

I can think of to save the front-subimit value in a hidden element, comparing it to the value of after-submit and stuff like that, but that seems a lot of work. What this kind of thing done effectively?

As the table changed with the values of the shuttle contains one column other than the PK and the shuttle update column, this can all be handled with reusable one DML MERGE statement and a utility function:

begin

  merge into shuttled_states ss
  using (
  /*
    The merge source requires a set of matched pairs: the selected shuttle values
    against the corresponding values in relevant DB rows, for example:

    shuttle_st  db_st
    ----------  -----
    X           X       -- X is in both shuttle selection and DB rowset
                Y       -- Y is not in the shuttle selection but is in DB rowset
    Z                   -- Z is in the shuttle selection but not DB rowset

    We therefore need to leave the X row in the DB unchanged, delete the Y row,
    and insert the Z row.

    This query should also contain other columns and values required in matching
    rows in the merge, or in inserted rows.
  */
    select
        shuttle.column_value shuttle_st
      , db.st db_st
    from
        table(string_to_coll(:p37_states)) shuttle
          full outer join shuttled_states db
            on shuttle.column_value = db.st) t
  /*
    Match conditions normally include matching PK and/or other values to get the
    relevant DB rowset, but the main requirement here is a predicate that matches
    using the DB value column from the shuttle/DB rowset pair.
  */
  on (ss.st = t.db_st)
  when matched
  then
  /*
    This is where the restriction applies. Although we don't actually want to
    update any matched rows as they are unaffected by the shuttle selection, the
    MERGE can only delete rows that have been updated. However we can't update
    any of the columns used in the match, so there needs to be at least one
    column available that can be set to the same value to mark the row as
    updated...
  */
    update
    set
        ss.state_name = ss.state_name
  /*
    ...which makes it possible to delete rows that are not selected in the shuttle.
  */
    delete
    where
        t.shuttle_st is null
  /*
    Where there's no match the value is newly selected in the shuttle and is
    inserted as a new row.

    (Other values required should be included in the query, or handled in a
    trigger.)
  */
  when not matched
  then
    insert
      (st)
    values
      (t.shuttle_st);

end;

This method uses to transform the selected values shuttle of a string delimited by two points in a set of SQL. The function provided by Oracle apex_util.string_to_table returns a PL/SQL associative array that is not appropriate for this. If it is possible to convert a string into lines purely using SQL, these methods are rather obscure and only can be reused by cutting-and-pasting. A simple function that returns a collection of standard SQL type can be used as a set of rows in a query through the SQL TABLE operator and is highly reusable:

create or replace function string_to_coll (p_string in VARCHAR2) return sys.ODCIVarchar2List
is

  l_table apex_application_global.vc_arr2;
  l_list  sys.ODCIVarchar2List := new sys.ODCIVarchar2List();

begin

  l_table := apex_util.string_to_table(p_string);

  l_list.extend(l_table.count());

  for i in 1..l_table.count()
  loop
    l_list(i) := l_table(i);
  end loop;

  return l_list;

end;

For purposes of demonstration, this one uses the predefined sys . ODCIVarchar2List collection type. In real life, you would create your own, and of course the function would be in a package, not stand-alone.

Tags: Database

Similar Questions

  • Why won't my router save the changes to 192.168.0.1 DNS settings? (DGN2200v4)

    I just bought a DGN2200v4 and successfully connected to the internet. However, it took me ages to figure out how to save the changes made to DNS settings. (I wanted to use "OpenDNS" on 208.67.222.222)

    It turns out that if I connect to the router through 192.168.0.1, I can not change the DNS settings. When I click "Apply" after entering the new numbering, it takes 30 seconds or more for the progress bar for complete, but no change is made. i.e. it does not save the changes I made.

    If instead I connect to the router via www.routerlogin.net, changes are correctly saved after clicking 'Apply', with the progress bar by taking 30 seconds or more.

    I tried several times with consistent results. Why 192.168.0.1 not working then as www.routerlogin.net don't? I thought they were equivalent - the webpage 'Netgear genius' is identical on both...

    JC

    JCA says:


    Also, do you recommend make a factory hard reset after the firmware update, or there at - there no need?

    Sorry for the late reply.

    Personally, I tend to reset factory and re - enter the settings manually, unless I've saved a backup of this same version of the firmware. However, I use Netgear as Access Points routers and so I have little data to re-enter. To some people will say that a factory reset is useless and very often they would be correct, but the effects of factory reset no when it may be necessary are often difficult to predict. I was moderator on these forums for a dozen years, and have seen hundreds of threads where the solution to the problems after an update of the firmware has been at the factory to reset the router.

  • Save the changes to a tilelist component using the sharedObeject() method

    Yesterday I asked here a simple way enable users to save changes, they make a request at the click of a button backup and received an excellent suggestion which has been using the method of the shared object that stores the recorded data even after an application is closed and reopeneded.

    However, I am fighting to make it work with tilelists changes. In my application I have a text box in which the user can enter his name, a left hand tilelist populated with details of a collection of table which the user can then drag the items in hand right tilelist, a reset button that resets the tilelist, and changes to the tilelists once the user slipped and dropped points , and a backup button clicked once to save all changes to the request, but for the moment it only records the text that a user has entered in the text box.

    What I want is when the user drags an element / elements of the left to the right clicks and tilelist tilelist save it any changes made to these two tilelists is also recorded for example the button if the user drags an item from left to right, then save the clicks, next time they close and reopen the application that the article is no longer in the tilelist left and will be in the right.

    Can anyone maybe change my code for me so that it saves the tilelists too that I'm completely clueless on where to start on this.

    Here is the code for my application: -.

    <? XML version = "1.0" encoding = "utf-8"? >

    < mx:Application

    ' xmlns:mx = ' http://www.Adobe.com/2006/MXML "layout =" " absolute "creationComplete ="initprofile1SO ()"

    >

    < mx:Script >

    <! [CDATA]

    import

    MX. Collections.*;

    private function profile1NewsAndSportReset():Sub

    {

    profile1NewsAndSportAddLinksTilelist.DataProvider =

    New

    ArrayCollection([)

    {link:}

    "www.bbcnews.com" , label: "BBC News"

    },

    {link:}

    "www.itv.com/" , label: "ITV"

    },

    {link:}

    "www.skynews.com" , label: "Sky News"

    },

    ]);

    profile1NewsAndSportLinkChoice.DataProvider =

    New

    ArrayCollection ([]);

    }

    []] >

    < / mx:Script >

    < mx:Script >

    <! [CDATA]

    import

    flash.net.SharedObject;

    public var

    profile1NameSO:SharedObject;

    private function initprofile1SO():Sub

    {

    profile1NameSO = SharedObject.getLocal)

    'profile1Name '.

    );

    If

    (profile1NameSO.size > 0)

    Profile1NameEntry.text = profile1NameSO.Data.Name;

    }

    private function saveProfile1(event:MouseEvent):Sub

    {

    profile1NameSO.data.name = Profile1NameEntry.text;

    profile1NameSO.Flush ();

    }

    []] >

    < / mx:Script >

    < mx:TextInput id=" Profile1NameEntry "maxChars =" " 10 "width = » 113 "fontSize = » 10 " x=" 5 " y=" 77.5 "

    / >

    < mx:Button click = "profile1NewsAndSportReset ()" id =" " Reset "label =" " Reset " y=" 5 "height = » 25 " x=" 5 "

    / >

    < mx:TileList id=" profile1NewsAndSportLinkChoice "fontWeight =" " "BOLD" "dragEnabled =" " true "dragMoveEnabled =" " true "dropEnabled =" " true "height =" " 292 "width =" 650 "top =" 5 "left =" 521 "columnCount =" 5 "rowHeight =" 145 "columnWidth =" 125 "backgroundColor =" #000000 "color =" #FFFFFF " " / > "" "" "

    < mx:TileList id=" profile1NewsAndSportAddLinksTilelist "fontWeight =" " "BOLD" "dragEnabled =" " true "dragMoveEnabled =" " true "dropEnabled =" " true "height =" " 419 "width =" 385 "top =" 5 "left =" 128 "columnCount =" 3 "rowHeight =" 145 "columnWidth =" 125 "backgroundColor =" #000000 "color =" #FFFFFF "" "" "" "

    >

    < mx:dataProvider >

    < mx:Array >

    < mx:Object " link = ' www.BBCnews.com "label =" BBC News ''

    / >

    < mx:Object " link = ' www.ITV.com/ "label =" ITV ''

    / >

    < mx:Object " link = ' www.Skynews.com "label =" Sky News ''

    / >

    < / mx:Array >

    < / mx:dataProvider >

    < / mx:TileList >

    < mx:Button click = "saveProfile1 (event)" id =" " Save "label =" " Save the changes " x=" 5 " y=" 38 "width = » 113 "height = » 25.5 "

    / >

    < / mx:Application >

    If this post has answered your question or helped, please mark it as such.

    
    
      
         0){
              if(profile1NameSO.data.name){
                Profile1NameEntry.text=profile1NameSO.data.name;
              }
              if(profile1NameSO.data.addList){
                if(profile1NameSO.data.addList != "empty"){
                  var addList:Array = profile1NameSO.data.addList.split(",");
                  var tempAC1:ArrayCollection = new ArrayCollection();
                  for each(var str:String in addList){
                    for each(var obj1:Object in addLinksAC){
                      if(str == obj1.label){
                        tempAC1.addItem(obj1);
                        continue;
                      }
                    }
                  }
                  if(tempAC1.length > 0){
                    profile1NewsAndSportAddLinksTilelist.dataProvider = tempAC1;
                  }
                }
              }
              if(profile1NameSO.data.choiceList){
                var choiceList:Array = profile1NameSO.data.choiceList.split(",");
                var tempAC2:ArrayCollection = new ArrayCollection();
                for each(var str2:String in choiceList){
                  for each(var obj2:Object in addLinksAC){
                    if(str2 == obj2.label){
                      tempAC2.addItem(obj2);
                      continue;
                    }
                  }
                }
                if(tempAC2.length > 0){
                  profile1NewsAndSportLinkChoice.dataProvider = tempAC2;
                }
              }
            }else{
                profile1NewsAndSportReset();
            }
          }
          private function saveProfile1(event:MouseEvent):void{
            profile1NameSO.data.name = Profile1NameEntry.text;
            var addList:String = "";
            if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){
              for each(var obj1:Object in
                profile1NewsAndSportAddLinksTilelist.dataProvider){
                addList += obj1.label + ",";
              }
            }else{
              addList = "empty";
            }
            profile1NameSO.data.addList = addList;
            var choiceList:String = "";
            for each(var obj2:Object in
              profile1NewsAndSportLinkChoice.dataProvider){
              choiceList += obj2.label + ",";
            }
            profile1NameSO.data.choiceList = choiceList;
            profile1NameSO.flush();
          }
        ]]>
      
      
      
      
      
      
    
    
  • Graduation: Do you want to save the changes? When there is no change?

    Forms [32 bit] Version 10.1.2.3.0 (Production)
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production

    I have a form that always pushes me if I want to save the changes after interrogation of a record and then go out or try a new query. I don't know what changes he asks if I want to save that nothing has been changed on the form. Is there a way to follow what is the cause or whence it?

    Most likely in the trigger after query you assign a value to one or more fields (database item) or no database element.

    If it's an article from the database no it's to be assigned to a value the following code in the post once the transfer could help:

    SET_RECORD_PROPERTY (GET_BLOCK_PROPERTY (: SYSTEM.)) TRIGGER_BLOCK, CURRENT_RECORD): SYSTEM. TRIGGER_BLOCK, STATUS, QUERY_STATUS);

    If you assign a data point value check why you do so.

  • Portege 2010 - cannot find the button FINISH to save the changes to the BIOS

    I couldn't save my Bios Setup because I can not find the keys to the end to save the changes.
    I tried to hit all the keys on keyboard, but none of this save the settings.

    Can you show me the keyboard scheme showing the end keys?
    I have toshiba portege 2001 series.

    > Can you show me the keyboard scheme showing the end keys?

    I checked the user manual which you can download from the Toshiba user manual page and the END button seems to be located in the upper right corner, it s above the BACKSPACE key.

    See you soon

  • Unable to save the changes in the resolution of the screen on Satellite P20

    Recently, I have problems with the resolution/quality of images on my laptop P20.

    When I try to remedy this in the tab settings of Options Diplay it me does not save the changes to the screen resolution or image quality. I am currently using the default monitor on NVIDIA GeFOrce FX Go5200.

    Any ideas?

    Hello

    For all the ideas give us more information please. I just know that the resolution of the standard screen for this laptop is 1440 x 900 and if the right display driver is pre-installed to avoid any problems.

    I used Satellite P20-303 (nVIDIA GeForce FX Go5600) nearly two years with the original display driver and have never had any similar problems.

  • Photos app does not save the changes, impossible to edit photos without using other applications

    'Photos' of photo editing features does not work because it is impossible to save the changes. Photos can be edited as usual, but trying to save the changes that the photo is reinstated to the State of origin regardless of changes. There is no error message, to solve the problem, I tried to reset all settings, but it did not help.

    I have iOS 9.2.1 on an iPhone 6 s.

    Thanks in advance for your advice

    I have the same question since getting my iPhone 6. Very frustrating. Several times the photo says even "revert to original" even though the changes have been never applied, as if he thinks he has saved the changes. I asked for help with an apple store and they had never seen before and had no suggestions.

  • Save the changes to the input parameters of circle finder

    In the finder, circle and Pattern matching

    We use some KING and setings of entry...

    I need to record this change while the application is running.

    Which method I should use...

    to save the changes

    Hello

    using xml with the structure of the event function to read and write the values selected.

    Example of XML (you can write the the datastructure options circular detection directly):

    Best regards

    K

  • Why is my Windows Photo Gallery not allowing me to save the changes I made to my photos?

    I've always been able to edit my images under "fix" and then save the changes. However, now I get a message that the changes cannot be saved because an error with my Windows Photo Gallery. Anyone know what can possibly be wrong?

    Go to this thread and the possible error code in their entirety, the list

    http://windowslivehelp.com/forums.aspx?ForumID=cafb0556-8959-49b9-AFEB-635314aa02f3

  • F10 does not save the changes

    I bought a HP 500-023 refurb which was great good cheap at Microcenter.  I would like to enable vt - x, which is a feature of the i3 chip that is installed on this computer, and finally because the Commission will support the other processors I could switch to something that can run a virtual machine that is better outside the i3 chip that went into it.  So, every time I enter the bios and go to the screen that allows me to change the vt - x for 'licence' to 'disabled', that it is not possible to F10 any change.  In fact, it is no screen in the bios at all which allows F10 to save even though the bios says «F10 save/ESC exit»  I built several computers myself in the past and unlocked cores on the processors through the settings of the bios etc, so I am very familiar with the bios settings.  The question is, literally, that the changes cannot be saved.  If someone knows something about HP computers specifically which would explain this weird behavior in the menu of the bios Setup?  To say they have simply disabled the ability to make changes is a total deal breaker and will return just the machine to the store.

    OK as it turns out I have F10 CAN save the changes to the bios settings and activate the HP motherboard Joshua 500-023 device virtualization.  The problem was that I just changed the BIOS with my keyboard not HP.  It's a Microsoft Wireless ergonomic keyboard that I use always.  I would never in a million years try to use cheap plastic keyboard that came with the computer, but read on UEFI and how it detects hardware confidence that it crossed my mind that maybe I should just plug the supplied keyboard with the computer.  YES... that's all it took.  I could then F10 and save changes to the bios.

  • Save the change on issue close

    Hi all, I searched around the forum for an answer but couldn't find one.

    I have problem with is basically, I can't get rid of the recording of the dialogue changes when the application closes. Many people suggested using a variant of:

    public boolean onSavePrompt()
       {
           return true;
       }
    

    but I noticed that all the people who got to work have extended their screen. I did not extend my screen - as in the example of the Music Store tutorial - because I don't know how to use the persistent store when the screen is extended. So, if I use the code above, it does nothing.

    Finally, I would like to save the changes when you exit without any dialogue arise. Currently, I save the changes using the menu button - Save as in the tutorial of Music Store. How could do?

    Help, please! Thanks in advance!

    How do you define your screen?  -That's something like...

    SerializableAttribute public class screen extends MyScreen

    {

    ...

    }

    If so, just add the code of onSavePrompt() in there.

    Your screen will confirm record when he thinks there are pending changes (isDirty() == true).  So, another way to avoid it is to simply call setDirty (false) in your code before the closing.

  • My wallpaper appears only in the extended format. I want to display a .jpeg file into the center channel mode. I click on center and save the changes, but he remains in stretch mode...

    My wallpaper appears only in the extended format.  I want to display a .jpeg file into the center channel mode.  I click on center and save the changes, but he remains in stretch mode...

    HP technical support solves the problem for me with a patch: I'm sorry that I don't remember all the steps they walked me through but the patch was SP45575. EXE.   It was working fine.  Good luck

  • Help with image files, drop box and save the changes?

    My husband put all our photos of drop box.  They are still on our computer, but we can now also access elsewhere.  But it has somewhat modified files.

    I'm putting together, cultures and (in general) to save the changes made to some images.  But I get an error.

    Example: The image I want to change is on the side.  I right-click on the file icon and select "Rotate clockwise" in the menu dropdown. Immediately, I raise the sound "bonk" and an error message appears: "you cannot rotate this image.  The file can be used or open in another program or maybe the file is read only.  It wasn't a problem before doing things to the drop box.
    So, I wait to make sure that everything is ok.  The image is not open anywhere else.  I clicked the properties option to see if it is in read-only mode.  He said that it is not.
    When I open the image and try to use the rotation on the bottom, it will turn.  But when I close the window, I get a different error message that says "Windows Photo Viewer cannot save changes to this picture because there is a problem with the properties of the image file."   There is a link at the bottom of the message box for "Why can't save this picture?  I clicked it.  He said "the subject you are looking for is not available in this version of Windows. For additional assistance, see multiple support options. "The more support options?  Get a tech savvy friend who could help me. Nice.
    Anyone know what I need to do to make this work?
    I don't know what version of windows we have.  I'm sure that's not Vista.  It's the one after that.

    Hello

    Thank you asking in the Microsoft Community.

    1. open Microsoft paint.

    2. navigate to the image through Microsoft Paint.

    3 try to rotate and save the image.

    4 let me know if you are able to.

    Post back with the result.

  • Error: "Canoe Photo window Viewer save the changes to this picture because there is a problem with the property of photo file" when trying to upload photos from the iPhone to the Windows Photo Viewer.

    Original title: saving photos and videos, common sense?

    JW why I can't save a picture to the top of the right way in my windows photo viewer and Media Player (same for video too) so when I download my pictures frim my iphone on the computer a few photos have been taken vertically, and when I go to put the image a gardener would come saying ' canoe photo window Viewer save the changes to this picture because there is a problem with the file of. properties of photos? What can I do to fix this?

    JW why I can't save a picture to the top of the right way in my windows photo viewer and Media Player (same for video too) so when I download my pictures frim my iphone on the computer a few photos have been taken vertically, and when I go to put the image a gardener would come saying ' canoe photo window Viewer save the changes to this picture because there is a problem with the file of. properties of photos? What can I do to fix this?

    =============================================
    I don't know if the following links answer your question, but
    they may be worth a visit:

    Good luck and * proceed at your own risk *.

    FWIW... There is a very long discussion (several pages) to the
    following link:

    Cannot change the imported iPhone 4S photo
    https://discussions.Apple.com/thread/3444951?start=0&TSTART=0

    More Discussion

    iPhone 4S image properties is not compartible with Windows?
    Editing can be done on the computer due to the error
    "Windows Photo Viewer cannot save changes to this picture.
    because there is a problem with the properties of the image file".
    Any help?
    https://discussions.Apple.com/message/17291884#17291884

    More Discussion:

    We cannot turn a few photos in Windows 7 (but can turn others)
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-pictures/cant-rotate-some-photos-in-Windows-7-but-can/3a809845-9144-4BB1-9bb3-ab4f5b856524

    A simple solution is to open the photos in paint or most other
    digital image editor and modify it.

    Some people have reported success using the following free download
    to remove the metadata.

    Property restrictions stripper iphone 4S (JPEG & PNG Stripper)
    http://www.SteelBytes.com/?mid=30&cmd=download&PID=15

    Here's a way to turn...

    Easily turn locked iPhone 4 and 4 s Photos in Windows 7 with
    the rotator Lossless JPEG free
    http://www.daleisphere.com/easily-rotate-locked-iPhone-4-and-4S-photos-in-Windows-7-with-the-free-JPEG-lossless-Rotator/

    Free download JPEG Lossless rotating
    http://annystudio.com/software/jpeglosslessrotator/

  • Do you want to save the changes

    Hi all

    6i dev,

    I always get him 'do you want to save the changes you have done"message when I open my form and try to run the query.

    without to make anychanges.

    ??

    Thank you

    I found it, I'm assigning a value to an element in a trigger a time new form instance

    Thank you

Maybe you are looking for

  • LV 8.6f1 - different decimal point to the development &amp; exe

    Hello In my program I want to use the decimal point '. ' and not the local symbol of the PC. So, I turned this option in the category "FAÇADE". In the development system, it works very well on the screen and in the recorded data (*.lvm & *.xls) files

  • Distribution kit license

    Today I created my first distribution of CVI2013 and was surprised with the large number of files in Volume\license folder license agreement. First of all, I think that there are too many files... Why do I need to redistribute all of these files to a

  • disk repair Tablet Iconia W4_820 Windows 8 32-bit or 32 - bit Windows 10

    HelloI'm looking for a person or a site that could give me the file "repair disk windows 8 or 10 32 bit ' because I lost my.Thanks in advance greetings

  • Home premium window viata

    I buy don't pack widow vista home premium part No 10-52148 x Cd and part no printed in Malaysia is X 13-65749. I reboot and install window vista but can not active there. Please notify

  • Do I really need license?

    Hello I am about to release my first commercial BlackBerry application and I was wondering if it is really necessary to implement dynamic of license or if I can just put my software online at mobihand and appworld with static license. Personally, I t