How to find total recs in a local table for a particular condition

Hi,
How to find total recs in a local table for a particular condition?
Thanks,
CD

Well, you may want to try this as well, and compare to the LOOP way.  Not sure what kind of overhead you may get doing this way. Here ITAB is our main internal table, and ITAB_TMP is a copy of it.  Again I think there may be some overhead in doing the copy.  Next, delete out all records which are the reverse of your condition.  Then whatever is left is the rows that you want to count.  Then simply do a LINES operator on the internal table, passing the number of lines to LV_COUNT.
data: itab type table of ttab.
data: itab_tmp type table of ttab.
itab_tmp[] = itab[].
delete table itab_tmp where fld1 <> 'A'.
lv_count = lines( itab_tmp ).
Regards,
Rich Heilman

Similar Messages

  • How to find whether an Invoice is been posted for a particular PO

    Hi,
    How to find whether an Invoice is been posted for a particular PO.
    I have a scenario where I fetch data into an internal table T_CDHDR(It has PO and other details). For each and every entry(PO) in that internal table I have to see whether an Invoice is been posted or not. They told to use <b>EKBE(Purchasing document history)</b> table. But, I don't know which field to check for and based on what conditions.
    Can someone help me with sample code or some valuable inputs.
    Thanks in advance.
    Regards,
    Paddu.

    HI,
    TABLE IS RIGHT.
    IN THAT TABLE FOR THE FIELD BEWTP CHECK WHETHER ENTRY IS "Q".
    Q STANDS FOR IR-L THAT MEANS INVOICE IS DONE.
    ON THE SELECTION SCREEN OF EKBE TABLE ENTER THE PO NUMBER.
    THEN CHECK WHETHER IT HAS ENTRY FOR BEWTP 'Q'.
    YOU CAN CROSS-CHECK THIS DATA FROM TABLE WITH THAT IN ACTUAL PO IN T.CODE - ME23N.
    ENTER PO NUMBER ,THEN IN ITEM DETAILS , IN HISTORY TAB SEE FOR THAT INVOICE NO.

  • How to find data dictionary and oracle schema tables for UTF8 char conversi

    I am doing UTF8 char conversition, i got lot of convertable objects,as per document we don't need to worry about data dictionary objects and how to find data dictionary and oracle schema objects for UTF8 char conversition.
    USER.TABLE Convertible Truncation Lossy
    MDSYS.OPENLS_NODES 17 0 0
    MDSYS.SDO_COORD_OP_PARAM_VALS 200 0 0
    MDSYS.SDO_GEOR_XMLSCHEMA_TABLE 1 0 0
    MDSYS.SDO_STYLES_TABLE 78 0 0
    MDSYS.SDO_XML_SCHEMAS 3 0 0
    ORDDATA.ORDDCM_CT_PRED_OPRD 51 0 0
    ORDDATA.ORDDCM_DOCS 9 0 0
    ORDDATA.ORDDCM_MAPPING_DOCS 1 0 0
    SYS.METASTYLESHEET 178 0 0
    SYS.REGISTRY$ERROR 2 0 0
    SYS.RULE$ 21 0 0
    SYS.SCHEDULER$_EVENT_LOG 182 0 0
    SYS.WRH$_SQLTEXT 2,099 0 0
    SYS.WRH$_SQL_PLAN 1,736 0 0
    SYS.WRI$_ADV_ACTIONS 5,452 0 0
    SYS.WRI$_ADV_DIRECTIVE_META 5 0 0
    SYS.WRI$_ADV_OBJECTS 2,278 0 0
    SYS.WRI$_ADV_RATIONALE 9,594 0 0
    SYS.WRI$_ADV_SQLT_PLANS 455 0 0
    SYS.WRI$_ADV_SQLT_PLAN_STATS 288 0 0
    SYS.WRI$_DBU_FEATURE_METADATA 188 0 0
    SYS.WRI$_DBU_FEATURE_USAGE 16 0 0
    SYS.WRI$_DBU_HWM_METADATA 20 0 0
    SYS.WRI$_REPT_FILES 27 0 0
    XDB.XDB$DXPTAB 2 0 0
    XML CSX Dictionary Tables:
    USER.TABLE Convertible Truncation Lossy
    Application Data:
    USER.TABLE Convertible Truncation Lossy
    APPLSYS.BISM_OBJECTS 4 0 0
    APPLSYS.DR$FND_LOBS_CTX$I 0 103 1,260,883
    APPLSYS.FND_CONC_PROG_ANNOTATIONS 272 0 0
    APPLSYS.FND_OAM_CONTEXT_FILES 15 0 0
    APPLSYS.FND_OAM_DOC_LINK 1 0 0
    APPS.FND_OAM_CONTEXT_FILES_1 6 0 0
    AZ.AZ_APIS 11 0 0
    AZ.AZ_SELECTION_SET_ENTITIES_B 48 0 0
    ECX.ECX_DTDS 205 0 0
    ECX.ECX_FILES 91 0 0
    IBC.IBC_ATTRIBUTE_BUNDLES 41 0 0
    JTF.JTF_HEADER_DTD 1 0 0
    JTF.JTF_MESSAGE_OBJECTS 82 0 0
    JTF.JTY_TRANS_USG_PGM_SQL 29 0 0
    ODM.ODM_PMML_DTD 1 0 0
    OKC.OKC_REPORT_SQL_B 3 0 0
    OKC.OKC_REPORT_SQL_TL 2 0 0
    OKC.OKC_REPORT_XSL_TL 5 0 0
    XDP.XDP_PROC_BODY 10 0 0
    [Distribution of Convertible, Truncated and Lossy Data by Column]
    Data Dictionary Tables:
    USER.TABLE|COLUMN Convertible Truncation Lossy
    MDSYS.OPENLS_NODES|SYS_NC00004$ 17 0 0
    MDSYS.SDO_COORD_OP_PARAM_VALS|PARAM_VALUE_FILE 200 0 0
    MDSYS.SDO_GEOR_XMLSCHEMA_TABLE|XMLSCHEMA 1 0 0
    MDSYS.SDO_STYLES_TABLE|DEFINITION 78 0 0
    MDSYS.SDO_XML_SCHEMAS|XMLSCHEMA 3 0 0
    ORDDATA.ORDDCM_CT_PRED_OPRD|SYS_NC00004$ 51 0 0
    ORDDATA.ORDDCM_DOCS|SYS_NC00005$ 9 0 0
    ORDDATA.ORDDCM_MAPPING_DOCS|SYS_NC00007$ 1 0 0
    SYS.METASTYLESHEET|STYLESHEET 178 0 0
    SYS.REGISTRY$ERROR|MESSAGE 1 0 0
    SYS.REGISTRY$ERROR|STATEMENT 1 0 0
    SYS.RULE$|CONDITION 21 0 0
    SYS.SCHEDULER$_EVENT_LOG|ADDITIONAL_INFO 182 0 0
    SYS.WRH$_SQLTEXT|SQL_TEXT 2,099 0 0
    SYS.WRH$_SQL_PLAN|OTHER_XML 1,736 0 0
    SYS.WRI$_ADV_ACTIONS|ATTR5 2,726 0 0
    SYS.WRI$_ADV_ACTIONS|ATTR6 2,726 0 0
    SYS.WRI$_ADV_DIRECTIVE_META|DATA 5 0 0
    SYS.WRI$_ADV_OBJECTS|ATTR4 2,278 0 0
    SYS.WRI$_ADV_RATIONALE|ATTR5 9,594 0 0
    SYS.WRI$_ADV_SQLT_PLANS|OTHER_XML 455 0 0
    SYS.WRI$_ADV_SQLT_PLAN_STATS|OTHER 288 0 0
    SYS.WRI$_DBU_FEATURE_METADATA|INST_CHK_LOGIC 21 0 0
    SYS.WRI$_DBU_FEATURE_METADATA|USG_DET_LOGIC 167 0 0
    SYS.WRI$_DBU_FEATURE_USAGE|FEATURE_INFO 16 0 0
    SYS.WRI$_DBU_HWM_METADATA|LOGIC 20 0 0
    SYS.WRI$_REPT_FILES|SYS_NC00005$ 27 0 0
    XDB.XDB$DXPTAB|SYS_NC00006$ 2 0 0
    XML CSX Dictionary Tables:
    USER.TABLE|COLUMN Convertible Truncation Lossy
    Application Data:
    USER.TABLE|COLUMN Convertible Truncation Lossy
    APPLSYS.BISM_OBJECTS|SYS_NC00023$ 4 0 0
    APPLSYS.DR$FND_LOBS_CTX$I|TOKEN_TEXT 0 103 1,260,883
    APPLSYS.FND_CONC_PROG_ANNOTATIONS|PROGRAM_ANNOTAT 272 0 0
    APPLSYS.FND_OAM_CONTEXT_FILES|TEXT 15 0 0
    APPLSYS.FND_OAM_DOC_LINK|DOC_LINK_INFO 1 0 0
    APPS.FND_OAM_CONTEXT_FILES_1|TEXT 6 0 0
    AZ.AZ_APIS|FILTERING_PARAMETERS 11 0 0
    AZ.AZ_SELECTION_SET_ENTITIES_B|FILTERING_PARAMETE 48 0 0
    ECX.ECX_DTDS|PAYLOAD 205 0 0
    ECX.ECX_FILES|PAYLOAD 91 0 0
    IBC.IBC_ATTRIBUTE_BUNDLES|ATTRIBUTE_BUNDLE_DATA 41 0 0
    JTF.JTF_HEADER_DTD|HEADER_DTD 1 0 0
    JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_DTD 41 0 0
    JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_SQL 41 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|BATCH_DEA_SQL 1 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|BATCH_INCR_SQL 5 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|BATCH_TOTAL_SQL 6 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|INCR_REASSIGN_SQL 5 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_INSERT 6 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_SQL 6 0 0
    ODM.ODM_PMML_DTD|DTD 1 0 0
    OKC.OKC_REPORT_SQL_B|SQL_TEXT 3 0 0
    OKC.OKC_REPORT_SQL_TL|HELP_TEXT 2 0 0
    OKC.OKC_REPORT_XSL_TL|HELP_TEXT 2 0 0
    OKC.OKC_REPORT_XSL_TL|XSL_TEXT 3 0 0
    XDP.XDP_PROC_BODY|PROC_BODY 10 0 0
    -------------------------------------------------- ---------------- ---------------- ----------------

    Hi;
    Please run below query which could be helpful for your issue:
    select * from dictionary where TABLE_NAME LIKE '%NLS%'
    select * from dictionary where TABLE_NAME LIKE '%GLOBAL%'
    Regard
    Helios

  • How to find open SO Items with tax code for a particular day?

    Dear all
    If i want to see all open SOs(items), with tax code for a particular day, how to find using table VBAP in SE16?
    Please guide me
    Edited by: Julius Bussche on Mar 3, 2009 11:10 PM
    Please use descriptive subject titles and the search

    Hi GB,
    Its always better to see through the standard reports , as you will be able to see the aditional info as well.
    In the case of table in se16 you will be able to see one table at a time and then you need to manually figure out the fields that required.
    For example if you want to see the sales order details through tables then
    1.You have to go to VBAK to see the document type and then you need to go to VBAP to see the items , it means that you need to access 2 tables for this simple thing ....
    In standard reports there will be lot of joins between the tables and you can view the data more elobarately as weel.
    Note : In general if you want to see the complete details of the documents(open), then pls use the reports.
    Regards,
    Vvieks

  • How to find out the cost of SAP user for a particular user id

    Dear All,
    I got one issue like how to find out the cost of SAP user, i mean for a particular user id.
    Could you please advice me regarding this.
    Raghu

    Hello Raghu,
    I got one issue like how to find out the cost of SAP user, i mean for a particular user id.
    Could you please advice me regarding this.
    I think you need to reach out to BASIS consultant to check out the Cost involved for User ID for the SAP application.
    Regards,
    Sarthak

  • How to find out the list of field exists for a particular transaction

    Hi all,
    Can u please help me find out the list of field exits available for a particular Tcode?
    Is it similar to User exit or . . . . ?
    Thanks,
    C.Selvaraj
    SAP-QM

    Create a program and add this code to find user exit
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
    tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
      select single * from tadir where pgmid = 'R3TR'
      and object = 'PROG'
      and obj_name = tstc-pgmna.
      move : tadir-devclass to v_devclass.
      if sy-subrc ne 0.
        select single * from trdir where name = tstc-pgmna.
        if trdir-subc eq 'F'.
          select single * from tfdir where pname = tstc-pgmna.
          select single * from enlfdir where funcname =
          tfdir-funcname.
          select single * from tadir where pgmid = 'R3TR'
          and object = 'FUGR'
          and obj_name eq enlfdir-area.
          move : tadir-devclass to v_devclass.
        endif.
      endif.
      select * from tadir into table jtab
      where pgmid = 'R3TR'
      and object = 'SMOD'
      and devclass = v_devclass.
      select single * from tstct where sprsl eq sy-langu and
      tcode eq p_tcode.
      format color col_positive intensified off.
      write:/(19) 'Transaction Code - ',                        "#EC NOTEXT
      20(20) p_tcode,
      45(50) tstct-ttext.
      skip.
      if not jtab[] is initial.
        write:/(95) sy-uline.
        format color col_heading intensified on.
        write:/1 sy-vline,
        2 'Exit Name',                                          "#EC NOTEXT
        21 sy-vline ,
        22 'Description',                                       "#EC NOTEXT
        95 sy-vline.
        write:/(95) sy-uline.
        loop at jtab.
          select single * from modsapt
          where sprsl = sy-langu and
          name = jtab-obj_name.
          format color col_normal intensified off.
          write:/1 sy-vline,
          2 jtab-obj_name hotspot on,
          21 sy-vline ,
          22 modsapt-modtext,
          95 sy-vline.
        endloop.
        write:/(95) sy-uline.
        describe table jtab.
        skip.
        format color col_total intensified on.
        write:/ 'No of Exits:' , sy-tfill.                      "#EC NOTEXT
      else.
        format color col_negative intensified on.
        write:/(95) 'No User Exit exists'.                      "#EC NOTEXT
      endif.
    else.
      format color col_negative intensified on.
      write:/(95) 'Transaction Code Does Not Exist'.            "#EC NOTEXT
    endif.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.
    Rewards if useful........................
    Minal

  • How to find the list of Parallel enabled tables for a User?

    Hi All,
    I created a table with parallel option. Now I want to find out the list of all tables created with that option. I searched in DBA tables but I couldn’t get it. Could some one help in it?
    Thanks,
    Darius

    You'll find this information in user_tables in the column DEGREE.
    degree=1 means noparallel
    degree=default means parallel default
    degree=2 means (parallel, 2)
    etc...

  • How to find out the aligning Data dictionary table for a structure.

    Hi
    As the table controls are associated with strucures, the data input goes to the data dictionary table aligned to that structure. Is there any way we can find out the table related to that particular structure ?
    Thanks,
    Dhareppa

    Hi,
    The structure and its fields may be associated with multiple database tables.
    You can try by where-used list of the structure/field and then you can look and determine the table by hit and try method.
    Also as suggested above you can try get the SQL trace and then ypu can look for table associated behind the structure/fields I believe this is the best way to find the DB table.
    Thanks,
    Ravi

  • How to find total no of record in cube

    Hi Experts,
    How to find total no of records in a cube.
    Thanks in Advance.

    Hi
    If you want total number of records in a CUBE then you have to check in both F Table and E table.
    Go to LISTSCHEMA tcode in your system, give your CUBE name and execute.
    You will fine two table E and F table
    goto SE16 -->give the table name and click on number of entries.You will get number of records.
    Check the below thread
    No of records in /size of Info cube
    Regards,
    Venkatesh

  • How to find total memory for Oralce Memory utilization

    Hi,
    How to find total amount of memory utilized by oracle including SGA+PGA+PROCESS
    Thanks,
    Abk

    Is you OS 32-bit ? If you add /3gb in boot.ini , then it will limit oracle.exe to go only upto 3gb.
    Add /PAE in the boot.ini and remove /3gb.
    then use db_block_buffers parameter instead of db_cache_size
    for using db_block_buffers, you need to set another parameter also.
    use_indirect_data_buffers=true
    db_block_buffers=<number of blocks
    db_block_buffers=db_cache_size in kilobytes /db_block_size
    (since db_block_size is 8 kllobytes by default in Windows..
    {color:blue}Please refer Metalink Note : [373602.1|https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=373602.1]{color}
    Edited by: Mahesh Menon on Apr 29, 2009 2:56 PM

  • How to find a metachain name from local process chain id or name

    how to find a metachain name from local process chain id or name

    Hi Dwarakanath,
    Please post your query in the correct topic space in SCN.  For help, see this document:
    Find Topic Spaces on SCN (Forums)
    Thanks,
    Kristen

  • How to find out the plants and storage location for a given company code

    hi
    How to find out the plants and storage location for a given company code

    Hi
    Check for Assignem,ent of Plant & compnay code in OX18
    & for Combination of Plant & Storage location in OX09
    The total org structure can be viewed in EC01 - Click on Structure  -> navigation
    & Continue, Click on the Compnay code & the wole structure can be viewed
    Thanks & Regards
    Kishore

  • How to find out the selected column in Table Control

    Hi all,
          How to find out the selected column in Table Control?
    Thanks & Regards,
    YJR

    Hi,
    Let your table control name in Screen painter be TC1.
    READ TABLE TC1-COLS INTO WA_COLS (some wok area)
                 WITH KEY SELECTED = 'X'.
            IF SY-SUBRC = 0.
              CLEAR: W_DUMMY, W_COL_NAME.
              SPLIT WA_COLS-SCREEN-NAME AT '-' INTO W_DUMMY
                                                   W_COL_NAME.
            endif.
    W_COL_NAME gives you the column name.
    Hope it helps.
    cheers
    sharmistha

  • How to find the level of each child table in a relational model?

    Earthlings,
    I need your help and I know that, 'yes, we can change'. Change this thread to a answered question.
    So: How to find the level of each child table in a relational model?
    I have a relacional database (9.2), all right?!
         O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */
        /↑\ Fks
       O"O O" <-- level 2 for first table (circle)
      /↑\ Fks
    "o"o"o" <-- level 1 for middle table (circle)
       ↑ Fk
      "º"Tips:
    - each circle represents a table;
    - red tables no have foreign key
    - the table in first line of tree, for example, has level 3, but when 3 becomes N? How much is N? This's the question.
    I started thinking about the following:
    First I have to know how to take the children:
    select distinct child.table_name child
      from all_cons_columns father
      join all_cons_columns child
    using (owner, position)
      join (select child.owner,
                   child.constraint_name fk,
                   child.table_name child,
                   child.r_constraint_name pk,
                   father.table_name father
              from all_constraints father, all_constraints child
             where child.r_owner = father.owner
               and child.r_constraint_name = father.constraint_name
               and father.constraint_type in ('P', 'U')
               and child.constraint_type = 'R'
               and child.owner = 'OWNER') aux
    using (owner)
    where child.constraint_name = aux.fk
       and child.table_name = aux.child
       and father.constraint_name = aux.pk
       and father.table_name = aux.father;Thinking...
    Let's Share!
    My thanks in advance,
    Philips
    Edited by: BluShadow on 01-Apr-2011 15:08
    formatted the code and the hierarchy for readbility

    Justin,
    Understood.
    Nocycle not work in 9.2 and, even that would work, would not be appropriate.
    With your help, I decided a much simpler way (but there is still a small problem, <font color=red>IN RED</font>):
    -- 1
    declare
      type udt_roles is table of varchar2(30) index by pls_integer;
      cRoles udt_roles;
    begin
      execute immediate 'create user philips
        identified by philips';
      select granted_role bulk collect
        into cRoles
        from user_role_privs
       where username = user;
      for i in cRoles.first .. cRoles.count loop
        execute immediate 'grant ' || cRoles(i) || ' to philips';
      end loop;
    end;
    -- 2
    create table philips.root1(root1_id number,
                               constraint root1_id_pk primary key(root1_id)
                               enable);
    grant all on philips.root1 to philips;
    create or replace trigger philips.tgr_root1
       before delete or insert or update on philips.root1
       begin
         null;
       end;
    create table philips.root2(root2_id number,
                               constraint root2_id_pk primary key(root2_id)
                               enable);
    grant all on philips.root2 to philips;
    create or replace trigger philips.tgr_root2
       before delete or insert or update on philips.root2
       begin
         null;
       end;
    create table philips.node1(node1_id number,
                               root1_id number,
                               node2_id number,
                               node4_id number,
                               constraint node1_id_pk primary key(node1_id)
                               enable,
                               constraint n1_r1_id_fk foreign key(root1_id)
                               references philips.root1(root1_id) enable,
                               constraint n1_n2_id_fk foreign key(node2_id)
                               references philips.node2(node2_id) enable,
                               constraint n1_n4_id_fk foreign key(node4_id)
                               references philips.node4(node4_id) enable);
    grant all on philips.node1 to philips;
    create or replace trigger philips.tgr_node1
       before delete or insert or update on philips.node1
       begin
         null;
       end;
    create table philips.node2(node2_id number,
                               root1_id number,
                               node3_id number,
                               constraint node2_id_pk primary key(node2_id)
                               enable,
                               constraint n2_r1_id_fk foreign key(root1_id)
                               references philips.root1(root1_id) enable,
                               constraint n2_n3_id_fk foreign key(node3_id)
                               references philips.node3(node3_id) enable);
    grant all on philips.node2 to philips;
    create or replace trigger philips.tgr_node2
       before delete or insert or update on philips.node2
       begin
         null;
       end;                          
    create table philips.node3(node3_id number,
                               root2_id number,
                               constraint node3_id_pk primary key(node3_id)
                               enable,
                               constraint n3_r2_id_fk foreign key(root2_id)
                               references philips.root2(root2_id) enable);
    grant all on philips.node3 to philips;
    create or replace trigger philips.tgr_node3
       before delete or insert or update on philips.node3
       begin
         null;
       end;                          
    create table philips.node4(node4_id number,
                               node2_id number,
                               constraint node4_id_pk primary key(node4_id)
                               enable,
                               constraint n4_n2_id_fk foreign key(node2_id)
                               references philips.node2(node2_id) enable);
    grant all on philips.node4 to philips;
    create or replace trigger philips.tgr_node4
       before delete or insert or update on philips.node4
       begin
         null;
       end;                          
    -- out of the relational model
    create table philips.node5(node5_id number,
                               constraint node5_id_pk primary key(node5_id)
                               enable);
    grant all on philips.node5 to philips;
    create or replace trigger philips.tgr_node5
       before delete or insert or update on philips.node5
       begin
         null;
       end;
    -- 3
    create table philips.dictionary(table_name varchar2(30));
    insert into philips.dictionary values ('ROOT1');
    insert into philips.dictionary values ('ROOT2');
    insert into philips.dictionary values ('NODE1');
    insert into philips.dictionary values ('NODE2');
    insert into philips.dictionary values ('NODE3');
    insert into philips.dictionary values ('NODE4');
    insert into philips.dictionary values ('NODE5');
    --4
    create or replace package body philips.pck_restore_philips as
      procedure sp_select_tables is
        aExportTablesPhilips     utl_file.file_type := null; -- file to write DDL of tables   
        aExportReferencesPhilips utl_file.file_type := null; -- file to write DDL of references
        aExportIndexesPhilips    utl_file.file_type := null; -- file to write DDL of indexes
        aExportGrantsPhilips     utl_file.file_type := null; -- file to write DDL of grants
        aExportTriggersPhilips   utl_file.file_type := null; -- file to write DDL of triggers
        sDirectory               varchar2(100) := '/app/oracle/admin/tace/utlfile'; -- directory \\bmduhom01or02 
        cTables                  udt_tables; -- collection to store table names for the relational depth
      begin
        -- omits all referential constraints:
        dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'REF_CONSTRAINTS', false);
        -- omits segment attributes (physical attributes, storage attributes, tablespace, logging):
        dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SEGMENT_ATTRIBUTES', false);
        -- append a SQL terminator (; or /) to each DDL statement:
        dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SQLTERMINATOR', true);
        -- create/open files for export DDL:
        aExportTablesPhilips := utl_file.fopen(sDirectory, 'DDLTablesPhilips.pdc', 'w', 32767);
        aExportReferencesPhilips := utl_file.fopen(sDirectory, 'DDLReferencesPhilips.pdc', 'w', 32767);
        aExportIndexesPhilips := utl_file.fopen(sDirectory, 'DDLIndexesPhilips.pdc', 'w', 32767);
        aExportGrantsPhilips := utl_file.fopen(sDirectory, 'DDLGrantsPhilips.pdc', 'w', 32767);
        aExportTriggersPhilips := utl_file.fopen(sDirectory, 'DDLTriggersPhilips.pdc', 'w', 32767);
        select d.table_name bulk collect
          into cTables -- collection with the names of tables in the schema philips
          from all_tables t, philips.dictionary d
         where owner = 'PHILIPS'
           and t.table_name = d.table_name;
        -- execution
        sp_seeks_ddl(aExportTablesPhilips,
                     aExportReferencesPhilips,
                     aExportIndexesPhilips,
                     aExportGrantsPhilips,
                     aExportTriggersPhilips,
                     cTables);
        -- closes all files
        utl_file.fclose_all;
      end sp_select_tables;
      procedure sp_seeks_ddl(aExportTablesPhilips     in utl_file.file_type,
                             aExportReferencesPhilips in utl_file.file_type,
                             aExportIndexesPhilips    in utl_file.file_type,
                             aExportGrantsPhilips     in utl_file.file_type,
                             aExportTriggersPhilips   in utl_file.file_type,
                             cTables                  in out nocopy udt_tables) is
        cDDL       clob := null; -- colletion to save DDL
        plIndex    pls_integer := null;
        sTableName varchar(30) := null;
      begin
        for i in cTables.first .. cTables.count loop
          plIndex    := i;
          sTableName := cTables(plIndex);
           * Retrieves the DDL and the dependent DDL into cDDL clob       *      
          * for the selected table in the collection, and writes to file.*
          begin
            cDDL := dbms_metadata.get_ddl('TABLE', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportTablesPHILIPS, cDDL);
          exception
            when dbms_metadata.object_not_found then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('REF_CONSTRAINT', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportReferencesPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('INDEX', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportIndexesPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('OBJECT_GRANT', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportGrantsPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
          begin
            cDDL := dbms_metadata.get_dependent_ddl('TRIGGER', sTableName, 'PHILIPS');
            sp_writes_ddl(aExportTriggersPhilips, cDDL);
          exception
            when dbms_metadata.object_not_found2 then
              null;
          end;
        end loop;
      end sp_seeks_ddl;
      procedure sp_writes_ddl(aExport in utl_file.file_type,
                              cDDL    in out nocopy clob) is
        pLengthDDL  pls_integer := length(cDDL);
        plQuotient  pls_integer := null;
        plRemainder pls_integer := null;
      begin
          * Register variables to control the amount of lines needed   *
         * for each DDL and the remaining characters to the last row. *
        select trunc(pLengthDDL / 32766), mod(pLengthDDL, 32766)
          into plQuotient, plRemainder
          from dual;
          * Join DDL in the export file.                            *
         * ps. 32766 characters + 1 character for each line break. *
        -- if the size of the DDL is greater than or equal to limit the line ...
        if plQuotient >= 1 then
          -- loops for substring (lines of 32766 characters + 1 break character):
          for i in 1 .. plQuotient loop
            utl_file.put_line(aExport, substr(cDDL, 1, 32766));
            -- removes the last line, of clob, recorded in the buffer:
            cDDL := substr(cDDL, 32767, length(cDDL) - 32766);
          end loop;
        end if;
          * If any remains or the number of characters is less than the threshold (quotient = 0), *
         * no need to substring.                                                                 *
        if plRemainder > 0 then
          utl_file.put_line(aExport, cDDL);
        end if;
        -- record DDL buffered in the export file:
        utl_file.fflush(aExport);
      end sp_writes_ddl;
    begin
      -- executes main procedure:
      sp_select_tables;
    end pck_restore_philips;<font color="red">The problem is that I still have ...
    When creating the primary key index is created and this is repeated in the file indexes.
    How to avoid?</font>

  • How to find out what is the lock key for the computer

    How to find out what is the lock key for the computer?

    You don't.
    If you forgot or lost the password, all you can practically do is reset it.
    The manner in which you do so depends on what version of OS X you are running. The older versions utilize the reset password utility on your recovery/re-installation disk/drive.
    On Lion, you use the following technique to reset the Administrators password:
    Boot to your Lion Recovery Partition, by holding down the Option key while starting, and then selecting the Recovery HD as the boot choice.
    Once booted, at the top of the screen is a menu ..., select Utilities / Terminal from the menu bar.
    In the Terminal window, type “resetpassword” (without the quotes) and press return. A “Reset Password” window will open. Select your boot volume (your SSD drive) if it is not already selected. Select your administrators username from the menu labeled “Select the user account” if it is not already selected. Follow the prompts to reset the password. Restart the computer from the apple menu.

Maybe you are looking for

  • Case issue in Database table

    Hi All, We have an issue of lowercase in database table and we want to convert that lowercase data to upper case. The code for doing this operation is as follows: SELECT * FROM zehs_volumes INTO TABLE i_volumes_temp. LOOP AT i_volumes_temp. DELETE ze

  • Customize colors in horizontal bar in charts OBIEE 10g

    Hi All, I have a chart report which has horizontal bars. I want th change the color of each bar to different colors. I have no condition,any color is fine for me. How can I achieve it? In Format Chart Data, I haev specified different colors,but it gi

  • Address book on my mac and Cloud question

    Noticed the contacts were different on my mac and iCloud and not sure why. In iTunes have backing up to iCloud but not sure that is correct or matters. Contacts on the iPhone are seldom correct and want to get this fixed. recently deleted quite a few

  • Oracle Buffer Hit Ratio

    I m using this query to find Oracle Buffer Hit ratio .Is this query right.Is there some other way of getting more accurate ratio select trunc((1-(sum(decode(name,'physical reads',value,0))/(sum(decode(name,'db block gets',value,0)) + (sum(decode(name

  • Is there any way to get my alarm to play through my 35mm audio jack that's plugged into my speakers

    JJust wondering if it's possible