IDCS3: Odd behaviour when inserting values

Hi!
I can't find a solution to this problem anywhere on the forum or on the net. It could be that I choose the wrong search terms. But anyways, an explanation:
The problem my co-workers and I have, is that when you have a document open, select a bit of text, and want to type in a new size-value in the control-panel at the top, the program reset to the previous value and the marker goes back into the selected text. It also happen when I want to change any other values for ie. objects like images, and when I type in another font face.
Another problem that occur, is that when I go to another open program on my Mac, it jump back into InDesign without me doing anything.
Is this a problem for Intel-based macs with OS X 10.5? On the machine running PPC it works as it should.
If this wasn't understandable, please let me know.

We are also having the problem of inserting values in to the top control panel. Both with the Selection Tool and the Type Tool. We highlight the input box, we enter in a value, the new value stays for a second or two, and then reverts to the previous value. Also, if we try to copy in a value, the box de-highlights and the value gets pasted on to the actual document in a new text box.
This is happening in InDesign CS3 5.0.2 running on Leopard G5s and Tiger G5s. It seems to have appeared with the 5.0.2 update.

Similar Messages

  • RSH1 issue when insert values

    Hi Guru,
    i wan to create a material group hierachy base on char 0matl_group. when i insert values into the it, only a few of material group values show on the list. but infact, there are more than 5,000 records for master data 0matl_group.
    what's the problem?
    many thanks.
    brgds/steve

    Hi,
    First check if your 0matl_group is activated.
    As you said 5000 records in 0matl_group. but those would be repeat values. In RSH1, you will see only unique values while insertion. There will be very few uniqiue values.
    I hope it will help.
    Thanks,
    S

  • Odd noise when inserting a disk

    I have a brand new macbook pro, less than a week old, and from the day I got it, every time I insert a disk, it makes this loud popping/clicking noise. Is this normal or maybe there is something wrong?

    I have the same sound - my MBP is only a week old as well... If you are not happy with it or are having further problems with it reading cd's or dvd'd then you should take it back to your local apple store.
    I know of two other MBP users and they have the same thing... as said on other posts "not very pleasing to the ear"...

  • Odd Behaviour when plugged in

    Sometimes, when I plug my phone into the PC, it displays Chinese (?) characters beside the name of the phone. Other times, it just has random latin characters. Any idea's as to what or why?
    Screen capture: http://www.gregoryferdinandsen.com/3gphone.jpg

    OS Command Job Fails Calling Sqlplus or expdp [ID 1259434.1] To BottomTo Bottom
    set LD_LIBRARY_PATH_64="" in script solve the problem
    export LD_LIBRARY_PATH_64=""

  • Odd behaviour when automating opacity on a time remapped clip?

    I simply cannot automate opacity on a clip that is time remapped....the edits show as normal but the clip either doesnt go opaque or goes black.
    is this a bug or is it just my system?
    windows 7
    i7 cpu
    12 gig ram
    Premiere pro cc 2014 version 8.0.1 (21)

    it works if i nest it but that is not good for fast workflow. but it did work before the update so thinking about it it cant be my system.

  • Odd gmail behaviour when using mail.app

    Hello there,
    Ever since upgrading to Mavericks, I've been experiencing odd behaviour when sending messages from my gmail account in mail.app. I send a message and up to ten copies of the message appear in mail.app's trash.
    Does anyone know what might be the cause of this?
    many thanks,
    Chidi

    this is a setting in gmail that interfer with mail.app
    the setting is that mail.app is that when you type a mail it will auto save it while you are typing. and gmail will delete the saved onece and the mail.app will create a new all the time
    duno how to turn this off, try by rebuilding the mailbox in mail.app

  • I need to validate Input List Of Values Field when Inserted From Bean

    I've two view object EmployeeView and DepartmentsView
    In Employee View I've changed Department_Id to Input List OF Values
    I've created a bean to inset data into Employee Table
          ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject importedVO = am.findViewObject("EmployeesView");
    try {
                newEmp.setEmployeeId(new Number("3424));
                newEmp.setFirstName("Test Fname");
                newEmp.setLastName("Test Lname");
                newEmp.setEmail("[email protected]");
                newEmp.setPhoneNumber("4643131345");
                newEmp.setJobId("AD_VP");
                newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));
                 } catch (Exception e) {
                // TODO: Add catch code
                System.out.println("inside Catch");
                e.printStackTrace();
            }I know that ADF validate Input list of values when inserting new value on it
    when I've enabled the debugger I've found that
    <ViewObjectImpl><buildQuery> [604] SELECT DepartmentsEO.DEPARTMENT_ID,         DepartmentsEO.DEPARTMENT_NAME,         DepartmentsEO.MANAGER_ID,         DepartmentsEO.LOCATION_ID,         DepartmentsEO.ISDELETED FROM DEPARTMENTS DepartmentsEO WHERE ( ( (DepartmentsEO.DEPARTMENT_ID = :vc_temp_1 ) ) )
    <ViewObjectImpl><bindParametersForCollection> [605] Bind params for ViewObject: [com.test.model.views.DepartmentsEOView]AppModule.__LOCAL_VIEW_USAGE_com_test_model_views_EmployeesEOView_DepartmentsView_findByVC_12_LOV_DepartmentId_lov__filterlist__vcr___
    <OracleSQLBuilderImpl><bindParamValue> [606] Binding param "vc_temp_1": 999
    <ViewObjectImpl><processViewCriteriaForRowMatch> [607] VCs converted to RowMatch:  ( (DepartmentId = :vc_temp_1 ) )
    <ViewRowImpl><handleListBindingMismatch> [608] No matching row found for list binding:LOV_DepartmentId for ViewRow:oracle.jbo.Key[34235 ]
    <ViewRowImpl><handleListBindingMismatch> [609] --- filterList ValueMap key:DepartmentId, value:999
    <DCBindingContainer><internalRefreshControl> [610] **** refreshControl() for BindingContainer :com_test_view_testInsertPageDef
    <JUCtrlHierNodeBinding><release> [611] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_2, value:EmployeesViewIterator
    <JUCtrlHierNodeBinding><release> [612] released: ROOT node binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_2, value:EmployeesViewIterator
    <DCIteratorBinding><releaseDataInternal> [613] Releasing iterator binding:EmployeesViewIterator
    <ApplicationPoolMessageHandler><doPoolMessage> [614] **** PoolMessage REQ ATTACH LWS
    <ApplicationPoolMessageHandler><doPoolMessage> [615] **** PoolMessage REQ DETACH LWS
    <DCJboDataControl><initializeApplicationModule> [616] (oracle.adf.model.bc4j.DataControlFactoryImpl.SyncMode = Immediate
    <DCBindingContainer><internalRefreshControl> [617] **** refreshControl() for BindingContainer :com_test_view_testInsertPageDef
    <DCBindingContainerState><validateToken> [618] Process BindingContainer state token(decompressed state):BCST:=0%V%=NEmployeesViewIterator=-D-,
    <this means that ADF tries to validate the input list of values "Department_Id" and didn't found any match
    I need to through exception when I try to set Department_ID with invalid value "value not on range" like
    newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));I don't want to validate it manually as I've a lot of fields.
    I need to through exception when try to
    newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));

    Thanks Timo
    this is the code that I use
          ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
          ViewObject importedVO = am.findViewObject("EmployeesView");
          EmployeesEOViewRowImpl newEmp = (EmployeesEOViewRowImpl)importedVO .createRow();
          importedVO .insertRow(newEmp);
    try {
                newEmp.setEmployeeId(new Number("3424));
                newEmp.setFirstName("Test Fname");
                newEmp.setLastName("Test Lname");
                newEmp.setEmail("[email protected]");
                newEmp.setPhoneNumber("4643131345");
                newEmp.setJobId("AD_VP");
                newEmp.setDepartmentId(new oracle.jbo.domain.Number(999));
                 } catch (Exception e) {
                // TODO: Add catch code
                System.out.println("inside Catch");
                e.printStackTrace();
            }

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

  • SQL Query produces different results when inserting into a table

    I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ...
    The query is:
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      The INSERT INTO code:
    TRUNCATE TABLE applicant_summary;
    INSERT /*+ APPEND */
    INTO     applicant_summary
    (  account_number
    ,  main_borrower_status
    ,  num_apps
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      When run as a query, this code consistently returns 2 for the num_apps field (for a certain group of accounts), but when run as an INSERT INTO command, the num_apps field is logged as 1. I have secured the tables used within the query to ensure that nothing is changing the data in the underlying tables.
    If I run the query as a cursor for loop with an insert into the applicant_summary table within the loop, I get the same results in the table as I get when I run as a stand alone query.
    I would appreciate any suggestions for what could be causing this odd behaviour.
    Cheers,
    Steve
    Oracle database details:
    Oracle Database 10g Release 10.2.0.2.0 - Production
    PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    Edited by: stevensutcliffe on Oct 10, 2008 5:26 AM
    Edited by: stevensutcliffe on Oct 10, 2008 5:27 AM

    stevensutcliffe wrote:
    Yes, using COUNT(*) gives the same result as COUNT(1).
    I have found another example of this kind of behaviour:
    Running the following INSERT statements produce different values for the total_amount_invested and num_records fields. It appears that adding the additional aggregation (MAX(amount_invested)) is causing problems with the other aggregated values.
    Again, I have ensured that the source data and destination tables are not being accessed / changed by any other processes or users. Is this potentially a bug in Oracle?Just as a side note, these are not INSERT statements but CTAS statements.
    The only non-bug explanation for this behaviour would be a potential query rewrite happening only under particular circumstances (but not always) in the lower integrity modes "trusted" or "stale_tolerated". So if you're not aware of any corresponding materialized views, your QUERY_REWRITE_INTEGRITY parameter is set to the default of "enforced" and your explain plan doesn't show any "MAT_VIEW REWRITE ACCESS" lines, I would consider this as a bug.
    Since you're running on 10.2.0.2 it's not unlikely that you hit one of the various "wrong result" bugs that exist(ed) in Oracle. I'm aware of a particular one I've hit in 10.2.0.2 when performing a parallel NESTED LOOP ANTI operation which returned wrong results, but only in parallel execution. Serial execution was showing the correct results.
    If you're performing parallel ddl/dml/query operations, try to do the same in serial execution to check if it is related to the parallel feature.
    You could also test if omitting the "APPEND" hint changes anything but still these are just workarounds for a buggy behaviour.
    I suggest to consider installing the latest patch set 10.2.0.4 but this requires thorough testing because there were (more or less) subtle changes/bugs introduced with [10.2.0.3|http://oracle-randolf.blogspot.com/2008/02/nasty-bug-introduced-with-patch-set.html] and [10.2.0.4|http://oracle-randolf.blogspot.com/2008/04/overview-of-new-and-changed-features-in.html].
    You could also open a SR with Oracle and clarify if there is already a one-off patch available for your 10.2.0.2 platform release. If not it's quite unlikely that you are going to get a backport for 10.2.0.2.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Constructor behaviour via INSERT SQL

    Interestingly, using an object constructor itself as the insert value seems to have overheads, with the constructor being called multiple times for instantiating the single same object. Cannot recall seeing this documented.
    Here's an example (on 11.2.0.2):
    // the object type with a custom constructor
    SQL> create or replace type TMyRow is object(
      2          id      integer,
      3          day     date,
      4          val     varchar2(10),
      5 
      6          constructor function TMyRow( i integer, d date ) return self as result
      7  );
      8  /
    Type created.
    // implementation of custom constructor - it uses a dynamic SQL to
    // add some "SQL processing noise" for evaluation on how noisy it
    // was after a call
    SQL> create or replace type body TMyRow as
      2          constructor function TMyRow( i integer, d date ) return self as result is
      3          begin
      4                  DBMS_OUTPUT.put_line( 'constructing TMyRow(): id='||i||' day='||d );
      5                  self.id := i;
      6                  self.day := d;
      7                  self.val := 'TMyRow()';
      8 
      9                  execute immediate 'select '||i||' from dual foo where '||i||'='||i;
    10                  return;
    11          end;
    12  end;
    13  /
    Type body created.
    // table based on object type
    SQL> create table mytab of TMyRow(
      2          id primary key,
      3          val default null
      4  ) organization index;
    Table created.
    // not what I expected - the constructor is actually called 3x and
    // not a single time
    SQL> insert into mytab values( TMyRow(1, sysdate) );
    constructing TMyRow(): id=1 day=2012/04/10 10:21:34
    constructing TMyRow(): id=1 day=2012/04/10 10:21:34
    constructing TMyRow(): id=1 day=2012/04/10 10:21:34
    1 row created.
    // from PL/SQL, the constructor is called once only and the
    // insert works without "repeating constructor" calls
    SQL> declare
      2          myRow TMyRow := new TMyRow(2, sysdate);
      3  begin
      4          insert into mytab values myRow;
      5  end;
      6  /
    constructing TMyRow(): id=2 day=2012/04/10 10:21:34
    PL/SQL procedure successfully completed.
    // as an alternative to the above 2 approaches, one can also
    // use a select against DUAL to generate the object to insert -
    // however it also shows 3x constructor executions
    SQL> insert into mytab select TMyRow(3, sysdate) from dual;
    constructing TMyRow(): id=3 day=2012/04/10 10:21:34
    constructing TMyRow(): id=3 day=2012/04/10 10:21:34
    constructing TMyRow(): id=3 day=2012/04/10 10:21:34
    1 row created.
    // the rows in the table (no duplicates of course created)
    SQL> select * from mytab;
            ID DAY                 VAL
             1 2012/04/10 10:21:34 TMyRow()
             2 2012/04/10 10:21:34 TMyRow()
             3 2012/04/10 10:21:34 TMyRow()
    // and here we can see the "noise factor" of the constructor - including
    // that it indeed executed 3x for the same object instantiation
    SQL> select executions, sql_text from v$sqlarea where upper(sql_text) like 'SELECT%FROM DUAL FOO%' order by 2;
    EXECUTIONS SQL_TEXT
             3 select 1 from dual foo where 1=1
             1 select 2 from dual foo where 2=2
             3 select 3 from dual foo where 3=3
             1 select executions, sql_text from v$sqlarea where upper(sql_text) like 'SELECT%FROM DUAL FOO%' order by 2
    // if the DUAL select is unbundled from the above SQL insert, the
    // constructor is only executed once
    SQL> select TMyRow(3, sysdate) from dual;
    TMYROW(3,SYSDATE)(ID, DAY, VAL)
    TMYROW(3, '2012/04/10 10:21:47', 'TMyRow()')
    constructing TMyRow(): id=3 day=2012/04/10 10:21:47Why 3x? The reason seems to be the column count. 3 columns in table (3 properties in object).
    4 properties or columns? Constructor is called 4x. 8 properties or columns? Constructor is called 8x.
    Ugly, and very much an unexpected, overhead. Is this behaviour documented somewhere? (I could not find anything - but then I was also not sure how express this issue as a meaningful search term)

    But it does not occur when calling a PL/SQL function that is not a constructorWith respect yes it does. You did not either explicitly or implicitly reference the result of that function multiple times. Try with a PL/SQL function that returns and object type with multiple attributes...
    SQL> CREATE OR REPLACE FUNCTION f_tmyrow (i INTEGER, d DATE)
      2     RETURN tmyrow
      3  AS
      4     rtn tmyrow;
      5  BEGIN
      6     DBMS_OUTPUT.put_line ('returning TMyRow(): id=' || i || ' day=' || d);
      7     RETURN tmyrow (i, d, 'TMyRow()');
      8  END f_tmyrow;
      9  /
    SQL> INSERT INTO mytab VALUES (f_tmyrow (1, SYSDATE));
    returning TMyRow(): id=1 day=10-APR-12
    returning TMyRow(): id=1 day=10-APR-12
    returning TMyRow(): id=1 day=10-APR-12
    1 row created.
    SQL> CREATE OR REPLACE FUNCTION f_tmyrow (i INTEGER, d DATE)
      2     RETURN tmyrow DETERMINISTIC
      3  AS
      4     rtn tmyrow;
      5  BEGIN
      6     DBMS_OUTPUT.put_line ('returning TMyRow(): id=' || i || ' day=' || d);
      7     RETURN tmyrow (i, d, 'TMyRow()');
      8  END f_tmyrow;
      9  /
    Function created.
    SQL> INSERT INTO mytab VALUES (f_tmyrow (1, SYSDATE));
    returning TMyRow(): id=1 day=10-APR-12
    1 row created.
    SQL>Which also rather interestingly shows that the DETERMINISTIC keyword is observed in SQL (in a within-row context) other than as a requirement for function-based indexes, something which I don't recall noticing before.
    When we create a straightforward table of object type (ignoring the matter of substitutable subtypes for the moment) rather than create a single representation of the object Oracle actually creates a relational table with a column for each attribute.
    Hence my educated guess would be that an SQL of the form...
    INSERT INTO mytab
       SELECT tmyrow (1, SYSDATE)
       FROM   DUAL;...would need to be silently re-written (or at this would be one way of implementing this) to accomodate the above, something like...
    INSERT INTO mytab (id, day, val)
       SELECT tmyrow (1, SYSDATE).id,
              tmyrow (1, SYSDATE).day,
              tmyrow (1, SYSDATE).val
       FROM   DUAL d;Note that this is behaviour is similar whether the function being called is a type constructor function, other type method or standalone/packaged PL/SQL function returning object type.
    At which point we are tempted to write the above (or question why Oracle does not) to avoid this rather obvious inefficiency.
    SELECT d.t.id, d.t.day, d.t.val
       FROM  (SELECT tmyrow (1, SYSDATE) t
              FROM   DUAL) d;Those who have worked with PL/SQL functions in SQL will not be surprised that we do not succeed. Looking at the projection column from explain plan for COUNT (id), COUNT (day), COUNT (val) of this SELECT (the plain SELECT does not yield a value in the projection column), we see we once again have three calls to the function.
    COUNT(SYS_OP_ATG("TMYROW"."TMYROW"(1,SYSDATE@!),3,4,2))[22], COUNT(SYS_OP_ATG("TMYROW"."TMYROW"(1,SYSDATE@!),2,3,2))[22], COUNT(SYS_OP_ATG("TMYROW"."TMYROW"(1,SYSDATE@!),1,2,2))[22]If we go a step further and prevent the above view from being merged it forces our projection to be what we want, and we can see from debug that the function is now executed once only.
    "ID"[NUMBER,22], "DAY"[DATE,7], "VAL"[VARCHAR2,10]This is all of course identical to how PL/SQL functions behave when queried through in-line views, hence my approach in the previous thread of tuning this as per a normal PL/SQL function call.
    What I am unable to explain from the above is that there is an obvious counter-case.
    SQL> INSERT INTO mytab (id, day, val)
      2     SELECT d.t.id, d.t.day, d.t.val
      3     FROM   (SELECT tmyrow (1, SYSDATE) t
      4             FROM   DUAL) d;
    constructing TMyRow(): id=1 day=10-APR-12
    1 row created.
    SQL> From what we have seen I would expect this view to be merged and the function to be called three times, as it is with the standalone SQL...
    SQL> SELECT d.t.id, d.t.day, d.t.val
      2  FROM   (SELECT tmyrow (1, SYSDATE) t
      3          FROM   DUAL) d;
          T.ID T.DAY     T.VAL
             1 10-APR-12 TMyRow()
    SQL> exec null;
    constructing TMyRow(): id=1 day=10-APR-12
    constructing TMyRow(): id=1 day=10-APR-12
    constructing TMyRow(): id=1 day=10-APR-12
    PL/SQL procedure successfully completed.
    SQL>

  • Inserting values using merge

    Hi everyone,
    I need help with inserting values using merge.
    * I need to check all the units in a parent category. For example, NF_ARTICLECATEGORYID = 7462 is a parent category.
    * Im going to compare all the units in the parent category(7642) to the units in a subcategory (8053).
    * If the units in parent category(7642) is not present in the subcategory(8053) then the units will be inserted in the same table.
    table structure:
    Table name : ARTICLECATEGORYACCESS
    Fields: IP_ARTICLECATEGORYACCESSID
    NF_ARTICLECATEGORYID
    NF_UNITID
    NF_USERID
    N_VIEW
    N_EDIT
    Sample data:
    CREATE TABLE articlecategoryaccess (
    IP_ARTICLECATEGORYACCESSID NUMBER(5),
    NF_ARTICLECATEGORYID NUMBER (10),
    NF_UNITID NUMBER (10),
    NF_USERID NUMBER (10)
    N_VIEW INT,
    N_EDIT INT);
    INSERT INTO articlecategoryaccess VALUES (255583, 7642, 29727, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (243977,7642,29728, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (240770,7642,29843, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (243413,7642,29844, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (274828,7642,44849, NULL, 1 ,1);
    INSERT INTO articlecategoryaccess VALUES (274828,8053,44849, NULL, 1 ,1);
    Units ID 29727, 29728, 29843, 29844, 44849 has access to parent category 7642.
    The units id 29727, 29728, 29843, 29844 dont have access to subcategory 8053.
    29727, 29728, 29843, 29844 should be inserted in the same table and will have an access to 8053.
    After they are inserted, it should look like this
    IP_ARTICLECATEGORYACCESSID     NF_ARTICLECATEGORYID     NF_UNITID NF_USERID N_VIEW N_EDIT
    255583     7642     29727 null 1 1
    243977     7642     29728 null 1 1
    240770     7642     29843 null 1 1
    243413     7642     29844 null 1 1
    274828     7642     44849 null 1 1
    new value     8053     44849 null 1 1
    new value     8053     29843 null 1 1
    new value     8053     29844 null 1 1
    new value     8053     29728 null 1 1
    new value     8053     29727 null 1 1
    NOTE: IP_ARTICLECATEGORYACCESSID is a sequence and it should be unique
    DECLARE
    BEGIN
    MERGE INTO articlecategoryaccess b
    USING (SELECT *
    FROM articlecategoryaccess c
    WHERE nf_articlecategoryid = 7642
    MINUS
    SELECT *
    FROM articlecategoryaccess c
    WHERE nf_articlecategoryid = 8053) e
    ON (1 = 2)
    WHEN NOT MATCHED THEN
    INSERT (b.ip_articlecategoryaccessid, b.nf_articlecategoryid, b.nf_unitid, b.NF_USERID, b.N_VIEW, b.N_EDIT)
    VALUES (articlecategoryaccessid_seq.nextval, 8053, e.nf_unitid, null, 1, 1);
    END;
    i got an error after running the script:
    *Cause:    An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you may see
    this message if a duplicate entry exists at a different level.
    *Action:   Either remove the unique restriction or do not insert the key.
    why would it be duplicated? its a sequence and its unique.. I dont know, maybe there is something wrong my script..
    Any help is appreciated..
    Ed

    Ed,
    1. What is the current value of the Sequence? Does the current value of sequence exist in the table? If yes, then increment the sequence to a value that is not present in the Table.
    2. Do you have any unique constraint on any of the columns that you are inserting?
    I have to ask you again, Why are you insisting on Merge statement when a simple Insert can do the job for you? Don't you feel that the below specified Merge statement is making things look more Complicated than they actually are, do you?
    Think on it and then proceed. I hope these pointers help you to resolve the issue.
    Regards,
    P.

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • Dynamic sql reurns no data when multiple values are passed.

    (Dynamic sql returns no data when multiple values are passed.)
    Hi,
    While executing the below dynamic sql in the procedure no data is returned when it has multiple input values.
    When the input is EMPID := '1'; the procedure works fine and returns data.Any suggestion why the procedure doen't works when input as EMPID := '1'',''2'; is passed as parameter?
    =======================================================
    create or replace PROCEDURE TEST(EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
    stmt VARCHAR2(9272);
    V_EMPID VARCHAR2(100);
    BEGIN
    V_EMPID :=EMPID;
    stmt := 'select * from TEST123 where Empid is NOT NULL';
    IF V_EMPID <> '-1' THEN
    stmt := stmt || ' and Empid in (:1)';
    ELSE
    stmt := stmt || ' and -1 = :1';
    END IF;
    OPEN rc FOR stmt USING V_EMPID;
    END Z_TEST;
    ============================================================
    Script for create table
    ==================================================================
    CREATE TABLE TEST123 (
    EMPID VARCHAR2(10 BYTE),
    DEPT NUMBER(3,0)
    ===========================================
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('1',20);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('2',10);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('3',30);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('3',30);
    Insert into PDEVUSER.TEST123 (EMPID,DEPT) values ('2',10);
    =============================================
    Select * from TEST123 where Empid in (1,2,3)
    EMPID DEPT
    1     20
    2     10
    3     30
    3     30
    2     10
    ===================================================================
    Any suggestion why the procedure doen't works when input EMPID := '1'',''2';?
    Thank you,

    The whole scenario is a little strange. When I tried to compile your procedure it couldn't compile, but I added the missing info and was able to get it compiled.
    create or replace PROCEDURE TEST (EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
      stmt        VARCHAR2 (9272);
      V_EMPID     VARCHAR2 (100);
    BEGIN
      V_EMPID := EMPID;
      stmt := 'select * from TEST123 where Empid is NOT NULL';
      IF V_EMPID = '-1' THEN
        stmt := stmt || ' and Empid in (:1)';
      ELSE
        stmt := stmt || ' and -1 = :1';
      END IF;
      OPEN rc FOR stmt USING V_EMPID;
    END;If you pass in 1 as a parameter, it is going to execute because the statement that it is building is:
    select * from TEST123 where Empid is NOT NULL and -1 = 1Although the syntax is valid -1 will never equal 1 so you will never get any data.
    If you pass in 1,2 as a parameter then it is basically building the following:
    select * from TEST123 where Empid is NOT NULL and -1 = 1,2This will cause an invalid number because it is trying to check where -1 = 1,2
    You could always change your code to:
    PROCEDURE TEST (EMPID IN VARCHAR2, rc OUT sys_refcursor)
    IS
      stmt        VARCHAR2 (9272);
      V_EMPID     VARCHAR2 (100);
    BEGIN
      V_EMPID := EMPID;
      stmt := 'select * from TEST123 where Empid is NOT NULL';
      stmt := stmt || ' and Empid in (:1)';
      OPEN rc FOR stmt USING V_EMPID;
    END;and forget the if v_empid = '-1' check. If you pass in a 1 it will work, if you pass in 1,2 is will work, but don't pass them in with any tick marks.

  • When inserting 3 column details in a single table using Stored Procedure.Only 1 Column details getting inserted.Other 2 Column details are not getting into the table.Please see the below script and help me to change.

    From the Parent Table i need to insert rows which are all under this column {(TradeIn_1_VIN),(TradeIn_2_VIN),(TradeIn_3_VIN) } into SALES_TRADEIN Table .
    I have used the below Query,
    But it reads only (TradeIn _1_Vin) Column in the SALES_TRADEIN table rest 2 records got skipped..
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES
    @SalesID,
    case when @TradeIn_1_VIN is null then @TradeIn_2_VIN else @TradeIn_1_VIN end,
    case when @TradeIn_1_Make is null then @TradeIn_2_Make else @TradeIn_1_Make end,
    case when @TradeIn_1_Model is null then @TradeIn_2_Model else @TradeIn_1_Model end,
    case when @TradeIn_1_ExteriorColor is null then @TradeIn_2_ExteriorColor else @TradeIn_1_ExteriorColor end,
    case when @TradeIn_1_Year is null then @TradeIn_2_Year else @TradeIn_1_Year end,
    case when @TradeIn_1_Mileage is null then @TradeIn_2_Mileage else @TradeIn_1_Mileage end,
    case when @TradeIn_1_Gross is null then @TradeIn_2_Gross else @TradeIn_1_Gross end,
    case when @TradeIn_1_Payoff is null then @TradeIn_2_Payoff else @TradeIn_1_Payoff end,
    case when @TradeIn_1_ACV is null then @TradeIn_2_ACV else @TradeIn_1_ACV end,
    case when @TradeIn_1_InteriorColor is null then @TradeIn_2_InteriorColor else @TradeIn_1_InteriorColor end
    END TRY
    Actually my problem is
     If  [(TradeIn_1_VIN),(TradeIn_2_VIN),(TradeIn_3_VIN)] these 3 columns have details i need all the 3 columns  details need to be read to SALES_TRADEIN table.
    Suppose if we have data only in [(TradeIn_1_VIN),(TradeIn_2_VIN)] then these column details need to loaded in the SALES_TRADEIN table.
    If any columns are blank no problem it can move next process.
    Please help me change those particular lines to insert all the 3 records  (TradeIn_1_VIN) (TradeIn_2_VIN) (TradeIn_3_VIN) in to the table.

    From SQL2008 on, besides INSERT-SELECT, and INSERT-EXEC, the INSERT-VALUES form of the insert command is improved. It can insert multiple rows like this:
    INSERT INTO my_table(MyColA, MyColB)
    VALUES
    (1, 1),
    (2, 2),
      (3, 3)
    You could also use that in SELECTs, like this:
    SELECT *
    FROM
    (    VALUES (1,2), (3,4)
    ) t(a, b)

  • Error when inserting or changing in a sorted table

    Hi Experts,
    When i am executing a webdynpro application it says Error when inserting or changing in a sorted table. Can any one help for this.
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: IF_COMPONENTCONTROLLER~GET_CATEGORY_LIST of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: WDDOMODIFYVIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_DO_MODIFY_VIEW of program /1BCWDY/F9XHYWN4WKNMG4CDUGA8==CP
    Method: DO_MODIFY_VIEW of program CL_WDR_DELEGATING_VIEW========CP
    Method: MODIFY_VIEW of program CL_WDR_VIEW===================CP
    Method: DO_MODIFY_VIEW of program CL_WDR_CLIENT_COMPONENT=======CP
    Method: DO_MODIFY_VIEW of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
    in ST22
    Object Definition
      DATA: lo_node                   TYPE REF TO if_wd_context_node,
            lo_node_info              TYPE REF TO if_wd_context_node_info,
            lo_element                TYPE REF TO if_wd_context_element.
    Additional Data declarations
      DATA: lv_key TYPE string.
    Get context node.
      lo_node = wd_context->get_child_node( name = 'DROPDOWNLISTS' ).
      lo_node_info = lo_node->get_node_info( ).
    Call method to fetch the categories.
      CALL METHOD cl_hap_wd_start_page_ui=>category_get_list
        EXPORTING
          add_on_application = add_on_application
        IMPORTING
          t_categories       = lt_categories.
    Append Default selection entry 'All'.
      lw_category-category_id = '00000000'.
      lw_category-category_name = 'All'.
      APPEND lw_category TO lt_categories.
    Sort table after appending the new entry.
      SORT lt_categories ASCENDING.
    Loop through the category list and populate key(category_id) value(category_name) pair for
      LOOP AT lt_categories INTO lw_category.
        lw_key_value-key = lw_category-category_id.
      625     lw_key_value-value = lw_category-category_name.
    >>>>>     APPEND lw_key_value TO lt_key_values.------>Here it throws an error
      627     CLEAR: lw_key_value, lw_category.
      628   ENDLOOP.
      629
      630 * Bind the category key-value pair to the context attribute.
      631   CALL METHOD lo_node_info->set_attribute_value_set
      632     EXPORTING
      633       name      = 'CATEGORY_LIST'
      634       value_set = lt_key_values.
      635
      636 * Make the entry 'All' as default selected.
      637   CALL METHOD lo_node->set_attribute
      638     EXPORTING
      639       value = '00000000'
      640       name  = 'CATEGORY_LIST'.
      641
      642 ENDMETHOD.
      643
      644 method GET_EMPLOYEES.
      645

    Hello Durga,
    from the error what I understood is lt_key_values is a sorted table and you are trying append a new line to it. Incase of sorted table you need to use the INSERT statement and not the APPEND statement.
    INSERT lw_key_value INTO table lt_key_values.
    BR, Saravanan

Maybe you are looking for