Update the base table

Hi experts help me,
I have one requirment
there have two machine(plant) fert1,fert2 each one have some materilas.
from one of the plant  will be goining to stop(fert1).
than we need featch the issued material from fert1 in reverse  order to store it than post the meterial into fert2 based on the production number.
Please help me,
THANKS advance
Moderator message: "spec dumping", please work yourself first on your requirement.
Edited by: Thomas Zloch on Oct 29, 2010 1:54 PM

Hi,
I'm not sure what you're asking in either question. It would help if you gave a specific example of what you want to do.
SowmyRaj wrote:
Hi Experts , I need help in two qurstions
1. How to update a view without modifying the base table ?You can't.
Views don't contain any data; they just query base tables.
You can change the definition of a view (CREATE OR REPLACE VIEW ...) so that it appears that the base table(s) have changed; that won't change the base tables.
2. How to write a file unix operating system in pl/sql ? is there any built in procedure is there ?The package utl_file has routines for working with files.

Similar Messages

  • Updating a Base Table through a View having UNPIVOT function.

    Hi,
    I have a requirement of updating a Base Table through a View.
    This View has the query using a UNPIVOT function for displaying the columns of the Base tables in rows.
    I need to update/insert into/delete the Base Table by accessing the View (The user doesn't have an access to the Base Table, hence the DML's on the View).
    Following is the table I've created:-
    CREATE TABLE PERSON_DETAILS
      PID            VARCHAR2(10 BYTE),
      FIRSTNAME      VARCHAR2(1000 BYTE),
      LASTNAME       VARCHAR2(1000 BYTE),
      PHONENUMBER    VARCHAR2(1000 BYTE),
      ADDRESS1       VARCHAR2(1000 BYTE),
      ADDRESS2       VARCHAR2(1000 BYTE),
      COUNTRY_CODE   VARCHAR2(1000 BYTE),
      LANGUAGE_CODE  VARCHAR2(1000 BYTE),
      EMAIL          VARCHAR2(1000 BYTE)
    )The sample values are inserted in this table through the below script:-
    insert into person_details values ('1','XYZ','ABC','1234567890','India','Asia','IN','EN','[email protected]');
    insert into person_details values ('2','XYZ2','ABC2','1234567890','India','Asia','IN','EN','[email protected]');The code for the view is as below:-
    CREATE OR REPLACE FORCE VIEW PERSON_DETAILS_VIEW
       PID,
       CD_NAME,
       CD_VALUE
    AS
       SELECT "PID", "CD_NAME", "CD_VALUE"
         FROM person_details UNPIVOT INCLUDE NULLS (cd_value
                             FOR cd_name
                             IN  (firstname AS 'First Name',
                                 lastname AS 'Last Name',
                                 phonenumber AS 'Phonenumber',
                                 address1 AS 'address1',
                                 address2 AS 'address2',
                                 country_code AS 'Country Code',
                                 language_code AS 'Language Code',
                                 email AS 'Email') );Below are the values from the view:-
    PID CD_NAME         CD_VALUE
    1    First Name       XYZ
    1    Last Name       ABC
    1    Phonenumber  1234567890
    1    address1         India
    1    address2         Asia
    1    Country Code   IN
    1    Language Code EN
    1    Email               [email protected]
    2    First Name       XYZ2
    2    Last Name       ABC2
    2    Phonenumber  1234567890
    2    address1         India
    2    address2         Asia 
    2    Country Code   IN
    2    Language Code EN
    2    Email               [email protected] user would fire some statement like below:-
    update person_details_view
    set cd_value = 'US' where CD_NAME = 'IN'The above statement should update the base table PERSON_DETAILS.
    I understand I can write an INSTEAD OF trigger but I do not know what logic to write in the trigger so that the requirement gets fulfilled.
    My Oracle Version
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0    Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionAny help would be highly appreciated.
    Thank You,
    Ankit Khare.
    Edited by: Ankit_Khare84 on Jun 28, 2012 2:47 PM

    it is definitively possible with an instead of trigger.
    for Example:
    create or replace
    TRIGGER ioft_person
    INSTEAD OF UPDATE
    ON person_details_view
    FOR EACH ROW
    declare
    firstname1  person_details.firstname%type;
    BEGIN
                  SELECT firstname_new into firstname1
                  FROM   (SELECT pid, cd_name, cd_value
                          FROM  
                                  select * from person_details_view where (pid, cd_name) not in (select :new.pid, :new.cd_name from dual)
                                  union all
                                  select :new.pid, :new.cd_name, :new.cd_value from dual
                  PIVOT  ( max(cd_value) AS new FOR (cd_name) IN
                                                          ('First Name' AS firstname,
                                                            'Last Name' as lastname,
                                                            'Phonenumber' as phonenumber,
                                                            'address1' as address1,
                                                            'address2' AS address2,
                                                            'Country Code' as country_code,
                                                            'Language Code' as language_code,
                                                            'Email' as email
                  )  where pid = :old.pid;
      UPDATE person_details
      SET firstname = firstname1
      WHERE pid = :old.pid;
    END ioft_role_perm;and than run
    update person_details_view
    set cd_value = 'X|X' where cd_name = 'First Name' and pid=1The logic is: you must convert back the view through pivoting

  • How to update view  without modifying the base table ?

    Hi Experts , I need help in two qurstions
    1. How to update a view without modifying the base table ?
    2. How to write a file unix operating system in pl/sql ? is there any built in procedure is there ?
    Thank you

    Hi,
    I'm not sure what you're asking in either question. It would help if you gave a specific example of what you want to do.
    SowmyRaj wrote:
    Hi Experts , I need help in two qurstions
    1. How to update a view without modifying the base table ?You can't.
    Views don't contain any data; they just query base tables.
    You can change the definition of a view (CREATE OR REPLACE VIEW ...) so that it appears that the base table(s) have changed; that won't change the base tables.
    2. How to write a file unix operating system in pl/sql ? is there any built in procedure is there ?The package utl_file has routines for working with files.

  • API to update oracle base table in oracle apps

    Hi,
    What is the API used to update a base table in oracle contracts?
    Please suggest.

    If you are on 11i, please check irep.oracle.com
    It lists all APIs available.
    IREP - Oracle Integration Repository: The Tool To Find Which API Is Supported and How To Use It ... (Doc ID 554986.1)
    For R12, see
    Oracle Integration Repository Documentation Resources Release 12 (Doc ID 396116.1)
    Note: 462586.1 - Where are the Oracle® Release 12 (R12) API Reference Guide?
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=462586.1
    Note: 458225.1 - Release 12 Integration Repository
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=458225.1
    Hope this helps,
    Sandeep Gandhi

  • Data Not loaded from  ap_invoice_lines_interface to the base table

    Hi ,
    Please I'm working on Interface which load invoices from Cobol system to oracle , anyway procedure is working on fine & all data is loaded to the interface as i'm inserting 4 attributes which is DFF on the invoice line level
    Now when i ran the import program all data is loaded to the base table except one of the attributes isnot loaded .
    will anyone tell me what is the reason or how can i trace that ..........
    Thanks In Advance

    Dear All ,,,,
    Please i got it's a matter of size of the attribute1 segment i increased it ,,,,,,,,,but now the issue that data is saved in the base table but not showing in the screen
    will you please help me in that
    Edited by: miro_feps on May 21, 2012 1:01 AM

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • How to update the VBFA table without entries in VBRK and VBRP tables

    Hello,
    I have a requirement , where the sales order , delivery happens in one SAP system say X system and billing document wil happens in other sap system say Y.
    Now in this particular case , if the user want to know the billing document number in X system. what would be the solution.
    Is there any possibility to update the VBFA table with invoice number of Y system (without updating the VBRK and VBRP tables).
    User want to see the billing doc number from sales order in the form of document flow in X system
    Thanks in advance
    Pradeep

    Hii
    Without updating VBRK/VBRP table and updating VBFA is not possible, So you have to play with work arround to create one Z TABLE, so whenever system Y will create billing document with the reference of System X data you have to update Ztable with Invoice number created in System Y, The primary key will be in Z TABLE is Delivery document number to track one to one with billing doc.
    Thanks and Regards
    Shambhu Sarkar

  • In 10g  ( 10.1.4.3)OID, what are the base tables

    Hi ,I need to clean the users and groups from the OID manually ( i have deleted them using bulkload but oid tree is inconsistent stage)
    so now i have to clean them from the base tables,
    anyone faced this situation before, appreciate your help.

    Check the ORACLE_HOME/ldap/log directory and the contents of oidmon.log and oidldapd01.log
    I found a similar error after the 10.1.4.3 upgrade and needed to rerun the root.sh script.
    It is helpful to shut everything down, cleanout the log files and file up OPMN (start) and the OID (using startproc).
    Good luck!

  • How do I update the result table ?

    I am having problem to design and update the competition results in WPC_RESULTS table.
    I have 3 tables
    1. WPC_COMPETITION - It has details of the competition to be conducted.
    2. WPC_MEMBERS - Member details.
    3. WPC_RESULTS - Competition results which will have Member_ID, Competition_ID and Status.
    In Region 1. I have a drop down list from which I can select the Competition.
    Problem is with region 2.
    ==================
    In Region 2. I plan to have All the Member's Name from WPC_MEMBERS, a Status column (W=Win or L=Lost or X=NotPlayed) from WPC_RESULT which can be updated. But the table WPC_RESULTS dosenot have a primary key but has 2 foreign key one from WPC_COMPETITION and one from WPC_MEMBERS.
    I am just not able to plan & create this region 2.
    Can someone login to my wokspace and give me a helping hand.
    Please mail me at [email protected] and I would give you the password for my workspace.
    Regards,
    Nikhil Karnik

    My problem is since the WPC_RESULT table has two master tables. I cannot use a Master Detail form.
    What I am trying is,
    On a form which displays all the member in WPC_MEMBERS, Drop down list of competition name from WPC_COMPETITION table and a there should be checkbox for status column of WPC_RESULT. So my challenge is to update the WPC_RESULT table with the respective member id and competition id and status in WPC_RESULT table.
    As you said I can use a PL/SQL, but I could not understand how do create my PLSQL block to identify each member on the form and update the competition status associated with that member.
    in short the table definition is like
    CREATE TABLE "WPC_COMPETITION"
    (     "COMPETITION_NAME" VARCHAR2(100),
         "COMPETITION_CODE" NUMBER,
         "DATE_CONDUCTED" DATE,
         CONSTRAINT "WPC_PK1" PRIMARY KEY ("COMPETITION_CODE") ENABLE
    CREATE TABLE "WPC_COMPETITION"
    (     "COMPETITION_NAME" VARCHAR2(100),
         "COMPETITION_CODE" NUMBER,
         "DATE_CONDUCTED" DATE,
         CONSTRAINT "WPC_PK1" PRIMARY KEY ("COMPETITION_CODE") ENABLE
    CREATE TABLE "WPC_RESULTS"
    (     "COMPETITION_CODE" NUMBER,
         "STATUS" VARCHAR2(1),
         "MEMBER_ID" NUMBER
    ALTER TABLE "WPC_RESULTS" ADD CONSTRAINT "WPKD_FK1" FOREIGN KEY ("COMPETITION_CODE")
         REFERENCES "WPC_COMPETITION" ("COMPETITION_CODE") ENABLE
    ALTER TABLE "WPC_RESULTS" ADD CONSTRAINT "WPKD_FK2" FOREIGN KEY ("MEMBER_ID")
         REFERENCES "WPC_MEMBERS" ("MEMBER_ID") ENABLE
    /

  • In OWB I need to update the target table with same field for match/update

    In OWb I am trying to update the target table with the match and the update on the same field can this be done. I am getting a error match merge error saying you cannot update and match on the same field. But in SQl my select is
    Update table
    set irf = 0
    where irf = 1
    and process_id = 'TEST'
    Hwo do i do this in OWB.

    table name is temp
    fields in the table
    field1 number
    field2 varchar2(10)
    field3 date
    values in the table are example
    0,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    In the above example I need to update the first row field1 to 1.
    Update temp
    set field1 = 1
    where field1 = 0
    and field2 = 'TEST'
    when I run this I just need one row to be updated and it should look like this below
    1,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    But when I run my mapping I am getting the rows like below the second row with 9 also is getting updated to 1.
    1,'TEST',05/29/2009
    1,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009

  • Index not using the base table

    Hi,
    In which scenario, a query will only use the index and not the base table. Please give me some example.
    Thanks,
    Santhosh
    Edited by: Santhosh on Oct 23, 2012 2:45 AM

    Chancal,
    not always,
    SQL> desc temp;
    Name                                                                                                      Null?    Type
    EMPNO                                                                                                              NUMBER(4)
    ENAME                                                                                                              VARCHAR2(10)
    JOB                                                                                                                VARCHAR2(9)
    MGR                                                                                                                NUMBER(4)
    HIREDATE                                                                                                           DATE
    SAL                                                                                                                NUMBER(7,2)
    COMM                                                                                                               NUMBER(7,2)
    DEPTNO                                                                                                             NUMBER(2)
    SQL> select empno from temp;
         EMPNO
          7369
          7499
          7521
          7566
          7654
          7698
          7782
          7788
          7839
          7844
          7876
          7900
          7902
          7934
          1057
    15 rows selected.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  3qt0w20pqj162, child number 0
    select empno from temp
    Plan hash value: 3800668828
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |       |       |     2 (100)|          |
    |   1 |  TABLE ACCESS FULL| TEMP |    15 |    60 |     2   (0)| 00:00:01 |
    13 rows selected.
    SQL> alter table temp modify(empno not null);
    Table altered.
    SQL> select empno from temp;
         EMPNO
          1057
          7369
          7499
          7521
          7566
          7654
          7698
          7782
          7788
          7839
          7844
          7876
          7900
          7902
          7934
    15 rows selected.
    SQL> select * from table(dbms_xplan.display_cursor);
    PLAN_TABLE_OUTPUT
    SQL_ID  3qt0w20pqj162, child number 0
    select empno from temp
    Plan hash value: 472861760
    | Id  | Operation        | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |          |       |       |     1 (100)|          |
    |   1 |  INDEX FULL SCAN | IDX_TEMP |    15 |    60 |     1   (0)| 00:00:01 |
    13 rows selected.

  • Update the Z table taking Max time.

    Dear Friends,
    I am updating a Z table for a sigle field value, I am doing it in loop and giving all the primary key fields in where condition, Its updating the records properly.
    But The time is taking more if there are more records ( say 3000 + reacords ) , Now I am planning to update it in a single statement but the Sy-subrc is giving me 4 and the records were not updated in Z table.
    pls let me know how to update the Z table in a single statement??
    pls find the below code:
    corent code:
        UPDATE zXX CLIENT SPECIFIED
                        SET zyy = it_finaldata-zyy
                     WHERE mandt = sy-mandt AND
                           matnr = it_finaldata-matnr AND
                           matkl = it_finaldata-matkl .
    this is within a loop and working fine but taking max time more than 30 mins.
    now I have moved all the data into anothere internal table ( the internal table is same like Z table )
    I am using the below statement but its not working:
    update zXX FROM table it_savedata.
    Pls help me.
    Thanks,
    Sridhar

    Hi
    If u use update that line should exist in DB table otherwise the sy-subrc will be 4. You can use MODIFY statement . The advantage is that if a line exist it will modify that particular line otherwise it will create a new line in DB table.
    MODIFY dtab FROM TABLE itab.
    Regards
    Sathar

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Updating the VETVG table while creating the purchase order

    hi all,
       I have one requirement to calculated the delivery creation date while creating the Purchase Order. It is calculated based on the delivery date of PO. I have calculated that one but how to update it after calculation. Can any body give a user exit or BADI with implementation which will update the VETVG table while creating the PO.
    Thanks
    rajkumar

    hi sanjay,
    thanks for reply, I am using same BADI(ME_PROCESS_PO_CUST) and implementation(FIELDSELECTION_ITEM_REFKEYS). In this implementation i am setting the shipping data with SET_SHIPPINGDATA method . but after that the values are not updating the EKPV and VETVG tables but it is only showing in the screen. Can you give a idea where to pass these values so it will update the tables.
    thanks
    rajkumar

  • How  and where does SAP standard programs update the master tables...

    Hello there,
    How  and where does SAP standard programs update the master tables...
    to be precise.. if a (any) transaction occurs  the programs behind it holds the data in temporary structures.
    where and when does it get updated in the master table.
    can anyone tell me how it happens?
    I Know that from the where used list one can find the corresponding table but most of the time it wont suffice
    I am expecting a proper answer.
    Santosh B

    Hello Santosh,
    you need to do some self-reading on the following topic
    Updates in the SAP System (BC-CST-UP)
    http://help.sap.com/saphelp_47x200/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/frameset.htm
    Regards,
    Siddhesh

Maybe you are looking for