Save the shuttle point

Hello

I am trying to record the content of an element of the shuttle. I m using a "Save"-button that triggers a process (PL/SQL anonymous block). "."

The content of the element of the shuttle should be stored in a table.

The point of shuttle from filling with a calculation of work. Store new items that have been enjoy on the left side to the right side works just as well.

Unfortunately I m not able to delete an existing element on the right side.

If I remove an item from the right to the left and click on the button "Save", I get the error "ORA-01722: invalid number". "."

I m using the following PL/SQL block:

DECLARE
  v_count        NUMBER  := 0;
  v_shuttle_ids  VARCHAR2(1000);
  v_shuttle      APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
  v_shuttle := APEX_UTIL.STRING_TO_TABLE(:P47_PFLANZLICHE_HERKUNFT);

  FOR i in 1 .. v_shuttle.count LOOP
    SELECT COUNT(*) INTO v_count FROM rjm.material_objekte WHERE objekte_id = :P47_OBJEKTE_ID AND material_id = v_shuttle(i);

    IF v_count = 0 THEN
      INSERT INTO rjm.material_objekte (objekte_id, material_id) VALUES (:P47_OBJEKTE_ID, v_shuttle(i));
    END IF;

    v_shuttle_ids := v_shuttle_ids || v_shuttle(i) || ',';
  END LOOP;
   
  v_shuttle_ids := SUBSTR(v_shuttle_ids, 0, LENGTH(v_shuttle_ids) - 1);

  DELETE FROM rjm.material_objekte WHERE objekte_id = :P47_OBJEKTE_ID AND material_id NOT IN (v_shuttle_ids);
END;

The Delete statement fails because the data types are not compatible. The variable v_shuttle_ids is the VARCHAR2 data type and the database column material_id has the NUMBER data type.

Anyone has a solution to the problem (for example, casting data types) or has a better way to remove existing items from the shuttle point?

Thank you in advance,

Patrick

If I understand the problem, your code should look like this:

DECLARE
  v_count        NUMBER  := 0;
  v_shuttle_ids  NUMBER_TT;
  v_shuttle      APEX_APPLICATION_GLOBAL.VC_ARR2;
BEGIN
  v_shuttle_ids := NUMBER_TT();
  v_shuttle := APEX_UTIL.STRING_TO_TABLE(:P47_PFLANZLICHE_HERKUNFT);
  FOR i IN 1 .. v_shuttle.count LOOP
    SELECT COUNT(*) INTO v_count FROM rjm.material_objekte WHERE objekte_id = :P47_OBJEKTE_ID AND material_id = v_shuttle(i);
    IF v_count = 0 THEN
      INSERT INTO rjm.material_objekte (objekte_id, material_id) VALUES (:P47_OBJEKTE_ID, v_shuttle(i));
    END IF;
    v_shuttle_ids.extend();
    v_shuttle_ids(v_shuttle_ids.last) := v_shuttle(i);
  END LOOP;
  DELETE FROM rjm.material_objekte WHERE objekte_id = :P47_OBJEKTE_ID AND material_id NOT IN (SELECT column_value FROM TABLE(v_shuttle_ids));
END;

Tags: Database

