SO & PO in same table

hi friends ,
can i get VBELN (SO) and EBELN (PO) in same ddic table.
thanks .
BHUPI

Hi bhupi kaler,
Have a look on EKKN table...
Also see other EK* tables... and VB* tables...
Also look in to VBKD-BSTKD and VBKD-VBELN
Plese elaborate on ur req...
Or just you need to join tables or use for all entries to get the required result...
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7

Similar Messages

  • How to populate data in the same table based on different links/buttons

    Hi
    I'm using jdeveloper 11.1.4. I have a use case in which i need to populate data in the same table based on click of different links.
    Can anyone please suggest how can this be achieved.
    Thanks

    I have a use case in which i need to populate data in the same table based on click of different linksDo you mean that you need to edit existing rows ?
    What format do you have the date in - table / form ?

  • Data of column datatype CLOB is moved to other columns of the same table

    Hi all,
    I have an issue with the tables having a CLOB datatype field.
    When executing a simple query on a table with a column of type CLOB it returns error [POL-2403] value too large for column.
    SQL> desc od_stock_nbcst_notes;
    Name Null? Type
    OD_STOCKID N NUMBER
    NBC_SERVICETYPE N VARCHAR(40)
    LANGUAGECODE N VARCHAR(8)
    AU_USERIDINS Y NUMBER
    INSERTDATE Y DATE
    AU_USERIDUPD Y NUMBER
    MODIFYDATE Y DATE
    VERSION Y SMALLINT(4)
    DBUSERINS Y VARCHAR(120)
    DBUSERUPD Y VARCHAR(120)
    TEXT Y CLOB(2000000000)
    NBC_PROVIDERCODE N VARCHAR(40)
    SQL> select * from od_stock_nbcst_notes;
    [POL-2403] value too large for column
    Checking deeply, some of the rows have got the data of the CLOB column moved in another column of the table.
    When doing select length(nbc_providercode) the length is bigger than the datatype of the field (varchar(40)).
    When doing substr(nbc_providercode,1,40) to see the content of the field, a portion of the Clob data is retrieved.
    SQL> select max(length(nbc_providercode)) from od_stock_nbcst_notes;
    MAX(LENGTH(NBC_PROVIDERCODE))
    162
    Choosing one random record, this is the stored information.
    SQL> select length(nbc_providerCode), text from od_stock_nbcst_notes where length(nbc_providerCode)=52;
    LENGTH(NBC_PROVIDERCODE) | TEXT
    -------------------------+-----------
    52 | poucos me
    SQL> select nbc_providerCode from od_stock_nbcst_notes where length(nbc_providerCode)=52;
    [POL-2403] value too large for column
    SQL> select substr(nbc_providercode,1,40) from od_stock_nbcst_notes where length(nbc_providercode)=52 ;
    SUBSTR(NBC_PROVIDERCODE
    Aproveite e deixe o seu carro no parque
    The content of the field is part of the content of the field text (datatype CLOB, containts an XML)!!!
    The right content of the field must be 'MTS' (retrieved from Central DB).
    The CLOB is being inserted into the Central DB, not into the Client ODB. Data is synchronized from CDB to ODB and the data is reaching the client in a wrong way.
    The issue can be recreated all the time in the same DB, but between different users the "corrupted" records are different.
    Any idea?

    939569 wrote:
    Hello,
    I am using Oracle 11.2, I would like to use SQL to update one column based on values of other rows at the same table. Here are the details:
    create table TB_test (myId number(4), crtTs date, updTs date);
    insert into tb_test(1, to_date('20110101', 'yyyymmdd'), null);
    insert into tb_test(1, to_date('20110201', 'yyyymmdd'), null);
    insert into tb_test(1, to_date('20110301', 'yyyymmdd'), null);
    insert into tb_test(2, to_date('20110901', 'yyyymmdd'), null);
    insert into tb_test(2, to_date('20110902', 'yyyymmdd'), null);
    After running the SQL, I would like have the following result:
    1, 20110101, 20110201
    1, 20110201, 20110301
    1, 20110301, null
    2, 20110901, 20110902
    2, 20110902, null
    Thanks for your suggestion.How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Copy values from a filed to another in different blocks in same table

    Hi All,
    How to copy value from a filed to another field in different blocks in same form ?
    example if i change value in Field A of block 1 it should reflect in Field B block 2 and again if i change in Field B block 2 it should reflect in Field A of block 1.
    values will change twice or thrice then it will not change. It is happening like that.
    how to do this ?
    Regards

    Same table / different blocks
    I guess, both blocks will be marked for update, and when your user presses commit, the same table will be updated twice!
    Are you sure that this is what you want to do? Is the same record current in both blocks? If so, you better use 1 block (it can be spread over several canvases and windows) and synchronize the items with the "synchronize item" property.
    Anyway: If you can't apply the synchronize-property bcos the items are in different blocks, you can synchronize with 2 when-validate-item triggers.
    Wolfram

  • Report with multiple COUNT columns with counts from same table

    I am new to discoverer so I am a bit lost.
    I am working to create a report to show usage data from the eBusiness Knowledge Base. I have the query written in SQL using subqueries that is in the format:
    Solution Number | Soultion Title | Solution Views | Positive Feedback | Negative Feedback
    12345 ___________ Title ________ 345 ____________ 98 _______________ 34
    The 'Views', 'Positive' and 'Negative' entries are stored in the same table so i am doing a count where setid=setid and usedtype=VS, then counting where usedtype=PF and usedtype=NF
    In discoverer I can get the solution number, title and ONE of the totals but I can't seem to figure out how to get a COUNT for three different things from the same table in columns on the same row.
    When I go to edit sheet -> select items once I select the COUNT option for the UsedType column in the table CS_KB_SET_USED_HISTS I can't select it again. I also have found now way to add a column based on an entered query.
    If anyone could help it would be much appreciated.
    Thanks
    Edited by: Toolman21 on Dec 2, 2010 2:17 PM
    added ______ to correct spacing.

    Hi,
    You can separate the column by using a case or decode.
    for example create 2 calculations:
    case
    when usedtype='PF'
    then <you original column> --- the one contain them both
    else 0
    end
    case
    when usedtype='NF'
    then <you original column> --- the one contain them both
    else 0
    end
    after that you can create the count aggregation over those.
    Tamir

  • Submitting multiple job on teh same table via trigger

    Hi All,
    I have a trigger that run multiple jobs using dbms_job on the same table. I am trying to refresh two materialized views complete via dbms_job.
    Issue is when data is inserted into NET_CAB table , the trigger kicks off the bothe procedures but only the first materialized view is refreshed and not the other one.
    Attached is the trigger, the procedure and materialized view
    <pre>
    create or replace
    TRIGGER NET_CAB_TRG
    AFTER INSERT OR UPDATE OR DELETE ON NET_CAB
    DECLARE
    pbl NUMBER;
    pbl1 number;
    BEGIN
    SYS.DBMS_JOB.SUBMIT( JOB => pbl,what => 'P_CAB_PROC;' ) ;
    SYS.DBMS_JOB.SUBMIT( JOB => pbl1,what => 'P_CABAS_PROC;') ;
    END;
    </pre>
    <pre>
    create or replace
    procedure P_CAB_PROC
    is
    BEGIN
    dbms_mview.REFRESH('P_CAB','C');
    COMMIT;
    END;
    </pre>
    <pre>
    create or replace
    procedure P_CABAS_PROC
    is
    BEGIN
    dbms_mview.REFRESH('P_CABAS','C');
    COMMIT;
    END;
    </pre>
    <pre>
    CREATE MATERIALIZED VIEW P_CAB
    BUILD DEFERRED
    USING INDEX
    REFRESH COMPLETE ON DEMAND
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS
    SELECT
    seq_nextval AS ID,
    NAME,
    SEGMENT_ID,
    reproject(geometry) AS GEOMETRY
    FROM NET_CAB
    where sdo_geom.validate_geometry(geometry,0.005) = 'TRUE'
    </pre>
    <pre>
    CREATE MATERIALIZED VIEW P_CABAS
    BUILD DEFERRED
    USING INDEX
    REFRESH COMPLETE ON DEMAND
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS
    SELECT
    seq_nextval AS ID,
    NAME,
    SEGMENT_ID,
    reproject(geometry) AS GEOMETRY
    FROM NET_CAB
    where sdo_geom.validate_geometry(geometry,0.005) = 'TRUE'
    AND cis > 4;
    </pre>
    Edited by: CrackerJack on May 22, 2012 8:58 PM

    I can run many procedures in a job:
    BEGIN
      SYS.DBMS_SCHEDULER.CREATE_JOB
           job_name        => 'JOB_REPORT_FPD'
          ,start_date      => TO_TIMESTAMP_TZ('2012/05/31 23:30:00.000000 +07:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
          ,repeat_interval => 'FREQ=MONTHLY;BYMONTHDAY=-1'
          ,end_date        => NULL
          ,job_class       => 'DEFAULT_JOB_CLASS'
          ,job_type        => 'PLSQL_BLOCK'
          ,job_action      => '
            DECLARE
            BEGIN
                ibox_file.fpd_nbot_report;
                ibox_file.fpd_nbot_report(''NBOT'');
                ibox_file.order_report;
                COMMIT;
            EXCEPTION
              WHEN OTHERS THEN ROLLBACK;
            END;
          ,comments        => 'USED FOR REPORTING FPD'
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'RESTARTABLE'
         ,value     => FALSE);
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'LOGGING_LEVEL'
         ,value     => SYS.DBMS_SCHEDULER.LOGGING_RUNS);
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'MAX_FAILURES');
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'MAX_RUNS');
      BEGIN
        SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
          ( name      => 'JOB_REPORT_FPD'
           ,attribute => 'STOP_ON_WINDOW_CLOSE'
           ,value     => FALSE);
      EXCEPTION
        -- could fail if program is of type EXECUTABLE...
        WHEN OTHERS THEN
          NULL;
      END;
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'JOB_PRIORITY'
         ,value     => 3);
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'SCHEDULE_LIMIT');
      SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
        ( name      => 'JOB_REPORT_FPD'
         ,attribute => 'AUTO_DROP'
         ,value     => FALSE);
      SYS.DBMS_SCHEDULER.ENABLE
        (name                  => 'JOB_REPORT_FPD');
    END;
    /

  • How do I sum across the same table in multiple sheets?

    So I'm trying to figure out an annoying problem.
    I have a largish (100's) amount of data with each collection being a table in a sheet, one sheet per data collection. This means I have 100's of sheets, each with the same table name and layout. Each sheet has several hundred data points in it.
    How do I do a sum across all of the same table in all the sheets?
    For example I want to do Sum('Data Sheet Number *'::'Table 1'::A1) to get a sum of everything in all the A1 cells of all the sheets named 'Data Sheet Number ' followed by anything (I'm using the star in the same way one would do it in a shell...)
    Thanks!
    Message was edited by: unusedusername
    Message was edited by: unusedusername

    To respond to WWJD: I was handed the data and I don't have any control over it's format...
    I found the answer in the forums though, so I guess I'm answering my own question
    http://discussions.apple.com/thread.jspa?messageID=6203991&#6203991
    The auto-filling INDIRECT reference worked very well for me.

  • Multiple and conditions in the same table

    Ok I am going to kick myself for this, but I can't figure it out. I am trying to figure out how to find employees which match multiple criteria in the same table.
    create table emp
    (empno number,
    name  varchar2(10))
    create table skills
    (skill_id   number,
    skill_code varchar2(20))
    create table emp_skills
    (empno    number,
    skill_id number,
    rating   number)
    insert into emp values(1, 'SMITH');
    insert into emp values(2, 'JONES');
    insert into skills values (1, 'SQL');
    insert into skills values (2, 'PLSQL');
    insert into skills values (3, 'JAVA');
    insert into emp_skills values(1,1, 8);
    insert into emp_skills values(1,2, 9);
    insert into emp_skills values(1,3, 10);
    insert into emp_skills values(2,1,9);
    insert into emp_skills values(2,2,2);
    insert into emp_skills values(2,3,7);Now I need to come up with a query finding all employees who match all 3 of the following criteria:
    1) Have at least a 5 rating in SQL
    2) Have at least a 6 rating in PLSQL
    3) Have at least a 7 rating in JAVA
    So using this I would expect to return only SMITH since his/her skills meet all 3 criteria. I dont want to use OR in my query since I want all 3 to match not just one of them.
    I have a feeling I will need to self join the table - but this is going to be part of a dynamic query for APEX where the users can choose the skills and ratings they want employees to adhere to, so I dont know the number of criteria or the exact criteria in advance. But I figure if I can get a proof of concept SQL I can make it work dynamically.
    Any ideas are appreciated - sorry for the long post but I figure more detail is better

    with es1 as(
    select s.skill_code, es.empno, es.rating
    from skills s, emp_skills es
    where s.skill_id = es.skill_id
    /* main */
    select e.*
    from emp e
    where
    exists
    (select 'x' from es1
    where es1.rating >= 5
    and es1.skill_code = 'SQL'
    and es1.empno = e.empno)
    and
    exists
    (select 'x' from es1
    where es1.rating >= 6
    and es1.skill_code = 'PLSQL'
    and es1.empno = e.empno)
    and
    exists
    (select 'x' from es1
    where es1.rating >= 7
    and es1.skill_code = 'JAVA'
    and es1.empno = e.empno)
    -- Addition (Another example)
    with es1 as(
    select s.skill_code, es.empno, es.rating
    from skills s, emp_skills es
    where s.skill_id = es.skill_id
    /* main */
    select e.*
    from emp e
    where
    (select count(distinct es1.skill_code) from es1
    where
    ((es1.rating >= 5 and es1.skill_code = 'SQL')
    or
    (es1.rating >= 6 and es1.skill_code = 'PLSQL')
    or
    (es1.rating >= 7 and es1.skill_code = 'JAVA')
    and es1.empno = e.empno)
    =3;

  • How can I align two different text row in the same table in two different way (one centered and the other one on the left)?

    Hi,
    I want to center two different text row that are in the same table but one on the center and the other one on the left. I put a <span> tag hoping that it has been overwhelmed the table's class properties The .bottomsel's font-family and the .Cig84's font-family and colour work but the text-align don't: they're both on the left.
    These are my source and CSS codes:
    Source:
    <table width="600" border="0">
      <tr>
        <td class="bottomref"><p><span class="bottomsel">| <a href="index.html" target="_self">Main</a> | <a href="about.html" target="_self">About</a> | <a href="clients.html" target="_self">Clients</a> | <a href="contact.html" target="_self">Contact</a> |</span><br />
          <span class="credits">Credits: <span class="Cig84">Cig84</span></span></p></td>
      </tr>
    </table>
    CSS:
    .bottomsel {
      text-align: center;
      font-family: Georgia, "Times New Roman", Times, serif;
    .credits {
      text-align: left;
    .Cig84 {
      color: #F00;
      font-family: "Comic Sans MS", cursive;

    Use paragraph tags with CSS classes.
    CSS:
         .center {text-align:center}
         .left {text-align:left}
    HTML:
    <table width="600" border="0">
      <tr>
        <td class="bottomref">
              <p class="center">This text is center aligned</p>
              <p class="left">This text is left aligned</p>
        </td>
      </tr>
    </table>
    Nancy O.

  • How to read the hierarchy data from the same table using loop in AMDP method

    Hi All,
    We have a requirement to get the top partner from BUT050 table.
    Here the Top parent is nothing but the top most in the hierarchy of the partners from BUT050.
    Example:
    For partner 1234 (BUT050-PARTNER1) there is partner 3523(BUT050-PARTNER2) one level above
    For partner 3523(BUT050-PARTNER1)  there is partner 4544 (BUT050-PARTNER2) last level .
    so in this case for the partner 1234 the Top parent is 4544 .
    I have created AMDP Procedure method to get the top-parnet and below given is the logic implemented in AMDP method.
    Here i have implemented a recursive logic with the WHILE loop to get the top most hierarchy partner from the same table BUT050
    IV_Parent is the input partner and ev_top_parent is the output value.
    AMDP Procedure Method:
        DECLARE lv_date VARCHAR(8) := TO_VARCHAR (current_date, 'YYYYMMDD');
        DECLARE found INT := 1;
              iv_partner1 =  SELECT partner1 FROM but050
                              WHERE partner2 = iv_partner
                              AND reltyp = :iv_hierarchy
                              AND date_to >=  :lv_date
                              AND date_from <= :lv_date;
         WHILE found <> 0  do
           select partner1 into ev_top_parent from :iv_partner1;
                           iv_partner1 =  SELECT partner1 FROM but050
                           WHERE partner2 in ( select partner1 from :iv_partner1 where partner1 is not null)
                           AND reltyp = 'ZBP004'
                           AND date_to >= :lv_date
                           AND date_from <= :lv_date;
           select COUNT ( partner1 ) INTO found FROM :IV_PARTNER1;
        END WHILE;
    This method is working fine, but here it is only taking one single partner and getting the top parent as output.
    Now i would like to convert this mehtod so as to accept n number of partners (not one single partner) as input and should process each partner to get the top parent.
    Could anyone guide me how can i handle the given AMDP method further so as to work some how it is within another loop from other AMDP method.
    Thanks.
    Regards,
    Laxman.P

    Hi
    Go to SE11 and enter the hierarchy table name.
    /BIC/H....(infoobject name)...and execute the table and select table entry and delete all....
    Thanks
    TG

  • Load Data from a table on one server's database, to the same table structure in multiple server databases

    Hi,
    I have a situation where i have to load data from one server/database table to multiple servers/databases.
    Example:
    I need to load data from dbo.TABLE_A  (on Server: Server_A & Database: Database_A)  to the same table on the list of server databases like
    Server: Server_B , Database: Database_B
    Server: Server_C , Database: Database_C
    Server: Server_D , Database: Database_D
    Server: Server_E , Database: Database_E
    Server: Server_F , Database: Database_F
    Server: Server_G , Database: Database_G
    Server: Server_H , Database: Database_H
    so on and so forth on 250 such server database combinations.
    The table structure is the same on all the servers.
    If i make the source or destination dynamic, it throws an error while mapping ?
    I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
    Please suggest on how to load data from one source to multiple server/databases.
    Thank you.

    I just need to transfer one table's data. its like i have to use a query to pick data for
    the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
    to append the new records.

  • Two LOVs in same UIX page based on the same table

    Hi group,
    Recently I ran into a problem with a UIX page that has two LOVs based on the same database table. In Emp and Job terminology, here's what I tried to do.
    Suppose we have use the Employees and Jobs tables from the HR scheme with one small modification. Add a column called PREFERRED_JOB_ID of type VARCHAR2(10) which is exactly the same as JOB_ID. Hypothetically speaking, this column will be used to allow Employees to select their preferred job in case they want to change their jobs.
    Next, create business components in JDeveloper based on the Employees and Jobs table. In order to be able to generate the LOVs for Job and PreferredJob create two ViewObjects, one called JobsLookupView and one called PreferredJobsLookupView. These both need to be based upon the same Jobs EntityObject. Also include the Jobs EntityObject twice in the EmployeesView ViewObject and give one the alias PreferredJobs. Include the JobTitle attributes of Jobs and PreferredJobs in EmployeesView so they can contain the JobTitles selected in our future LOVs.
    Next create a ViewController project if it's not already there and enable JHeadstart on it. Create an Application Structure File and create the lookups for the two LOVs. When I run the application I see this happening:
    When I click the flashlight icon next to the PreferredJob LOV and select a job, the PreferredJob field is selected in the UIX page but no job title appears. When I next first select the Job LOV and select a new job and then select the PreferredJob LOV again and select a different job, the job that was selected in the Job LOV is now also entered in the PreferredJob field. When I make sure the PreferredJob field isn't required (remove the required="yes" property on the messageLovInput entry for PreferredJobTitle and remove the PreferredJobTitle field from the addRequiredRowItems list in the UIX page) I can save the changes I made in the Employees.uix page. The same JobId is stored in the database for Job and PreferredJob.
    This behaviour is probably due to cacheing issues because both LOVs and the EmployeesView ViewObject use one EntityObject for four values in three ViewObjects.
    So I then modified my model a bit. I created a new EntityObject called PreferredJobs based on the JOBS table. I modified the EmployeesView ViewObject to use this EntityObject for the PreferredJobTitle attribute and modified the PreferredJobsLookupView to use this EntityObject.
    I needed to modify a few things as well in the Application Structure File (which were prompts and whether or not the attribute should be visible in a table) and after regenerating I made sure the PreferredJob attribute isn't required in the UIX page. When I then run the application again, I never see the JobTitle I select in any LOV allthough the PreferredJob field is selected when I select a Job in the PreferredJob LOV. The correct JobId now is stored in the database though.
    Has anyone ever encoutered this behaviour? Would anyone know how to get two LOVs based on the same table in one UIX page?
    Thanks in advance,
    Wouter van Reeven
    AMIS

    OK I figured it out. When I added the second Lookup ViewObject (PreferredJobs) no additional Association was created. Therefore, ADF BC wasn't able to figure out which field to update. When I added the Association between the PreferredJobs Lookup ViewObject and the Employees ViewObject everything started working ok.
    I then recreated my inital situation: one EntityObject for Jobs and one for Employees, now with two Associations between them. After modifying the Employees ViewObject and making sure the Jobs EntityObject was referred twice and via the corresponding Association, everything started working ok.
    Greets, Wouter
    AMIS

  • How to import a table which is in mdb file(same table in different mdb's)

    Hello,
    how to import a table which is in mdb file(same table in different mdb's)
    e.g. table 'EMPLOYEE' is in 'test.mdb' the same table 'EMPLOYEE' is in 'current.mdb'
    How this can be done on click of a button on my form if the path of mdb is provided?
    Thanks

    This question is not related with ora dev forms, its about Microsoft Access.
    Use import option (File >> Get External Data >> Import)
    or use TransferDatabase action.

  • Triggers to Update rows in the same table

    Hi,
    I have a table called as "Cal" which has the following fields
    CALID
    Description
    RecurringID
    There will be many records with the same recurring id and If the Description field is Updated, then I would like to Update the same description to all the records with the same recurring id (same table). I have tried it with triggers and the I get the ORA-00036 Maximum number of Recursive SQL reached error.
    I have a a row level trigger which captures the change and I use the statment level trigger to update the description field (same table) and I get the error mentioned above.
    Thx in advance
    Ravi

    I have three kind of suggestion.
    (1) Use session variables in a package as flag for prevention from infinitely recursive calling.
    (2) Use temporary tables for similar reason.
    (3) Use instead-of-trigger (need to create view).

  • Trigger in mutation - Update another rows in the same table with a trigger

    Hi ,
    I try to do a before update trigger on a table , but the trigger is in mutation. I understand why it do that but my question is :
    How can I update other rows in the same table when a UPDATE is made on my table??????
    Here is my trigger :
    CREATE OR REPLACE TRIGGER GDE_COMPS_BRU_5 BEFORE
    UPDATE OF DEPARTEMENT--, DISCIPLINE, DEG_DEMANDE, CE_ETAB
    ON GDEM.COMPOSITION_SUBV
    FOR EACH ROW
    Organisme : FQRNT-FQRSC
    Date de création : 14-07-2011
    Date de modification :
    Modifié par :
    Auteur : Johanne Plamondon
    Description : Ce déclencheur s'executera lors de la modification
    du responsable dans la table COMPOSITION_SUBV
    DECLARE
    V_OSUSER V$SESSION.OSUSER%TYPE;
    V_PROGRAM V$SESSION.PROGRAM%TYPE;
    V_TERMINAL V$SESSION.TERMINAL%TYPE;
    V_MACHINE V$SESSION.MACHINE%TYPE;
    V_MODULE V$SESSION.MODULE%TYPE;
    V_LOGON_TIME V$SESSION.LOGON_TIME%TYPE;
    V_AUDIT_ID NUMBER;
    vSEQ NUMBER;
    i NUMBER;
    vID DEMANDE.ID%TYPE;
    BEGIN
    begin
    SELECT OSUSER, PROGRAM, TERMINAL,MACHINE,MODULE, LOGON_TIME
    INTO V_OSUSER,V_PROGRAM,V_TERMINAL,V_MACHINE,
    V_MODULE,V_LOGON_TIME
    FROM V$SESSION
    WHERE TYPE = 'USER'
    AND USERNAME = USER
    AND LAST_CALL_ET IN (0,1)
    AND ROWNUM < 2;
    exception when others then null; end;
    IF NVL(:NEW.SC_PART,' ') = 'CHC' THEN
    SELECT COUNT(*)
    INTO i
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    IF i = 1 THEN
    SELECT ID
    INTO vID
    FROM DEMANDE
    WHERE DEM_REF = :NEW.DEM_ID
    AND PER_NIP = :NEW.PER_NIP;
    UPDATE COMPOSITION_SUBV
    SET --CE_ETAB     = :NEW.CE_ETAB,
    --DISCIPLINE  = :NEW.DISCIPLINE,
    DEPARTEMENT = :NEW.DEPARTEMENT,
    --DEG_DEMANDE = :NEW.DEG_DEMANDE,
    DATE_MODIF = SYSDATE,
    USER_MODIF = V_OSUSER
    WHERE DEM_ID = vID
    AND PER_NIP = :NEW.PER_NIP
    AND ANNEE = :NEW.ANNEE;
    END IF;
    END IF;
    /*EXCEPTION
    WHEN OTHERS THEN
    NULL;*/
    END;

    A standard disclaimer, the mutating trigger error is telling you that you really, really, really don't want to be doing this. It generally indicates a major data model problem when you find yourself in a situation where the data in one row of a table depends on the data in another row of that same table. In the vast majority of cases, you're far better off fixing the data model than in working around the problem.
    If you are absolutely sure that you cannot fix the data model and must work around the problem, you'll need
    - A package with a collection (or global temporary table) to store the keys that are modified
    - A before statement trigger that initializes the collection
    - A row-level trigger that adds the keys that were updated to the collection
    - An after statement trigger that iterates over the data in the collection and updates whatever rows need to be updated.
    If you're on 11g, this can be simplified somewhat by using a compound trigger with separate before statement, row-level, and after statement sections.
    Obviously, though, this is a substantial increase in complexity over the single trigger you have here. That's one of the reasons that it's generally a bad idea to work around mutating table exceptions.
    Justin

  • How to update a table (CUSTOMER) on a Report Server with the data from the same table (CUSTOMER) from another server Transaction server?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) From another server ex: Transaction server?
    Set up steps so inset, update or delete operation takes place across the servers.
    It would be great if someone please enlighten me in details about this process in MS SQL Server 2008 R2.
    Also please describe would it be different for SQL Server 2012?
    If so, then what are the steps?

    I had an interview question that is:
    How to update a table (Customer) on a server ex: Report Server with the data from the same table (Customer) from another server ex: Transaction server?
    Set up steps so that inset, update or delete operation gets done correctly across servers.
    I was not sure about the answer, it would be great if someone please put some light on this and explain in details about this process in MS SQL Server 2008 R2.
    Also it would be very helpful if you please describe would it be different for SQL Server 2012? If so, then what are the steps?

Maybe you are looking for

  • Problem with iTunes in iPhone 4S

    Hello! I have iPhone 4s in iOS 6. When i go to iTunes via iPhone.. it appears this "1" in red cyrcle. And then I cand ged rid of this.. I tap to retry but still nothing.. I cant delete it also.. Any ideas?

  • External HD file size limits for movies

    I recently bought (but have not yet connected) a Western Digital My Book Pro ext.HD for storage and started a thread - 'Best external hard drive...?' in the iMac forum to discuss this. Though the responses were useful I would be pleased to have views

  • Forte for Java CE won't run files created with J2SDK

    I'm very new to Java. When I try to run packages, classes written with Java 2 SDK, I get the following error: java.lang.NoClassDefFoundError: TextComponentPrintWriter (wrong name: utilities/TextComponentPrintWriter) I have mounted the root directory

  • VERY URGENT - Adobe forms with email problems

    I THERE - I AM A ADOBE FORMCENTRAL CLIENT I HAVE MY PAYEMENTS ON DAY BUT FOR SOME REASON THE ADOBE STOP RESENDING TO MY EMAUIL ACOUNT AND TO MY CLIENTS  EMAIL ACCOUNT THE SUMARY OF THE FORM THAT IS SUBMITED. THIS IS VERY URGENT THAT BE FIXED FROM YOU

  • Lost incoming emails?

    I have recently added a second email account (gmail) to my mail box as I have been having major problems with orange ( who have admitted that they have a problem currently sending emails) ; since then, "mail activity" shows incoming email which does