Creating a Price in 1 table, determined by data contained in multiple other tables.

Hi
I'm trying to construct a quote tool for my resellers and partners. My software product has a different selling price determined by the licence type, licence size and some vertical market positioning.
In my example, if my partner ticks the box for "Annual Subscription" and "1 Year", I'd like "Licence Cost" in the table below to present the 1 Year Licnce Price from the table on the top right.
And if they choose "Lifetime Licence" then it should lookup the licence cost under the LifeTime table on the bottom right.
I've tried using IF and LookUp but got tied up in all sorts of mess when trying to nest multiple functions referencing multiple tables, any help you can offer is gratefully received.
Thank you.

Hi Jerry
Thanks for your explanation.
So the logic / workflow is as follows:
Partner should tick the boxes that pertain to the licence the customer wants to buy (Box 1 below).
Box 1 should look up the price for the required licence in Box 2, in this case a 2 year subscription (I've removed lifetime licences for now). So the selection from Box 1 should find the following in Box 2 below:
The combination of criteria selected from Box 1, and the prices in Box 2 should then return the price to quote to the customer in box 3, as below:
I've simplified the spreadsheet in this example to hopefully help you understand my logic. The reality is we have hundreds of prices as we have multiple licence variants, as well as sector and vertical pricing. Therefore if I can figure out how to get this initial step working, I should be able to take it from there.
I don't really understand your comment about redundancy, I initially started with a pop-up but couldn;t figure out how to make the other cells respond, so I broke the pop up options into tick boxes. If you have a simplified method of achieving just this step above, I'm completely happy to change my (potentially flawed) methodology.
Thanks once again!
Drew
Message was edited by: The_Drew

Similar Messages

  • Can i create an app in xcode that is just a container to publish other apps ?

    Hello!
    What i want is to create and upload an app to the app store that is like a "private newsstand", where i can publish issues of a magazine that is created only with xcode, not html5 or pdf content.
    This way, our "client" would have a place where to look for this issues, and have all their apps grouped in the store.
    Thank you!

    No, your English is fine.
    Given your description it sounds to me anyway like something that could be handled via a web site and if Apple feels the same then they will probably not OK the app.
    But they have the final say. If you are already a member of the IOS developer program you should be directing these questions to the IOS developer forum.
    You might also want to check out App Store Review Guidelines
    regards

  • Price Determination (Pricing) Date Control - Purchase Order

    Hi,
    We are exploring the Price Determination (Pricing) Date Control in the Purchase Order.
    Clientu2019s requiring  is, correct me if it is a wrong requirement:
    We have created Tax Codes:
    C2 -  CST 2% valid from 01.04.2010
    C3 -  CST 3% valid from 01.04.2010
    We have created a purchase order with Tax Code C2 - CST 2% on 30.03.2010 as we are in doing back log entries. Since the tax code is valid from 01.04.2010 only , the purchase order is not displaying the Tax Code Value .
    Now we are doing the Goods Receipt on 01.04.2010, the system will not pass the entry for the CST as at time of GR, the System picks up the Tax data from the Purchase Order.
    Now we want that the System should pick up the Data at the Goods Receipt, not from the Purchase Order. Some one advised me to use put GR Date in Pr. Date Cat. Under Item-> Condition Control tab. We are able to view the Pr. Date Cat by changing the Screen Layout of ME21N.
    We want to know what use of the same & under what condition is, we use this.
    Our suggestion:
    1. We are of the view that we should create the Tax Codes with Valid Date from 01.01.2010 (not from 01.04.2010 as currently maintained)
    2. Or since we are doing the back log entry, we should create all the Open Purchase Orders dated 01.04.2010.
    Is this the correct way which we are suggesting?
    Please note that we are dealing with Excise Materials also?
    Please guide.

    Thanks for the reply,
    While testing the same, I also encountered the somewhat same problem.
    You are suggesting that we should change the Tax Code Valid From Date.
    What do mean by the follwoing:
    Pricing date category "GR date" can't be set in PO if price is entered manually (with condition type PBXX). This also means manually entered conditions at Po will not be used.
    Regards,

  • ***Price Determination (Pricing) Date Control

    Hi Experts,
    The client requirement is that it has a contract maintained for different months with different prices. PO is created for a certain date and price. But they want to do the GR with a later date may be after 5 months for the service they have received. They want to post the GR in the open period but the price should be picked up depending on the contract price maintained for that date in past.
    In contract and in Vendor we have a field called Price Determination (Pricing) Date Control which determines which date is to be used for price determination (pricing) purposes.
    My issue is if i use manual which is # 5 in contract and in Vendor still when i do the GR i am getting the price with the present posting date or the present date which has been maintained in the contract. Where should i maintain the manual date on GR so that my contract price gets picked up.
    Thanks for your support.
    Mavrik

    Dear Mavrik,
    The price always follow the date maintained in the price date field in the condition control tab at ME21N during
    creation of the PO. If you want during GR, the price follow a specific date, please kindly check and change
    again the date in the particular PO at the same tab and at the condition tab, click the update button after
    change the date.
    Best Regards,
    Ian Wong Loke Foong

  • Creating Index to a master table

    Hello All,
    I have a database table with the following fields
    CLIENT 
    MATNR
    KORDX
    KCATV
    VARIANT_NBR
    With the initial four fields making the primary key.  ( CLIENT, MATNR,  KORDX, KCATV).
    I would like to put an index to the table with the fields  (CLIENT, VARIANT_NBR), because there are many reads in the program for the field VARIANT_NBR. Could you please put across on views on this. What all factors should I consider for creating an index in performance perspective.
    Thanks in advance
    Sudha

    Hi,
    Regarding indexes information check this link...
    http://help.sap.com/saphelp_nw04/helpdata/en/cc/7c58b369022e46b629bdd93d705c8c/content.htm
    and
    http://www.ncsu.edu/it/mirror/mysql/doc/maxdb/en/6a/c943401a306f13e10000000a1550b0/content.htm
    And also go through the below information...
    They may help you in optimizing your program.
    The Optimizer
    Each database system uses an optimizer whose task is to create the execution plan for SQL statements (for example, to determine whether to use an index or table scan). There are two kinds of optimizers:
    1) Rule based
    Rule based optimizers analyze the structure of an SQL statement (mainly the SELECT and WHERE clauses without their values) and the table index or indexes. They then use an algorithm to work out which method to use to execute the statement.
    2) Cost based
    Cost based optimizers use the above procedure, but also analyze some of the values in the WHERE clause and the table statistics. The statistics contain low and high values of the fields, or a histogram containing the distribution of data in the table. Since the cost based optimizer uses more information about the table, it usually leads to faster database access. Its disadvantage is that the statistics have to be periodically updated.
    Minimize the Search Overhead
    You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
    Database Indexes
    Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan). The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set. You specify the fields of secondary indexes using the Abap Dictionary. You can also determine whether the index is unique or not. However, you should not create secondary indexes to cover all possible combinations of fields. Only create one if you select data by fields that are not contained in another index, and the performance is very poor. Furthermore, you should only create secondary indexes for database tables from which you mainly read, since indexes have to be updated each time the database table is changed. As a rule, secondary indexes should not contain more than four fields, and you should not have more than five indexes for a single database table. If a table has more than five indexes, you run the risk of the optimizer choosing the wrong one for a particular operation. For this reason, you should avoid indexes with overlapping contents. Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible. The fewer table entries that can be selected by a certain column, the higher that column's selectivity. Place the most selective fields at the beginning of the index. Your secondary index should be so selective that each index entry corresponds to at most five percent of the table entries. If this is not the case, it is not worth creating the index. You should also avoid creating indexes for fields that are not always filled, where their value is initial for most entries in the table. If all of the columns in the SELECT clause are contained in the index, the system does not have to search the actual table data after reading from the index. If you have a SELECT clause with very few columns, you can improve performance dramatically by including these columns in a secondary index.
    Formulating Conditions for Indexes
    You should bear in mind the following when formulating conditions for the WHERE and HAVING clauses so that the system can use a database index and does not have to use a full table scan. Check for Equality and Link Using AND The database index search is particularly efficient if you check all index fields for equality (= or EQ) and link the expressions using AND.
    Use Positive conditions
    The database system only supports queries that describe the result in positive terms, for example, EQ or LIKE. It does not support negative expressions like NE or NOT LIKE. If possible, avoid using the NOT operator in the WHERE clause, because it is not supported by database indexes; invert the logical expression instead.
    Using OR
    The optimizer usually stops working when an OR expression occurs in the condition. This means that the columns checked using OR are not included in the index search. An exception to this are OR expressions at the outside of conditions. You should try to reformulate conditions that apply OR expressions to columns relevant to the index, for example, into an IN condition.
    Using Part of the Index
    If you construct an index from several columns, the system can still use it even if you only specify a few of the columns in a condition. However, in this case, the sequence of the columns in the index is important. A column can only be used in the index search if all of the columns before it in the index definition have also been specified in the condition.
    Checking for Null Values
    The IS NULL condition can cause problems with indexes. Some database systems do not store null values in the index structure. Consequently, this field cannot be used in the index.
    Avoid Complex Conditions
    Avoid complex conditions, since the statements have to be broken down into their individual components by the database system.
    Hope this information had helped you.
    Regards
    Narin Nandivada.

  • Valuation Variant - Quotation Price via Condition Table

    Hi all,
    Regarding cost estimate in SAP, there are valuation variants. The strategy sequence "Price from Purchasing Info Record" is one step in the material valuation strategy sequence of our  valuation variant PP01. There is also a sub strategy sequence with this Puchasing Info Record Valuation called "Quotation Price via Condition Table".
    What does the mean, where can I find this condition table and how will the price be calculated??? Can anybody help me please?
    Thanks,
    Anne

    Create origin group via Tcode OKZ1 and then assign the conditions that you want to include in product costing in Tcode OKK4.
    In OKK4 by clicking delivery costs or create new icon you will get a popupform which can be used to input chosen conditions as follows.
    PB00     0     200     1000     1000     1000     PR01
    We are using it to calculate material price excluding excise duty (sort of withholding tax which can be reclaimed so will not form part of material cost)

  • How to create an arrow in a table

    How to create an arrow in a table in numbers.
    If you have plus or minus numbers, I want to know a green arrow on the increase is positively or a red arrow if it is negative number

    Maybe something like this?

  • How to CREATE VIEW to merge two tables each of which has CLOB-typed column

    I failed in creating a view to merge two tables that have CLOB-type column each.
    The details are:
    Database: Oracle 9i (9.2.0)
    Two tables "test" and "test_bak", each of which has the following structure:
    ID Number(10, 0)
    DUMMY VARCHAR2(20)
    DUMMYCLOB CLOB
    The following operation fails:
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test
    union
    select id, dummy, dummyclob from test_bak;
    I was announced:
    select test.id, test.dummy, test.dummyclob
    ERROR in line 2:
    ORA-00932: inconsistent data type: required - , but CLOB presented.
    But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
    1) one table, with CLOB-typed column
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test;
    2) two tables, without CLOB-typed columns
    create view dummyview (id, dummy) as
    select id, dummy from test
    union
    select id, dummy from test_bak;
    I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
    many thanks in advance

    Dong Wenyu,
    No.
    But you could do this:
    SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
    FROM your_table1 tab1, your_table2 tab2, (
    SELECT primary_key, ...
    FROM your_table1
    UNION
    SELECT primary_key, ...
    FROM your_table2
    ) source
    WHERE source.primary_key = tab1.id (+)
    AND source.primary_key = tab2.id (+)
    In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
    d.

  • How to create xsd's for each table in repository instead of entire repos

    Hi Gurus,
    Is there any way i could create xsd's for each table in the repository separately instead of creating single xsd file from "Export repository schema" option which creates a single xml file for the entire repository.I need to create xsd for each table in repository...
    Any Help greatly appreciated
    Thanks
    Aravind

    Open the Lookup table you want the XSD for, in Data manger
    Export it to access.( You can select all the fields you want to export to access and then check option "open Access after export")
    Now in Access, again right click the table and export it to XML.
    Provided you have .NET frame work installed on the machine where you are doing this export, you can do the following:
    Use XSD.exe from command prompt and get the XSD.
    Use the following link as a reference for XSD stuff.
    http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx
    (OR)
    Get the whole XML of the repository and distill the whole structure for Lookups and create XSD using any standard XML editor.

  • How to create t-code for a table and how to create transaction variant???

    Hi,
    I have created a custom table zsark.
    Now my requirement is : I have to create a transaction variant zsark_var for sm30 and table zsark. I have to disable the output of the first screen. I have to assign the transaction variant to the transaction code of table zsark.
    Now,
    1.     how to create transaction code to a table. Can any one give me the 
                    staps??
    2.     how to create transaction variant for the above requirement???
    Thanks & Regards,
    Sarkar

    Hi
    1 Goto SE93 transaction
    2 Choose 5th option Transaction with parameters
    3 Give transaction : SM30, Check Skip Initial Screen Press Enter
    4 Goto Bottom left corner, click F4 select viewname, on right hand side give table name
    5 Press one more time F4, choose update , mark it X on right side.
    6 save the transaction.
    Thanks
    sandeep
    reward if helpful

  • Is it possible to create a price list which is non-taxable?

    Is it possible to create a price list which is non-taxable?

    The answer is yes but how you go about this depends on where you publish. See....
    http://www.iwebformusicians.com/Tricks/Forms.html
    For bulk emailing, I use the application SerialMailer which will import a group from your Address Book into its data base. The application is easy to use and hyperlinks are set by using the formatted text option.
    Serial Mailer can be set to send your emails in bursts with a time interval between them so that your internet connection doesn't get bogged down.
    http://www.falkon-ware.com/SerialMailer/
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • Error while create trigger on for nested table

    I want to insert a record into a nested table.For this, I created a view for the table, which includes the nested table.It told me ORA-25015 cannot perform DML on this nested table view column.So I created a trigger for the nested table.However, it told me that ORA-25010 Invalid nested table column name in nested table clause.I think my nested table is valid, i don't konw why did it appear this kind of problem?
    My table is
    CREATE TABLE ENT
    ID NUMBER(7) NOT NULL,
    CREATE_DATE VARCHAR2(11 BYTE),
    UPDATE_DATE VARCHAR2(11 BYTE),
    DEPTS VARRAY_DEPT_SEQ
    CREATE OR REPLACE
    TYPE DEPT AS OBJECT
    ID NUMBER(8),
    ANCHOR VARCHAR2(20),
    CREATE OR REPLACE
    TYPE " VARRAY_DEPT_SEQ" as varray(930) of DEPT
    CREATE OR REPLACE VIEW ENT_NESTED_VIEW
    (ID, CREATE_DATE, UPDATE_DATE, DEPTS)
    AS
    select e.ID,cast(multiset(select r.id,r.anchor from ent z, table(z.depts) r where z.ID=e.ID )as varray_dept_seq)
    FROM ENT e
    Then when I created trigger;
    CREATE OR REPLACE TRIGGER EMP.ENT_NESTED_TRI
    INSTEAD OF INSERT
    ON NESTED TABLE DEPTS OF EMP.ENT_NESTED_VIEW
    REFERENCING NEW AS New OLD AS Old PARENT AS Parent
    FOR EACH ROW
    BEGIN
    END ;
    I met the problem: ORA-25010 Invalid nested table column name in nested table clause
    Could you please tell me the reason
    Thank you!
    My insert SQL is:
    insert into table(select depts from ent_nested_view where id=1856) values(varray_dept_seq(dept(255687,'AF58743')))
    Message was edited by:
    user589751

    Hi,TongucY
    Compared with the "Referencing Clause with Nested Tables" part of this reference -
    http://psoug.org/reference/instead_of_trigger.html, I found the answer of this
    quesion. That is "CREATE OR REPLACE TYPE " VARRAY_DEPT_SEQ" as[b] varray(930) of
    DEPT". It turns to be a varying array, not a nested table. It should be "CREATE OR
    REPLACE TYPE " VARRAY_DEPT_SEQ" as table of DEPT". That is OK. Thank you very
    much!
    While there is an another question, if I create a varying array like" CREATE OR
    REPLACE TYPE " VARRAY_DEPT_SEQ" as[b] varray(930) of DEPT " and I want to insert
    a record into the varying array, which the record has been existed.The method that
    create a view and a trigger seems not to be effective.
    For instance,
    There is a record in the table
    ID:1020
    CREATE_DATE:2005-10-20
    UPDATE_DATE:2007-2-11
    DETPS: ((10225,AMY))
    I want to ask this record to be
    ID:1020
    CREATE_DATE:2005-10-20
    UPDATE_DATE:2007-2-11
    DETPS: ((10225,AMY),(10558,TOM))
    How should I do?
    Could you please help me?
    Best regards.
    Message was edited by:
    user589751

  • Unable to create new price validity in Scheduling agreement

    Dear Experts
    We are SAP 4.7 version.
    We have 4 companies and 17 plants in same client server.We are facing problem in a particular company having two plants not able to change price in scheduling agreement with validity period.But in other company code allowing to create new price validity period.
    Any configuration missing out please help us to resolve the issue.
    Most urgent
    SS

    Hello Suresh,
    There are two possibilities
    1. Missing authorization :Check if you have the same authorization profile for maintaining data in all company code/plant/purchasing organizaiton.
    2. Release streatagy: Check if you have activated release procedure in such a way that once it is release it will not allow any changes in scheduling agreement.
    Hope this helps.
    Regards
    Arif Mansuri

  • How can you create a layer under a table?

    If anyone knows how- or can send me a linkon how to create a
    layer under a table.
    Great help!!
    ty

    Except that z-index of 2 will appear HIGHER in the
    z-coordinate than a
    z-index of 1. But we still don't know if that's what OP meant
    by "under".
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "L. Simon" <[email protected]> wrote in
    message
    news:fbpj5r$89p$[email protected]..
    > This would be my first attempt:
    >
    quote:
    > <div style="z-index:1">
    > .... table content...
    > </div>
    >
    > <div id="stuffunderatable" style="z-index:2">
    > ... whatever you want under the table>
    > </div>
    >
    > <style type="text/css">
    > #stuffunderatable {
    > position:absolute;
    > top:45px;
    > left:45px;}
    > </style>
    >
    > Note that the 45px numbers are out of thin air, and
    you'll need to adjust
    > it
    > to get the layer to appear where you want on your page.
    >

  • TIPS(18) : CREATING SCRIPTS TO RECREATE A TABLE STRUCTURE

    제품 : SQL*PLUS
    작성날짜 : 1996-11-12
    TIPS(18) : Creating Scripts to Recreate a Table Structure
    =========================================================
    The script creates scripts that can be used to recreate a table structure.
    For example, this script can be used when a table has become fragmented or to
    get a defintion that can be run on another database.
    CREATES SCRIPT TO RECREATE A TABLE-STRUCTURE
    INCL. STORAGE, CONSTRAINTS, TRIGGERS ETC.
    This script creates scripts to recreate a table structure.
    Use the script to reorganise a table that has become fragmented,
    to get a definition that can be run on another database/schema or
    as a basis for altering the table structure (eg. drop a column!).
    IMPORTANT: Running the script is safe as it only creates two new scripts and
    does not do anything to your database! To get anything done you have to run the
    scripts created.
    The created scripts does the following:
    1. save the content of the table
    2. drop any foreign key constraints referencing the table
    3. drop the table
    4. creates the table with an Initial storage parameter that
    will accomodate the entire content of the table. The Next
    parameter is 25% of the initial.
    The storage parameters are picked from the following list:
    64K, 128K, 256K, 512K, multiples of 1M.
    5. create table and column comments
    6. fill the table with the original content
    7. create all the indexes incl storage parameters as above.
    8. add primary, unique key and check constraints.
    9. add foreign key constraints for the table and for referencing
    tables.
    10.Create the table's triggers.
    11.Compile any depending objects (cascading).
    12.Grant table and column privileges.
    13.Create synonyms.
    This script must be run as the owner of the table.
    If your table contains a LONG-column, use the COPY
    command in SQL*Plus to store/restore the data.
    USAGE
    from SQL*Plus:
    start reorgtb
    This will create the scripts REORGS1.SQL and REORGS2.SQL
    REORGS1.SQL contains code to save the current content of the table.
    REORGS2.SQL contains code to rebuild the table structure.
    undef tab;
    set echo off
    column a1 new_val stor
    column b1 new_val nxt
    select
    decode(sign(1024-sum(bytes)/1024),-1,to_char((round(sum(bytes)/(1024*1
    024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
    decode(sign(512-sum(bytes)/1024), -1,'1M',
    decode(sign(256-sum(bytes)/1024), -1,'512K',
    decode(sign(128-sum(bytes)/1024), -1,'256K',
    decode(sign(64-sum(bytes)/1024) , -1,'128K',
    '64K'
    a1,
    decode(sign(1024-sum(bytes)/4096),-1,to_char((round(sum(bytes)/(4096*1
    024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
    decode(sign(512-sum(bytes)/4096), -1,'1M',
    decode(sign(256-sum(bytes)/4096), -1,'512K',
    decode(sign(128-sum(bytes)/4096), -1,'256K',
    decode(sign(64-sum(bytes)/4096) , -1,'128K',
    '64K'
    b1
    from user_extents
    where segment_name=upper('&1');
    set pages 0 feed off verify off lines 150
    col c1 format a80
    spool reorgs1.sql
    PROMPT drop table bk_&1
    prompt /
    PROMPT create table bk_&1 storage (initial &stor) as select * from &1
    prompt /
    spool off
    spool reorgs2.sql
    PROMPT spool reorgs2
    select 'alter table '||table_name||' drop constraint
    '||constraint_name||';'
    from user_constraints where r_constraint_name
    in (select constraint_name from user_constraints where
    table_name=upper('&1')
    and constraint_type in ('P','U'));
    PROMPT drop table &1
    prompt /
    prompt create table &1
    select decode(column_id,1,'(',',')
    ||rpad(column_name,40)
    ||decode(data_type,'DATE' ,'DATE '
    ,'LONG' ,'LONG '
    ,'LONG RAW','LONG RAW '
    ,'RAW' ,'RAW '
    ,'CHAR' ,'CHAR '
    ,'VARCHAR' ,'VARCHAR '
    ,'VARCHAR2','VARCHAR2 '
    ,'NUMBER' ,'NUMBER '
    ,'unknown')
    ||rpad(
    decode(data_type,'DATE' ,null
    ,'LONG' ,null
    ,'LONG RAW',null
    ,'RAW' ,decode(data_length,null,null
    ,'('||data_length||')')
    ,'CHAR' ,decode(data_length,null,null
    ,'('||data_length||')')
    ,'VARCHAR' ,decode(data_length,null,null
    ,'('||data_length||')')
    ,'VARCHAR2',decode(data_length,null,null
    ,'('||data_length||')')
    ,'NUMBER' ,decode(data_precision,null,' '
    ,'('||data_precision||
    decode(data_scale,null,null
    ,','||data_scale)||')')
    ,'unknown'),8,' ')
    ||decode(nullable,'Y','NULL','NOT NULL') c1
    from user_tab_columns
    where table_name = upper('&1')
    order by column_id
    prompt )
    select 'pctfree '||t.pct_free c1
    ,'pctused '||t.pct_used c1
    ,'initrans '||t.ini_trans c1
    ,'maxtrans '||t.max_trans c1
    ,'tablespace '||s.tablespace_name c1
    ,'storage (initial '||'&stor' c1
    ,' next '||'&stor' c1
    ,' minextents '||t.min_extents c1
    ,' maxextents '||t.max_extents c1
    ,' pctincrease '||t.pct_increase||')' c1
    from user_Segments s, user_tables t
    where s.segment_name = upper('&1') and
    t.table_name = upper('&1')
    and s.segment_type = 'TABLE'
    prompt /
    select 'comment on table &1 is '''||comments||''';' c1 from
    user_tab_comments
    where table_name=upper('&1');
    select 'comment on column &1..'||column_name||
    ' is '''||comments||''';' c1 from user_col_comments
    where table_name=upper('&1');
    prompt insert into &1 select * from bk_&1
    prompt /
    set serveroutput on
    declare
    cursor c1 is select index_name,decode(uniqueness,'UNIQUE','UNIQUE')
    unq
    from user_indexes where
    table_name = upper('&1');
    indname varchar2(50);
    cursor c2 is select
    decode(column_position,1,'(',',')||rpad(column_name,40) cl
    from user_ind_columns where table_name = upper('&1') and
    index_name = indname
    order by column_position;
    l1 varchar2(100);
    l2 varchar2(100);
    l3 varchar2(100);
    l4 varchar2(100);
    l5 varchar2(100);
    l6 varchar2(100);
    l7 varchar2(100);
    l8 varchar2(100);
    l9 varchar2(100);
    begin
    dbms_output.enable(100000);
    for c in c1 loop
    dbms_output.put_line('create '||c.unq||' index '||c.index_name||' on
    &1');
    indname := c.index_name;
    for q in c2 loop
    dbms_output.put_line(q.cl);
    end loop;
    dbms_output.put_line(')');
    select 'pctfree '||i.pct_free ,
    'initrans '||i.ini_trans ,
    'maxtrans '||i.max_trans ,
    'tablespace '||i.tablespace_name ,
    'storage (initial '||
    decode(sign(1024-sum(e.bytes)/1024),-1,
    to_char((round(sum(e.bytes)/(1024*1024))+1))||'M',
    decode(sign(512-sum(e.bytes)/1024), -1,'1M',
    decode(sign(256-sum(e.bytes)/1024), -1,'512K',
    decode(sign(128-sum(e.bytes)/1024), -1,'256K',
    decode(sign(64-sum(e.bytes)/1024) , -1,'128K',
    '64K'))))) ,
    ' next '||
    decode(sign(1024-sum(e.bytes)/4096),-1,
    to_char((round(sum(e.bytes)/(4096*1024))+1))||'M',
    decode(sign(512-sum(e.bytes)/4096), -1,'1M',
    decode(sign(256-sum(e.bytes)/4096), -1,'512K',
    decode(sign(128-sum(e.bytes)/4096), -1,'256K',
    decode(sign(64-sum(e.bytes)/4096) , -1,'128K',
    '64K'))))) ,
    ' minextents '||s.min_extents ,
    ' maxextents '||s.max_extents ,
    ' pctincrease '||s.pct_increase||')'
    into l1,l2,l3,l4,l5,l6,l7,l8,l9
    from user_extents e,user_segments s, user_indexes i
    where s.segment_name = c.index_name
    and s.segment_type = 'INDEX'
    and i.index_name = c.index_name
    and e.segment_name=s.segment_name
    group by s.min_extents,s.max_extents,s.pct_increase,
    i.pct_free,i.ini_trans,i.max_trans,i.tablespace_name ;
    dbms_output.put_line(l1);
    dbms_output.put_line(l2);
    dbms_output.put_line(l3);
    dbms_output.put_line(l4);
    dbms_output.put_line(l5);
    dbms_output.put_line(l6);
    dbms_output.put_line(l7);
    dbms_output.put_line(l8);
    dbms_output.put_line(l9);
    dbms_output.put_line('/');
    end loop;
    end;
    declare
    cursor c1 is
    select constraint_name, decode(constraint_type,'U',' UNIQUE',' PRIMARY
    KEY') typ,
    decode(status,'DISABLED','DISABLE',' ') status from user_constraints
    where table_name = upper('&1')
    and constraint_type in ('U','P');
    cname varchar2(100);
    cursor c2 is
    select decode(position,1,'(',',')||rpad(column_name,40) coln
    from user_cons_columns
    where table_name = upper('&1')
    and constraint_name = cname
    order by position;
    begin
    for q1 in c1 loop
    cname := q1.constraint_name;
    dbms_output.put_line('alter table &1');
    dbms_output.put_line('add constraint '||cname||q1.typ);
    for q2 in c2 loop
    dbms_output.put_line(q2.coln);
    end loop;
    dbms_output.put_line(')' ||q1.status);
    dbms_output.put_line('/');
    end loop;
    end;
    declare
    cursor c1 is
    select c.constraint_name,c.r_constraint_name cname2,
    c.table_name table1, r.table_name table2,
    decode(c.status,'DISABLED','DISABLE',' ') status,
    decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
    delete_rule
    from user_constraints c,
    user_constraints r
    where c.constraint_type='R' and
    c.r_constraint_name = r.constraint_name and
    c.table_name = upper('&1')
    union
    select c.constraint_name,c.r_constraint_name cname2,
    c.table_name table1, r.table_name table2,
    decode(c.status,'DISABLED','DISABLE',' ') status,
    decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
    delete_rule
    from user_constraints c,
    user_constraints r
    where c.constraint_type='R' and
    c.r_constraint_name = r.constraint_name and
    r.table_name = upper('&1');
    cname varchar2(50);
    cname2 varchar2(50);
    cursor c2 is
    select decode(position,1,'(',',')||rpad(column_name,40) colname
    from user_cons_columns
    where constraint_name = cname
    order by position;
    cursor c3 is
    select decode(position,1,'(',',')||rpad(column_name,40) refcol
    from user_cons_columns
    where constraint_name = cname2
    order by position;
    begin
    dbms_output.enable(100000);
    for q1 in c1 loop
    cname := q1.constraint_name;
    cname2 := q1.cname2;
    dbms_output.put_line('alter table '||q1.table1||' add constraint ');
    dbms_output.put_line(cname||' foreign key');
    for q2 in c2 loop
    dbms_output.put_line(q2.colname);
    end loop;
    dbms_output.put_line(') references '||q1.table2);
    for q3 in c3 loop
    dbms_output.put_line(q3.refcol);
    end loop;
    dbms_output.put_line(') '||q1.delete_rule||q1.status);
    dbms_output.put_line('/');
    end loop;
    end;
    col c1 format a79 word_wrap
    set long 32000
    set arraysize 1
    select 'create or replace trigger ' c1,
    description c1,
    'WHEN ('||when_clause||')' c1,
    trigger_body ,
    '/' c1
    from user_triggers
    where table_name = upper('&1') and when_clause is not null
    select 'create or replace trigger ' c1,
    description c1,
    trigger_body ,
    '/' c1
    from user_triggers
    where table_name = upper('&1') and when_clause is null
    select 'alter trigger '||trigger_name||decode(status,'DISABLED','
    DISABLE',' ENABLE')
    from user_Triggers where table_name='&1';
    set serveroutput on
    declare
    cursor c1 is
    select 'alter table
    '||'&1'||decode(substr(constraint_name,1,4),'SYS_',' ',
    ' add constraint ') a1,
    decode(substr(constraint_name,1,4),'SYS_','
    ',constraint_name)||' check (' a2,
    search_condition a3,
    ') '||decode(status,'DISABLED','DISABLE','') a4,
    '/' a5
    from user_constraints
    where table_name = upper('&1') and
    constraint_type='C';
    b1 varchar2(100);
    b2 varchar2(100);
    b3 varchar2(32000);
    b4 varchar2(100);
    b5 varchar2(100);
    fl number;
    begin
    open c1;
    loop
    fetch c1 into b1,b2,b3,b4,b5;
    exit when c1%NOTFOUND;
    select count(*) into fl from user_tab_columns where table_name =
    upper('&1') and
    upper(column_name)||' IS NOT NULL' = upper(b3);
    if fl = 0 then
    dbms_output.put_line(b1);
    dbms_output.put_line(b2);
    dbms_output.put_line(b3);
    dbms_output.put_line(b4);
    dbms_output.put_line(b5);
    end if;
    end loop;
    end;
    create or replace procedure dumzxcvreorg_dep(nam varchar2,typ
    varchar2) as
    cursor cur is
    select type,decode(type,'PACKAGE BODY','PACKAGE',type) type1,
    name from user_dependencies
    where referenced_name=upper(nam) and referenced_type=upper(typ);
    begin
    dbms_output.enable(500000);
    for c in cur loop
    dbms_output.put_line('alter '||c.type1||' '||c.name||' compile;');
    dumzxcvreorg_dep(c.name,c.type);
    end loop;
    end;
    exec dumzxcvreorg_dep('&1','TABLE');
    drop procedure dumzxcvreorg_Dep;
    select 'grant '||privilege||' on '||table_name||' to '||grantee||
    decode(grantable,'YES',' with grant option;',';') from
    user_tab_privs where table_name = upper('&1');
    select 'grant '||privilege||' ('||column_name||') on &1 to
    '||grantee||
    decode(grantable,'YES',' with grant option;',';')
    from user_col_privs where grantor=user and
    table_name=upper('&1')
    order by grantee, privilege;
    select 'create synonym '||synonym_name||' for
    '||table_owner||'.'||table_name||';'
    from user_synonyms where table_name=upper('&1');
    PROMPT REM
    PROMPT REM YOU MAY HAVE TO LOG ON AS SYSTEM TO BE
    PROMPT REM ABLE TO CREATE ANY OF THE PUBLIC SYNONYMS!
    PROMPT REM
    select 'create public synonym '||synonym_name||' for
    '||table_owner||'.'||table_name||';'
    from all_synonyms where owner='PUBLIC' and table_name=upper('&1') and
    table_owner=user;
    prompt spool off
    spool off
    set echo on feed on verify on
    The scripts REORGS1.SQL and REORGS2.SQL have been
    created. Alter these script as necesarry.
    To recreate the table-structure, first run REORGS1.SQL.
    This script saves the content of your table in a table
    called bk_.
    If this script runs successfully run REORGS2.SQL.
    The result is spooled to REORGTB.LST.
    Check this file before dropping the bk_ table.
    */

    Please do NOT cross-postings: create a deep structure for dynamic internal table
    Regards
      Uwe

Maybe you are looking for

  • Automatic creation of Inb.Del from PO

    Hello, In our scenario we wanted the inbound delivery to be created automatically whan the PO is saved.....How it could be done...? Can any one help...? Thanks Larry

  • Updating a component outside the context of the f:ajax element

    Is there a way to make the following code work, apart from placing the "out" component inside the h:form element? <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"           "http://www.w3.org

  • No Administrative Rights in v6.0 for Level 10?

    2 questions: 1) I have delivered my first upgrade of Lookout to v6.0.1 for a customer. Two days later I go to add another person to level 10 and find I do not have administrative rights to do this. I get a pop-up window that tells me this. Bad news,

  • My N73 not working with ovi or pcsuite after i upd...

    My N73 not connecting with my windows vista after an updated my old software with the nokia software update. i have tried resetting mu phone and unistalling the pc suite and ovi and installing them back but no use... i hav no idea what to do. the mas

  • The phone is hanging...

    why is it that sometimes when im listening to my songs, it stops. the phone goes off then on again. is there something wrong with my phone. i've checked the memory and its not yet full.