Similar Questions

  • Send a Page having the SHUTTLE point

    Hello

    I have an element of type - SHUTTLE, this train to suppose that 1,000 records.
    When I submit the page containing the type of SHUTTLE, all records of 1000 are parade first before submitting the page, I mean the control goes from top to bottom for this element.

    This is the default function of APEX?.

    Thank you
    Deepak

    Deepak:

    The function will delete all items in the item of the shuttle and submit the page.

    CITY

  • How do I change the range on a chart, but save the same points

    Hello

    I have a chart with 501 points on the axis X and autoscale on there, and then when I generate the graph, I see the x-axis from 0 to 500.

    But now I need to change the scale for the x-axis of 50 to 100... but all points must be the same as 0 to 500.

    I think what I need is just remove 0 and 500 channels and replace them with 50 to 100 without change anythink on the chart itself.

    Is this possible on LabVIEW?

    Note that I'm not asking for a zoom on the chart... There is no zoom, only the x-axis numbers must change after I generated

    the graph

    Thank you!

    Hi JPLO,

    You can change the presentation of the scale by setting an offset of 50 and a multiplier to scale from 0, 1, or in the box properties dialog or using the property or the nodes!

  • 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.

  • Refresh only the left side of the cascade point shuttle LOV

    Hello

    I want to fill the shuttle point dynamically using selection LOV cascading list. but when I change to another value left and right gets refreshed.

    but I want to refresh only the left side, right must be the same.

    I want to achieve something like that

    http://Apex.Oracle.com/pls/Apex/f?p=579:56

    I want to achieve this by using Refresh before and after updating dynamic action.
    Is this possible?

    pls help me with this. Its very urgent.

    879090 wrote:

    If you are on 4.x just used the cascade LOV Parent article (s) in the element of the shuttle

    Yes use v 4.X .and uses the parent LOV cascading item. My problem is that I want to change the elements of lov parent and cascading using different values.

    Let's say my lov elements parent has deptno 10,20,30.

    Wen I select dept 10 it should display all the emp to 10 dept. and I wil select some employees from that. then I will select dept 20 then it will show all employees of dept 20 and I will select a few PMCs from that.

    But now the prob is wen I don't change the dept No 20 of 10, the right side of the shuttle point with details emp dept 10 has disappeared. but I want that values must be ter, and should be updated by the left side.

    check out the link that I have attached in the first post. I want to achieve the same thing like that.

    Well, I looked at link above and even recreated in my demo application and added the section how it, just follow the steps

    http://Apex.Oracle.com/pls/Apex/f?p=46417:22

    Test/test connection

  • Creation of Validation for the multiple selection list or shuttle point

    Hello
    I'm new to APEX and have questions about the best way to validate the selected shuttle items to verify that they exist in the sys.dba_roles table before submitting. The shuttle point uses a static LOV. I would like to than the error message to display when there is no such thing as a role selected in the element of the shuttle in the sys.dba_roles table.

    Using version 3.2 of APEX
    DB version 9.2.0.8.0
    Internet Explorer version 6

    I tried to create a validation step level about to shuttle P3_ROLE using SQL EXISTS when you press the button SUBMIT. I know that when argued that the shuttle point returns the selected values in a single string delimited by a colon. I use the APEX_UTIL. STRING_TO_TABLE to convert values selected in a table.

    CODE HERE
    declare
    l_selected APEX_APPLICATION_GLOBAL. VC_ARR2;
    number of l_num;
    Start
    l_selected: = APEX_UTIL. STRING_TO_TABLE(:P3_ROLE);
    BECAUSE me IN 1.l_selected. COUNTY
    LOOP
    Select 1 from l_num of sys.dba_roles where role = l_selected (i);
    END LOOP;
    end;

    This is the error ORA-00928: lack of SELECT keyword
    1006 - ERR error in the validation routine.

    Any advice? Thoughts? Thank you.

    Published by: Violet on Oct 14, 2010 14:50

    Hello

    Your code is PL/SQL block. You cannot use this type of validation with your code.

    Try to change the body type of the function that returns the error text and
    code for this one

    DECLARE
      l_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
      l_num NUMBER;
    BEGIN
      l_selected := APEX_UTIL.STRING_TO_TABLE(:P3_ROLE);
      FOR iIN 1..l_selected.COUNT
      LOOP
        SELECT count(1) INTO l_num FROM sys.dba_roles WHERE role = l_selected(i);
        IF l_num = 0 THEN
          RETURN 'Role not exists';
        END IF;
      END LOOP;
      RETURN NULL;
    END;
    

    Kind regards
    Jari

  • Cannot insert rows in a table db to an element of the shuttle

    I'm a little puzzled. I created a shuttle element called P18_SELECTED_RESOURCES with the following LOV:
    SELECT sed.domain||'.'||
           sed.target||'.'||
           sed.skill||'/'||
           sed.skill_prof||'  '||
           r.first_name||' '||
           r.last_name "d",
           r.rsrc_id "r"
    FROM   ri_resource r, ri_skill_supply_eq_demand sed
    WHERE  r.rsrc_id = sed.rsrc_id
    AND    sed.work_id = :P18_WORK_ID
    It works properly and displays the correct data for: P18_WORK_ID.

    Then I created a page called SAVE_SHUTTLE_SELECTION triggered by button process called Submit with an action to submit the page. The button is located in the same region of the point of the shuttle. It looks like this:
    declare
    
     r_selected APEX_APPLICATION_GLOBAL.VC_ARR2;
    
    begin
    
     -- Convert the colon separated string from the shuttle into the array
     
     r_selected := APEX_UTIL.STRING_TO_TABLE(:P18_SELECTED_RESOURCES);
    
     -- the array should now contain rsrc_ids from the shuttle LOV
    
     -- Now insert those rsrc_ids into the RI_WORK_ASSIGNMENT table with the work_id from P18_WORK_ID
     FOR i IN 1..r_selected.count LOOP
        insert into RI_WORK_ASSIGNMENT (RSRC_ID, WORK_ID)
        values (r_selected(i), :P18_WORK_ID);
     END LOOP;
    
    end;
    The code executes and returns a success message, but no data is inserted into the table. The shuttle point and P18_WORK_ID are in different regions, but they are on the same page. I even tried to put a *' "commit"; * After the END of LOOP;. I didn't know who would do anything. There can be no. I use APEX 4.1.

    Thanks for any help.

    Hello people of the sea,

    I checked your code and the same replicated on my instance.it works fine.
    I thought that you didn't want seleceted any value from the left pane of the shuttle.

    so first change the value in the left pane to the right pane of the point of the shuttle, then click on submit .it definitely works.

    Kind regards
    Jitendra

  • APEX_UTIL. STRING_TO_TABLE trying to separate items of the shuttle. . Not to collect data

    I use the below code and I don't receive the no found error of data.
    I use this code to separate the content from the shuttle point... and put it in a text field.
    But I sometimes randomly recive the no data found error...
    No idea why it should happen... I don't know why this piece of code will trigger the when_no_data found the error.
    Any info will be appreciated

    Thank you and best regards,
    Paul


    v_selected APEX_APPLICATION_GLOBAL. VC_ARR2;
    Start
    v_selected: = APEX_UTIL. STRING_TO_TABLE(:P53_x);

    If v_selected (1) is not null then
    : P53_XADISSUE1N: = v_selected (1);
    end if;
    If v_selected (2) is not null then
    : P53_XADISSUE2N: = v_selected (2);
    end if;


    I ran an apex debugging and it is the part of the production...
    Transformation point: submit before 4 calculation

    0,09300 0.00400... "Adv_proc" process: PLSQL (ON_SUBMIT_BEFORE_COMPUTATION) declare mmagazine_no number (10); madvtno number (10); mgno number (10); minvno number (10); mcontact_no number (10); v_selected APEX_APPLICATION_GLOBAL. VC_ARR2; begin v_selected: = APEX_UTIL. STRING_TO_TABLE(:P53_x); If v_selected (1) is not null 4 th

    0.09700 0.00100 encountered unhandled exception to the process type 4 PLSQL

    0.00100 error 0,09800 page view...

    Published by: pauljohny on May 15, 2012 02:34
    DECLARE
      t_count number;
    BEGIN
      l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(:P53_x|| ':');
      t_count := l_vc_arr2.count - 1;
      if t_count > 0 then
        :P53_XADISSUE1N := l_vc_arr2(1);
      end if;
      if t_count > 1
        :P53_XADISSUE2N := l_vc_arr2(2);
      end if;
      if t_count > 2 then
        :P53_XADISSUE3N := l_vc_arr2(3);
      end if;
      --.....
    exception
      when others then null;
    end;
    

    Kind regards
    Richard
    -----
    blog: http://blog.warp11.nl
    Twitter: @rhjmartens
    If you answer this question, please mark the thread as closed and give points where won...

  • Cannot save the project to a network, pointing to a Windows Server drive

    Hello

    I have a problem with Adobe Premiere Pro CC 2014.
    Before:

    -Reading / recording on a network, pointing to a Linux server drive: OK

    After:
    -Play on a network, pointing to a Windows Server drive: OK
    -Saving to a network drive a pointing to a Windows Server: KO

    I have this message: ' could not open the project file with write access to the file can you be locked or not may - have permission to write to this location select "save under" in the file menu to save the project for a new... location.

    By browsing your forum, I saw these topics:
    https://forums.Adobe.com/thread/1536340

    https://forums.Adobe.com/thread/1207242

    In summary: Adobe is not designed for networking.
    We are now in 2015. Always the same? Is he a workaround?

    Best regards

    Sébastien

    Is there a solution?

    Adobe anywhere for video

  • selectManyShuttle: the user shuttles points to the right or the left?

    Hello. I use jDev 11.1.2.1.0

    I put a valueChangeListener in a selectManyShuttle component.
    Is it possible to understand if the user shuttles points to the right (and so it adds or selections) or to the left (removes selected items)?
    There may be something obvious that I am not...

    Thank you.

    You tell me - you must have linked the value of the selectManyShuttle parameter to a list or something...

  • How to save the document iWork on iCloud drive?

    I have 4 files in my player to iCloud.  When I create a new document in Pages and save it in the folder of chemistry, I noticed that the Pages also saves a copy in the Pages folder.  So I find myself with two copies of the document.  The same thing happens with Numbers and Keynote.

    Is there a way to save the Pages (and Numbers and Keynote) documents to an iCloud specified by the user folder without copy also end up in the related app?  THX

    When you save Pages documents in iCloud drive, but not in the Pages folder, it will create an alias in the Pages folder pointing to the active page document that you saved in your folder of chemistry. These aliases will be a small vertical arrow under the icon, accompanied by text stating "in iCloud drive." You can right-click on the alias and choose the menu option Show Original.

    The cure is to make your records custom inside the respective iCloud drive: Pages, Numbers and Keynote primary records. These applications have an abbreviation save default Panel. On the right of the Save As the Committee Save: field, you will see a small box with an angle down in it. Click on this button, it will expand your panel Save/Save as and a button new folder will appear on the bottom.

    You select iCloud drive from the Favorites panel column Pages save and then browse the Pages main, numbers, and Keynote files. This is where you click on the button new folder, which will initially show no icons it contains until you save the document. No alias is generated. For existing records outside the above-mentioned applications, you could drag and drop the folder in the respective Pages, numbers and Keynote primary records, and then you can delete the (single) alias files.

  • AppleScript to save the text from the view of results

    Hello, I am working with applescript that takes the results in the window at the bottom of the editor, like this

    Now I try to write it in the text editor as a text but Applescript say that he can not with "can't turn"class IFAP in the text.

    and if I try to save the results as a list, applescript supports error 10000 (textEdit has encountered an error: failure AppleEvent written in popup)

    It's that everybody knew how can I solve this problem?

    Here is the text of the script, but it won't work on your mac because it uses application to imagine Photo.

    thisFile to Choose file with guest "choose an image file:

    say application "Imagine the Photo.

    the value thisImporter for import graphics thisFile

    if the component error of thisImporter is not equal to 0 then

    thisImporter close

    display the dialog box "Not an image file that quicktime recognizes."

    return

    end if

    the value {x, y, xDim, yDim} to the limits natural of thisImporter

    define thisDocument to make new document window properties {size: {xDim, yDim}}

    the value the destination of thisImporter to thisDocument drawing

    thisImporter trace

    thisImporter close

    -The section which follows should be replaced according to the pixel value class

    the value pixelValueRect to {x, y, xDim, yDim}

    the value pixelValues1 to get the pixel values of thisDocument with properties {class of pixel values:pixel in the rectangle, rectangle boundaries: pixelValueRect}

    thisDocument close

    -class (pixel points) as a list

    -' class pCol' as a list - цвета координаты разнесены по классам с именами, приводим к списку и

    end say

    say application "TextEdit".

    activate

    make a new document

    the value text of document 1 to pixelValues1 as list

    -the text of the document 1 pixelValues1 as a value list

    -Save the document 1 in ' / Users/IMac/Desktop/LastUpdate.txt '.

    end say

    pixelValues1

  • VPS Config will not save the password

    I am running 10.11.4 on what we'll call the Machine B and I'm trying to config a VPN which is supposed to connect to a Mac OS X Server running a VPN L2TP.

    Another machine, we'll call the Machine A, connects to the VPN without problem. So, I know that the problem is NOT server-side.

    So in sys prefs, you can access the network, and I have my VPN connection in there. Under authentication, I have two fields, one password and one for the shared secret.

    On computer A, when I go to look at settings, these two are saved correctly. This is why Machine A connects to the VPN without problem.

    On Machine B, I enter the password and the shared secret. I hit OK. If I click the authentication settings button once again, I see the points demonstrating the existence of a stored value of password and the shared secret. Then I click APPLY. Now if I click authentication settings, the password and the shared secret are empty!

    This happens again and again. I can't understand why. No wonder my VPN will not connect if this f-in computer won't save the authentication settings.

    Moreover, the VPN used to work perfectly without a problem. Then something happened - he asked me a password for my VPN unexpectedly. Never, since the VPN not working and I can't make it work because of this problem.

    Hello

    We discovered a machine here at our office today who had exactly the same problem. Your post was the only one I could find that describes our problem exactly.

    Our machine is a Macbook Pro, El Cap 10.11.4

    I found a solution that allowed me to recreate the VPN connection through the command line.

    Once the VPN connection has been recreated the shared key has been registered successfully in its field in the connection settings.

    This script https://github.com/halo/macosvpn saved the day.

    We use Cisco IPSec that is described on how to enter in the CLI to the bottom of the page, but L2TP is mentioned above.

    Good luck!

  • The photos in iPhoto and the same pictures? Is it possible to remove/save the photos to iPhoto?

    The photos in iPhoto and the same pictures?  Is it possible to remove/save the photos to iPhoto?

    Yes, they are literally identical. That is to say, time iPhoto Library and photo library (link) to point to the same files on your drive.

    The two libraries does NOT duplicate these files. If you delete the iPhoto library you will find very little storage space.

    My suggestion would be to leave in place iPhoto library until you have the habit of Photos and know with absolute certainty that all migrated to Photos correctly. Even in this case, you can copy, save a copy on a disk external backup and only remove them from your main drive.

  • Save the first for the 10.6.8 update at latest

    I want to save my BONES and music on a disc usb external hard.

    I asked a similar question, a month or two ago, but a few things have changed.

    Here are the details of what I want to accomplish and need advice please.

    1. I have a drive external hard usb. I want to save the music (iTunes) and OS (10.6.8) on the external hard drive.

    I want to only backup in case the update to el capitan does not run smoothly. I try to install on the last required minimum iMac... then it of risky, but just meets the requirements of apples. Mid 2007 iMac with 4 GHz ram.

    2 will be time machine backup 10.6.8 and iTunes via the time machine? I don't want to buy software of cloning at this point if time machine will support OS upnmy and music from iTunes.

    3. should I erase the iMac after support before trying to upgrade to el capIran and upward? Or keep the OS being and try to upgrade 10.6.8 to el capitan. ?

    4. can someone send me the exact link of the Apple at el capitan. The exact version that I need when updating 10.6.8 at el capitan

    Time machine backs up everything including your iTunes library. So just do turn time machine, then upgraded it to el capitan. You can do this via the app store just click and install.

Maybe you are looking for