Operations table [PP]

HI Friends !
which table is for Operations[PP], I wanted text with respect to VORNR field.
Regards,
Rahul

check
MAST
MAPL
PLKO
PLPO
if production order is created check
AFVC
AFVV
from AFKO-AUFPL = AFVC-AUFPL.
regards
shiba dutta

Similar Messages

  • Retrival of Control Key of Operation & Table underneeth the structure

    Hi Experts,
       Right now i'm working on PP and PM related stuff, I'm in the middle of the project and stucked down at a point in how to retrive the control key of operation that triggered the update in production order: opoerational view. (CO03).
    Also i have a small question on how to findout the underlying table for a particular field(any field in a screen), when done F1 on that particular field the technical details says as table name but it is actuallya structure. So how should i find the table underneeth the structure where the particular data is being stored.
    Or how should i retrieve the data if i couldn't figure out the table, is there some way that i can retrie the data using the structure.
    Thanks for your contribution.
    Regards
    Rich

    Hi Rich,
    This is a common problem.One of the best and easy way is use the transaction ST05 for trace.lemme explain in detail.
    1.go to ST05 transaction
    2.switch trace on
    3.take your screen where the field resides
    4.enter value in this field and other required field
    5.then save the screen
    6.go to ST05.
    7.stop the trace
    8.click on display trace
    9.you will get a detailed log what all happend
    10.search the log with 'update' or 'insert' word or search with the field.
    11.you can find some table name.
    12.check that table contains the record which you saved.
    Sure this will help
    Another Way
    1.go to transaction se84.
    2.take ABAP dictionary
    3.go to Fields
    4.Give the field name in table field /structure field
    if you are lucky you will get in this
    Regards
    Shibu Kurian

  • Set operations & tables with different columns

    I have a problem. I have 3 tables - Countries, Locations & Departments. I want to output the country_id and country_name from the countries tables for countries that have no departments. Locations has country_id and location_id columns and departments has location_id and department_id columns. All is in Database 11g. I can produce a table which gives me the locations with departments or without departments as follows:
    select location_id from locations intersect select location_id from departments;
    This gives me a list of locations with departments. Conversely I can get a list of locations without departments as follows:
    select location_id from locations minus select location_id from departments;
    However, to combine this output with the countries table I need to produce country_id in the output. However, when I try to add country_id to my code from above as follows:
    select country_id, location_id from locations intersect select to_char(null), location_id from departments;
    I get no rows found. I understand why. There is no intersection between country_id in locations and the null output from departments (where there is no country_id column). Alternatively, if I try as follow:
    select country_id, location_id from locations minus select to_char(null), location_id from departments;
    I get rows with every country_id whether they have departments or not. Again, I understand why. I am essentially subtracting nothing (the to_char(null) from departments) from the country_id column in locations and getting the entire country_id column as output.
    How can I use set operations to produce the country_id column? I also do not want to show the location_id problem.
    This problem is repeated when I try for the final country_id, country_name final output. The countries table has these columns. However, the locations table does not have the country_name column. It only has the country_id column. So a query such as this one:
    select country_id, country_name from countries intersect country_id, to_char(null) from locations;
    presents me with the same problem as above. The country_id column intersects nicely, but the country_name file does not intersect as it does not exist in the locations table. Again, how can I use set operations to produce the country_id and country_name columns.

    Hi,
    the method I outlined for you above should be fine. It doesn't matter that there are one-to-many relationships which may cause repeated output rows; set operations (except for UNION ALL ) always return distinct rows.
    Can you do a query on the countries table, that shows all countries?
    Can you do a query involving all 3 tables inner-joined, that shows the countries that are related to locations and departments? (Repeated rows are okay.)
    Then you can do a MINUS, to get only the countries that are not related to departments.
    If you get stuck, post a little sample data (CREATE TABLE and INSERT statements), the results you want from tha data, your best attemptat a query, and a description of the problem (including the full error message, if any).

  • Returning operation, table and column from a sql query

    Hi,
    I am working on Oracle 10g and i have to do achieve something like this.
    i have to create procedure or functions which will accept a SQL query and will return following :
    1).  Operation like 'SELECT', 'INSERT', 'UPDATE', 'DELETE' etc.
    2).  Column names
    3).  Table involved.
    One way to achieve this would be through hard parsing of string which might be time consuming. So do we have any in-built oracle package or function for the same job ?
    Regards,
    Vikas Kumar

    Check for DBMS_SQL package and DESCRIBE_COLUMNS procedure in that package.
    You might need a combination of this package and Hard parsing of the input string.
    For operation you can trim any space and brackets using TRIM function and then you can extrcat first 6 characters using SUBSTR for Operation.
    I have not worked or used DBMS_SQL so wont be able to help you much on this.
    Here is the link for DBMS_SQL
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sql.htm#i1026120
    Regards
    Arun

  • Same target operator (table) twice in mapping

    Can I use the same table operator as target twice in two different places in the same mapping?

    Yes.
    Regards:
    Igor

  • Problems in IW32, Operations, Table settings

    Hi,
    in IW32 i select operations and will change table settings.
    I select table settings, and Administrator. The field actual work (AFVGD-ISMNW) is set as invisible. Now i unmark this
    Field, activate it and go back.
    But the field actual work is still invisible.
    Is there any way to set this field as visible?
    Thanks.
    regards, Dieter

    tell me user-exit name so that I can tell u what is the problem

  • Order Operation Table

    Hi,
    We are creating Function Module for one client requirement, where we need to make some changes in Order operation tab, on the basis of the existing operations.
    So please tell me,
    From where (Database Table) these operations in operation tab of order get displayed?
    T.Code : IW32,
    Wish to know database table for operations on a particular order number.
    E.g. Table contains Order Number, Work Center, Control key, Text etc.
    Thanks & Regards,
    Kedar

    Hi Thanks for your Reply.
    We have already used these tables, but we were not getting Work Center in the Operations and Scheduling data from this table. But now our problem is get solved for data gathering.
    I have ABAPer with me,
    We have built functional module for our requirement. Now we want to link this with Order processing (probably through User Exit) But we both have not worked on this issue.
    flow should be like this,
    IW32==> When User status is changed to E.g. "INIT - Initiate" and pressed "Save", then this functional module should get executed.
    How to this automatic triggering?
    Help will be appreciated,
    Thanks,
    Kedar

  • Order Operations Table

    Please any one have the Order operations status Table. The table JEST only provide the status of hearder level only. The AFVC,AFRU is not helping.

    AFVU DB structure of the user fields of the operation
    AFVV DB structure of the quantities/dates/values in the operation
    This may help.....

  • Table in Schema1 using XMLIndexes But not in View- Schema2

    Hi,
    We are using :
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    I have a view with following query:
    CREATE OR REPLACE FORCE VIEW VIEW_TNAME
    XML
    AS
    SELECT Column_Name
    FROM TNAME
    WHERE XMLEXISTS (
    'declare namespace Namesp1 ="Abc:Set"; declare Namespace Namesp2 ="XYZ:Set"; declare namespace Namesp3 ="DEF:Set"; /Namesp1:Tag1/Namesp2:Tag2/Namesp3:Tag3[@id="ID"][Namesp2:Tag5[@Scope="SCOPE"] = ("1000", "2000") ]'
    PASSING Column_Name);
    Table TNAME is in Schema1.
    View VIEW_TNAME is in Schema2.
    When I execute the query in Schema1(without the view. i.e. Just execute underlying query).
    Plan is like:
    Plan
    SELECT STATEMENT ALL_ROWSCost: 86 Bytes: 124 Cardinality: 1                                                        
         20 NESTED LOOPS Cost: 86 Bytes: 124 Cardinality: 1                                                   
              18 VIEW VIEW SYS.VW_SQ_1 Cost: 84 Bytes: 25 Cardinality: 1                                              
                   17 HASH UNIQUE Bytes: 190 Cardinality: 1                                         
                        16 NESTED LOOPS Cost: 84 Bytes: 190 Cardinality: 1                                    
                             13 NESTED LOOPS Cost: 84 Bytes: 143 Cardinality: 1                               
                                  9 NESTED LOOPS Cost: 65 Bytes: 96 Cardinality: 1                          
                                       6 HASH JOIN RIGHT SEMI Cost: 64 Bytes: 490 Cardinality: 10                     
                                            1 COLLECTION ITERATOR PICKLER FETCH PROCEDURE SYS.XQSEQUENCEFROMXMLTYPE Cost: 35 Bytes: 32,720 Cardinality: 16,360                
                                            5 PX COORDINATOR                
                                                 4 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10000 :Q1000Cost: 28 Bytes: 442,599 Cardinality: 9,417           
                                                      3 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1000Cost: 28 Bytes: 442,599 Cardinality: 9,417 Partition #: 11 Partitions accessed #1 - #282     
                                                           2 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT Schema_Name.TNAME_RANGE_PT :Q1000Cost: 28 Bytes: 442,599 Cardinality: 9,417 Partition #: 11 Partitions accessed #1 - #282
                                       8 PARTITION SYSTEM ITERATOR Cost: 1 Bytes: 47 Cardinality: 1 Partition #: 13 Partitions determined by Key Values                    
                                            7 TABLE ACCESS FULL TABLE Schema_Name.TNAME_RANGE_PT Cost: 1 Bytes: 47 Cardinality: 1 Partition #: 13 Partitions determined by Key Values               
                                  12 PARTITION SYSTEM ALL Cost: 20 Bytes: 47 Cardinality: 1 Partition #: 15 Partitions accessed #1 - #282                         
                                       11 TABLE ACCESS BY LOCAL INDEX ROWID TABLE Schema_Name.TNAME_RANGE_PT Cost: 20 Bytes: 47 Cardinality: 1 Partition #: 15 Partitions accessed #1 - #282                    
                                            10 INDEX RANGE SCAN INDEX Schema_Name.SYS803074_I_XPATH_T_PIKEY_IX Cost: 20 Cardinality: 1 Partition #: 15 Partitions accessed #1 - #282               
                             15 PARTITION SYSTEM ITERATOR Cost: 1 Bytes: 47 Cardinality: 1 Partition #: 18 Partitions determined by Key Values                              
                                  14 TABLE ACCESS FULL TABLE Schema_Name.TNAME_RANGE_PT Cost: 1 Bytes: 47 Cardinality: 1 Partition #: 18 Partitions determined by Key Values                         
              19 TABLE ACCESS BY USER ROWID TABLE Schema_Name.TNAME Cost: 1 Bytes: 99 Cardinality: 1 Partition #: 20 Partition access computed by row location               
    Query uses the XMLIndexes and gets executed in ~20 seconds.
    BUT
    When I execute the same query in Schema2 or query the view which is built in Schema2. Explain Plan is like:
    <ExplainPlan>
    - <PlanElement id="0" operation="SELECT STATEMENT" optimizer="ALL_ROWS" search_columns="0" cost="48,865">
    - <PlanElements>
    - <PlanElement id="1" operation="FILTER" search_columns="0" filter_predicates="IS NOT NULL">
    - <PlanElements>
    - <PlanElement id="2" operation="PARTITION RANGE" option="ALL" search_columns="0" cost="48,805" cardinality="1,269,600" bytes="1,274,678,400" partition_id="2" partition_start="1" partition_stop="282" cpu_cost="1,932,647,487" io_cost="48,744" time="684">
    - <PlanElements>
    <PlanElement object_ID="0" id="3" operation="TABLE ACCESS" option="FULL" object_owner="Schema_Name" object_name="TNAME" object_type="TABLE" search_columns="0" cost="48,805" cardinality="1,269,600" bytes="1,274,678,400" partition_id="2" partition_start="1" partition_stop="282" cpu_cost="1,932,647,487" io_cost="48,744" time="684" />
    </PlanElements>
    </PlanElement>
    - <PlanElement id="4" operation="HASH JOIN" option="RIGHT SEMI" search_columns="0" cost="60" cardinality="1" bytes="18" cpu_cost="27,206,479" io_cost="59" access_predicates="<not feasible>" time="1">
    - <PlanElements>
    <PlanElement object_ID="1" id="5" operation="COLLECTION ITERATOR" option="PICKLER FETCH" object_owner="SYS" object_name="XQSEQUENCEFROMXMLTYPE" object_type="PROCEDURE" search_columns="0" cost="35" cardinality="16,360" bytes="32,720" cpu_cost="3,428,288" io_cost="35" time="1" />
    - <PlanElement id="6" operation="NESTED LOOPS" search_columns="0" cost="24" cardinality="100" bytes="800" cpu_cost="5,560,801" io_cost="24" time="1">
    - <PlanElements>
    <PlanElement id="7" operation="XPATH EVALUATION" search_columns="0" />
    <PlanElement id="8" operation="XPATH EVALUATION" search_columns="0" />
    (Sorry about the tags in the Plan).
    As shown in the plan, XMLIndexes are not used and query goes into forever execution as there are millions of rows in table TNAME.
    - Why this difference of behaviour in two schemas. It happens on some views like this one and not on others.
    - How can I correct this. ( I changed parameter OPTIMIZER_SECURE_VIEW_MERGING to FALSE. It looks like that solved the problem in our environment. But getting it done in PRODUCTION looks like Very Difficult and Process Oriented unless there is no other way).
    Kindly suggest. Thanks.

    Hi,
    Table Structure is as follows:
    CREATE TABLE TNAME
    DB_ID VARCHAR2(10 BYTE),
    DATA_ID VARCHAR2(10 BYTE),
    DATA_ID2 VARCHAR2(10 BYTE),
    IDENTIFIER1 NUMBER(19) NOT NULL,
    ID1 NUMBER(10) NOT NULL,
    STATUS1 NUMBER(10) NOT NULL,
    TIME_STAMP NUMBER(19) NOT NULL,
    OBJECT_ID VARCHAR2(40 BYTE) NOT NULL,
    OBJECT_NAME VARCHAR2(80 BYTE) NOT NULL,
    UNIQUE_ID VARCHAR2(255 BYTE),
    DATA_LIVE CHAR(1 BYTE) NOT NULL,
    XML_MESSAGE SYS.XMLTYPE,
    ID2 VARCHAR2(255 BYTE) NOT NULL,
    FLAG1 CHAR(1 BYTE) NOT NULL,
    KEY1 VARCHAR2(255 BYTE),
    HEADER1 VARCHAR2(2000 BYTE) NOT NULL,
    VERSION2 VARCHAR2(255 BYTE) NOT NULL,
    TYPE1 VARCHAR2(15 BYTE),
    LOAD_TIMESTAMP TIMESTAMP(6),
    SOURCE_NUMBER NUMBER
    XMLTYPE XML_MESSAGE STORE AS BINARY XML (
    TABLESPACE TSNAME)
    TABLESPACE TSNAME
    PARTITION BY RANGE (LOAD_TIMESTAMP)
    PARTITION MAX VALUES LESS THAN (MAXVALUE)
    TABLESPACE TSNAME
    NOCOMPRESS
    NOCACHE
    ENABLE ROW MOVEMENT
    Indexes are:
    CREATE UNIQUE INDEX "TNAME_UQI"
    ON "TNAME" (" DATA_ID", "IDENTIFIER1", "ID1")
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    COMPUTE STATISTICS
    TABLESPACE "TSNAME"
    CREATE INDEX "TNAME_I"
    ON "TNAME" ("SOURCE_NUMBER")
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    COMPUTE STATISTICS
    TABLESPACE "TSNAME"
    -- XMLType Index is created as Register Parameter and then....
    BEGIN
    DBMS_XMLINDEX.REGISTERPARAMETER(
    'TNAME_PAR',
    'PATH TABLE TNAME_PT
    PATHS (INCLUDE ( /abc:Msg/xyz:product/def:productType/def:SubProductType
    /abc:Msg/xyz:Products/xyz:Owner
    NAMESPACE MAPPING ( xmlns:abc="Abc:Set";
    xmlns:xyz ="XYZ:Set"
    xmlns:def="DEF:Set"
    END;
    CREATE INDEX I_XPATH_TNAME
    ON "TNAME" (XML_MESSAGE)
    INDEXTYPE IS XDB.XMLINDEX PARAMETERS ( 'PARAM TNAME_PAR',)
    local
    Now the view is like:
    CREATE OR REPLACE FORCE VIEW VIEW_TNAME
    XML
    AS
    SELECT XML_MESSAGE
    FROM TNAME
    WHERE XMLEXISTS (
    'declare namespace abc ="Abc:Set"; declare Namespace xyz ="XYZ:Set"; declare namespace def ="DEF:Set"; /abc:Tag1/xyz:Tag2/def:Tag3[@id="ID"][EntityID:Tag5[@Scope="SCOPE"] = ("1000", "2000") ]'
    PASSING XML_Message);
    THROUGH this view we are filtering only the EntityID in 1000 or 2000 which is unique in the XML Message, based on certain crietrias as mentioned in the Path Expression.
    Due to confidentiality I can't share the data here. :-(
    But it's like..(XML File size is around 250 rows in every XML_Message) and around .2 million rows in the table in environment where I am testing.
    But it will grow upto some millions later.
    NOW I have table in SCHEMA1.
    There if I execute this underlying query to view, plan is like:
    | Id  | Operation                                | Name                         | E-Rows |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                         |                              |        |       |    |     |
    |   1 |  NESTED LOOPS                            |                              |      1 |       |    |     |
    |   2 |   VIEW                                   | VW_SQ_1                      |      1 |       |    |     |
    |   3 |    HASH UNIQUE                           |                              |      1 |   926K|   926K| 1263K (0)|
    |   4 |     NESTED LOOPS                         |                              |      1 |       |    |     |
    |   5 |      NESTED LOOPS                        |                              |      1 |       |    |     |
    |   6 |       NESTED LOOPS                       |                              |      1 |       |    |     |
    |*  7 |        HASH JOIN RIGHT SEMI              |                              |     52 |   733K|   733K|  497K (0)|
    |   8 |         COLLECTION ITERATOR PICKLER FETCH| XQSEQUENCEFROMXMLTYPE        |  16360 |       |    |     |
    |   9 |         PX COORDINATOR                   |                              |        |       |    |     |
    |  10 |          PX SEND QC (RANDOM)             | :TQ10000                     |  59638 |       |    |     |
    |  11 |           PX BLOCK ITERATOR              |                              |  59638 |       |    |     |
    |* 12 |            TABLE ACCESS FULL             | TNAME_PT                     |  59638 |       |    |     |
    |  13 |        PARTITION SYSTEM ITERATOR         |                              |      1 |       |    |     |
    |* 14 |         TABLE ACCESS FULL                | TNAME_PT                     |      1 |       |    |     |
    |  15 |       PARTITION SYSTEM ALL               |                              |      1 |       |    |     |
    |* 16 |        TABLE ACCESS BY LOCAL INDEX ROWID | TNAME_PT                     |      1 |       |    |     |
    |* 17 |         INDEX RANGE SCAN                 | SYS803074_I_XPATH_T_PIKEY_IX |      1 |       |    |     |
    |  18 |      PARTITION SYSTEM ITERATOR           |                              |      1 |       |    |     |
    |* 19 |       TABLE ACCESS FULL                  | TNAME_PT                     |      1 |       |    |     |
    |* 20 |   TABLE ACCESS BY USER ROWID             | TNAME                        |      1 |       |    |     |
    ---------------------------------------------------------------------------------------------------------------------So I can see PATH Tables being used on which Index is registered and Execution is very fast.
    Other PLAN when I execute the query from SCHEMA2, is going for FTS on table TNAME as:
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 39,887                      
         8 FILTER                 
              2 PARTITION RANGE ALL  Cost: 39,827  Bytes: 447,179,616  Cardinality: 193,752  Partition #: 2  Partitions accessed #1 - #282          
                   1 TABLE ACCESS FULL TABLE TNAME Cost: 39,827  Bytes: 447,179,616  Cardinality: 193,752  Partition #: 2  Partitions accessed #1 - #282     
              7 HASH JOIN RIGHT SEMI  Cost: 60  Bytes: 18  Cardinality: 1            
                   3 COLLECTION ITERATOR PICKLER FETCH PROCEDURE SYS.XQSEQUENCEFROMXMLTYPE Cost: 35  Bytes: 32,720  Cardinality: 16,360       
                   6 NESTED LOOPS  Cost: 24  Bytes: 800  Cardinality: 100       
                        4 XPATH EVALUATION 
                        5 XPATH EVALUATION  fIRST THINGS FIRST- So is there any way I can make this view always use this index. ?
    I have tried several ways including hints for Indexes but they simply don't seem to help.
    Same query takes 15 secs in one schema and 2 hours in another.
    Is there any way we can make the query through view always use these XMLType Indexes and not Inconsistently. It's a lot faster when XMLType Indexes are used. In fact it does not work in Production if XMLIndex is not used.
    Kindly suggest..
    Edited by: user8941550 on Jan 3, 2013 8:20 PM

  • Dml error logging for tables in 10.2.0.5

    Hi experts,
    I have problems loading error records into the shadow table specified in the configuration window for tables. Upon executing the mapping, the execution results show warnings with the error records but these records were not moved to the shadow/error table.
    The actual scenario is: I specified a non-null data rule on the supplier_code column in the supplier table. Inside the mapping where I used this supplier table, I choose the option "Move to error" for this non-null data rule. Upon executing, it seems that owb treats these as warnings and not errors and thus did not propagate them to the error table. Anyone has any suggestion as to how to make use of the error tables in owb?

    DML error logging is generated for set-based PL/SQL mappings if the following conditions are satisfied:
    1. the Error table name property is set for the operator (table/view/mv)
    2. the PL/SQL Generated Mode of the module that contains the mapping is set to 10gR2 and above or Default.
    If the value is set to Default, ensure that location associated with the module has the Version set to 10.2 or above.
    When you use a data object in a mapping, the Error Table Name property for this data object is derived from the shadow table name property of the data object . If you modify the error table name of a data object (using the shadow table name property), you must synchronize all the operators bound to this data object.
    If you are still facing the issue then provide your email and I can send a simple example of data rule mapping in OWB 10.2.0.5
    Sutirtha

  • How to delete an operation from order using the bapi

    Can somebody please tell me how to delete an operation from order using the bapi
    BAPI_ALM_ORDER_MAINTAIN.
    Following was the test data for the BAPI.
    000000 OPERATION DELETE 0000040052810070
    000000 SAVE 0000040052810070
    Even I tried entering the operation table. The BAPI control ends fine, but when I check the order using IW32, the operation still exists.
    So, can you please tell me where Iam going wrong.

    Hi Subash Mohanvel,
    Check bapireturn parameter of the bapi BAPI_ALM_ORDER_MAINTAIN after execution of the code , and if there is no error message in the return table then call bapi_Transaction_commit.
    Unless you call this database saving of the records/values will not get reflected in the system.
    Hope that helps.
    Regards
    Kapadia
    ***Assigning points is the way to say thanks in SDN.***

  • Parent - child tables foreign key relation ship

    Hi All,
    we have 600 hundred tables ..i would like to print a hierarchial tree based on the foreigh key relathionship
    i tried my best but i couldnt.
    parent table
    child table 1
    childtable3
    child table 2
    and so
    Can somebody help me out with a query?
    Thanks,
    kt

    CREATE OR REPLACE FUNCTION get_child_tables (
    ptable VARCHAR2,
    powner VARCHAR2 DEFAULT 'SCOTT',
    plevel NUMBER DEFAULT 10
    RETURN stringarray
    -- -- create this ON SQL*PLUS "CREATE OR REPLACE TYPE STRINGARRAY AS TABLE OF VARCHAR2(50);"
    -- AUTHID CURRENT_USER
    PIPELINED
    AUTHOR DATE VERSION COMMENTS
    ======================================================================================
    [email protected] 26-OCT-2009 1.0 Developed to ease developers effort to find Nth level of Referential integrity
    ======================================================================================
    -- PURPOSE -> To find PARENT=> CHILD relational TABLE(S) in Oracle upto a depth max N Level.
    --SYNTAX TO USE
    SELECT * FROM TABLE( get_child_tables('DEPT','SCOTT',3)); Store this query in a file for your use
    SELECT * FROM TABLE( get_child_tables('EMPLOYEE')); Store this query in a file for your use
    -- RESULTS looks as below
    --1 => DEPT
    --2 => EMP
    --2 => EMP2
    --3 => EMP_CHILD
    --3 => EMP2_CHILD
    -- and so on
    --This can be leveraged to use in any oracle database REGION 10g having and above.
    --This FUNCTION gives formatted result of the Oracle 10g Hierarchical query result coded in the cursor
    --to find MASTER => CHILD relational TABLE(S) upto a depth max 10 Level.
    --The result of the PIPELINED function can be retrieved using Oracle new operator
    --TABLE(array name) in SQL query.
    --Due to the AUTHID CURRENT_USER compiler directive any user can use based on his/her access privileges on the database.
    --GRANT EXECUTE ON SCOTT.get_child_tables TO PUBLIC;
    --CREATE OR REPLACE PUBLIC SYNONYM get_child_tables FOR SCOTT.get_child_tables;
    IS
    atname stringarray := stringarray ();
    -- create this ON SQL*PLUS CREATE OR REPLACE TYPE STRINGARRAY AS TABLE OF VARCHAR2(50);
    vlevel NUMBER;
    vtname VARCHAR2 (50);
    nindex NUMBER := 0;
    bprocessed BOOLEAN := FALSE;
    CURSOR c1 (powner_in IN VARCHAR2, ptable_in VARCHAR2, plevel_in NUMBER)
    IS
    SELECT LEVEL, LPAD (' ', (LEVEL - 1) * 2, ' ') || pt AS "TNAME"
    FROM (SELECT a.owner w1, a.table_name pt, a.constraint_name c1,
    a.r_constraint_name r1, b.owner w2, b.table_name ct,
    b.constraint_name c2, b.r_constraint_name r2
    FROM all_constraints a, all_constraints b
    WHERE a.constraint_name = b.r_constraint_name(+)
    AND a.owner = b.owner(+)
    AND a.owner =
    UPPER (powner)
    -- Change Owner here while testing
    --AND A.r_constraint_name IS NULL
    AND a.constraint_type IN ('P', 'R')) v1
    START WITH pt =
    UPPER
    (ptable)
    -- Change your master table here while testing the QUERY
    CONNECT BY PRIOR ct = pt AND LEVEL <= plevel;
    -- Change lavel here while testing
    BEGIN
    atname.EXTEND;
    atname (1) := 'NOTHING';
    OPEN c1 (powner, ptable, plevel);
    LOOP
    bprocessed := FALSE;
    FETCH c1
    INTO vlevel, vtname;
    IF nindex > 1 AND atname (atname.LAST - 1) = vtname
    THEN
    --DBMS_OUTPUT.PUT_LINE('2 ==== vtname  ' ||vtname || '   '|| atname.count|| '   '||atname.last ||  '   '||atname( atname.last-1));
    bprocessed := TRUE;
    END IF;
    IF NOT bprocessed
    THEN
    nindex := nindex + 1;
    atname.EXTEND;
    atname (nindex) := vtname;
    PIPE ROW (vlevel || ' => ' || vtname);
    DBMS_OUTPUT.put_line ( ' **** nindex - atname( nindex) '
    || nindex
    || ' - '
    || atname (nindex)
    DLOG('ADDING ',vTname); A LOGGING ATONOMUS PROCEDURE FOR DEBUG PURPOSE
    END IF;
    EXIT WHEN c1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    FOR i IN 1 .. atname.COUNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('atname (i) ' ||atname (i));
    END LOOP;
    RETURN;
    EXCEPTION
    WHEN no_data_needed
    THEN -- THIS EXCEPTION HAS TO BE THERE TO GET THE FUCTION WORKABLE
    DBMS_OUTPUT.put_line (SQLERRM);
    RETURN;
    END get_child_tables;
    /

  • How can i find out the table hierarchy

    Hi experts,
    I have one doubt. how can i find out the table hierarchy in the particular schema.
    Let me explain my requirement in detail.. In my Database i have nearly 250 table each table have it's own temporary table(for authorization purpose we are maintaining the temporary tables) for each day i have to clear the temporary table data.
    All temporary table connected with each other. i mean all the table having foreign key relationship.. while i attempt the delete the data from the temporary table it showed ORA-02292: integrity constraint  violated - child record found.
    So can any one please tell how can i delete the child table record first and then parent record table record.
    Thanks in advance
    Arun

    CREATE OR REPLACE FUNCTION get_child_tables (
    ptable VARCHAR2,
    powner VARCHAR2 DEFAULT 'SCOTT',
    plevel NUMBER DEFAULT 10
    RETURN stringarray
    -- -- create this ON SQL*PLUS "CREATE OR REPLACE TYPE STRINGARRAY AS TABLE OF VARCHAR2(50);"
    -- AUTHID CURRENT_USER
    PIPELINED
    AUTHOR DATE VERSION COMMENTS
    ======================================================================================
    [email protected] 26-OCT-2009 1.0 Developed to ease developers effort to find Nth level of Referential integrity
    ======================================================================================
    -- PURPOSE -> To find PARENT=> CHILD relational TABLE(S) in Oracle upto a depth max N Level.
    --SYNTAX TO USE
    SELECT * FROM TABLE( get_child_tables('DEPT','SCOTT',3)); Store this query in a file for your use
    SELECT * FROM TABLE( get_child_tables('EMPLOYEE')); Store this query in a file for your use
    -- RESULTS looks as below
    --1 => DEPT
    --2 => EMP
    --2 => EMP2
    --3 => EMP_CHILD
    --3 => EMP2_CHILD
    -- and so on
    --This can be leveraged to use in any oracle database REGION 10g having and above.
    --This FUNCTION gives formatted result of the Oracle 10g Hierarchical query result coded in the cursor
    --to find MASTER => CHILD relational TABLE(S) upto a depth max 10 Level.
    --The result of the PIPELINED function can be retrieved using Oracle new operator
    --TABLE(array name) in SQL query.
    --Due to the AUTHID CURRENT_USER compiler directive any user can use based on his/her access privileges on the database.
    --GRANT EXECUTE ON SCOTT.get_child_tables TO PUBLIC;
    --CREATE OR REPLACE PUBLIC SYNONYM get_child_tables FOR SCOTT.get_child_tables;
    IS
    atname stringarray := stringarray ();
    -- create this ON SQL*PLUS CREATE OR REPLACE TYPE STRINGARRAY AS TABLE OF VARCHAR2(50);
    vlevel NUMBER;
    vtname VARCHAR2 (50);
    nindex NUMBER := 0;
    bprocessed BOOLEAN := FALSE;
    CURSOR c1 (powner_in IN VARCHAR2, ptable_in VARCHAR2, plevel_in NUMBER)
    IS
    SELECT LEVEL, LPAD (' ', (LEVEL - 1) * 2, ' ') || pt AS "TNAME"
    FROM (SELECT a.owner w1, a.table_name pt, a.constraint_name c1,
    a.r_constraint_name r1, b.owner w2, b.table_name ct,
    b.constraint_name c2, b.r_constraint_name r2
    FROM all_constraints a, all_constraints b
    WHERE a.constraint_name = b.r_constraint_name(+)
    AND a.owner = b.owner(+)
    AND a.owner =
    UPPER (powner)
    -- Change Owner here while testing
    --AND A.r_constraint_name IS NULL
    AND a.constraint_type IN ('P', 'R')) v1
    START WITH pt =
    UPPER
    (ptable)
    -- Change your master table here while testing the QUERY
    CONNECT BY PRIOR ct = pt AND LEVEL <= plevel;
    -- Change lavel here while testing
    BEGIN
    atname.EXTEND;
    atname (1) := 'NOTHING';
    OPEN c1 (powner, ptable, plevel);
    LOOP
    bprocessed := FALSE;
    FETCH c1
    INTO vlevel, vtname;
    IF nindex > 1 AND atname (atname.LAST - 1) = vtname
    THEN
    --DBMS_OUTPUT.PUT_LINE('2 ==== vtname  ' ||vtname || '   '|| atname.count|| '   '||atname.last ||  '   '||atname( atname.last-1));
    bprocessed := TRUE;
    END IF;
    IF NOT bprocessed
    THEN
    nindex := nindex + 1;
    atname.EXTEND;
    atname (nindex) := vtname;
    PIPE ROW (vlevel || ' => ' || vtname);
    DBMS_OUTPUT.put_line ( ' **** nindex - atname( nindex) '
    || nindex
    || ' - '
    || atname (nindex)
    DLOG('ADDING ',vTname); A LOGGING ATONOMUS PROCEDURE FOR DEBUG PURPOSE
    END IF;
    EXIT WHEN c1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    FOR i IN 1 .. atname.COUNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('atname (i) ' ||atname (i));
    END LOOP;
    RETURN;
    EXCEPTION
    WHEN no_data_needed
    THEN -- THIS EXCEPTION HAS TO BE THERE TO GET THE FUCTION WORKABLE
    DBMS_OUTPUT.put_line (SQLERRM);
    RETURN;
    --SELECT * FROM TABLE( get_child_tables('TB_XOP_LETR_TEMPLATE','OPS$CMS',5));
    END get_child_tables;
    Edited by: user3066657 on Jul 21, 2011 8:42 AM
    Edited by: user3066657 on Jul 21, 2011 11:26 AM

  • Finding the Text of SQL Query Causing Full Table Scan

    Hi,
    does anyone have a sql script, that shows the complete sql text of queries that have caused a full table scan?
    Please also let me know as to how soon this script needs to be run, in the sense does it work only while the query is running or would it work once it completes (if so is there a valid duration, such as until next restart, etc.)
    Your help is appreciated.
    Thx,
    Mayuran

    You might try something like this:
    select sql_text,
           object_name
    from   v$sql s,
           v$sql_plan p
    where  s.address = p.address and
           s.hash_value = p.hash_value and
           s.child_number = p.child_number and
           p.operation = 'TABLE ACCESS' and
           p.options = 'FULL' and
           p.object_owner in ('SCOTT')
    ;Please note that this query is just a snapshot of the SQL statements currently in the cache.

  • What are the different types of tables in oracle --plz help

    I want to know the different types of tables in orcle...Please help me

    There are seven types of tables in Oracle.
    1.Heap organized tables
    2.Index organized tables
    3.Index clustered tables
    4.Hash clustered tables
    5.Nested tables
    6.Global temporary tables
    7.Object tables
    Source:http://www.adp-gmbh.ch/ora/concepts/tables.html
    But if you are asking table types in the uses senses then they are n types :
    1.Stage tables
    2.Operational tables
    3.Functional tables
    4.Disposition tables
    5.Archive tables
    6.Other tables
    Source:http://www.databasejournal.com/features/oracle/article.php/3616476/Types-of-Tables-in-Oracle.htm
    And yes of course, the complete detail can be found in documentation.
    HTH
    Girish Sharma

Maybe you are looking for