Create new duplicated table

I have a table with 10 fields and about 400 records in an Oracle 9i database.
Please advise how I can create a duplicate table with the same fields and no records in it?

What is the 1=2 part??Well, you asked for a table copy with no records in it, huh? Soooooo, there's almost no chance that 1=2 is true :-) hence you'll get an empty recordset with the table structure -> that's how the table is created: empty (1=2) and with the original table structure (except grants, indexes, constraints, ...).
Also how can I get records, indexes, constraints etc to work calling the dbms_metadata package?You want the records too, now?
In order to use DBMS_METADATA, first use
describe dbms_metadata in order to know what's included in the package. Then, for example, at SQL*Plus prompt, issue:
set long 100000
select dbms_metadata.get_ddl('TABLE','OLD_TABLE_NAME','OLD_TABLE_OWNER') from dual;And read the manual page about DBMS_METADATA in the doc.
Yoann.

Similar Messages

  • How do I create new user table in program and then access it?

    I am writing an application where I check for the existence of user objects when the add on starts and run the setup if the objects do not exist. I can create the user tables and fields but after the setup completes these objects still are not visible.
    If the user objects exist when the add on is first run everything is detected correctly.
    When a user object is added in SAP the user is eventually prompted to restart so I suspect something needs to happen prior to the add on being able to use the new fields.
    Does the add on need to wait for the DI Server to perform some action? Do I need to just quit the add on's class and rerun it, disconnect and reconnect to the company, or get a new Application and/or company object?
    What I want to do is figure out a way for the add on to automatically run the configuration if the user tables and fields do not exist yet and then kick off the regular add on code. I haven't seen anyone else's code so I don't know what is recommended or required here.
    Thanks for any assistance!

    I found that the add on can validate the existance of the user fields if I disconnect from the company object, set the SAPbouiCOM.Application and SAPbobsCOM.Company objects to null, set the new application, context, and company objects, and reconnect once more.
    HOWEVER...
    I still have to wait for the client to be restarted manually before I can run any of the form I added to the menu.
    So, I'd still like to know what the best practice is here. Should I just exit after setting up the tables and tell the user to restart SAP?

  • Creating New condition table.

    Hi all,
    I want to create conndition table with new fields. I have added those Zfields to VBAP, KOMPAZ.
    Do i need to code anything in userexit_pricing _prepare_tkomp for populating the fields in list of allowed fields while creating while creating condition table?
    Thanks & regards,
    NarsiReddy.

    If any field to be considered for condition table, the same would be done via V/03 where you can add any fields that are missing from standard.  But once you save, system will ask for Access Key without which, it won't flow in condition table.  Hence, user exit is not necessary.  But it would be ideal if you explain the business process as to why you were looking for adding some new fields.  Hope, you are not reinventing the wheel.
    G. Lakshmipathi

  • Create new schema,table

    Hi,
    I want to add some labels and columns
    in the EBS page
    for that
    and want to take input from user and save inputed data in to database
    for that purpose
    I need to create one new scheme and table
    some VO and CO extends
    how can i do it?

    no reponse

  • Error while dropping/creating new queue table

    Hi,
    I am trying to modify an existing AQ setup. In the process, I had to remove a queue and redirect all its subscriptions to another queue.
    I get an oracle "sequence does not exist" while trying to drop the queue table. The sequence of operations that I am carrying out is:
    disable propagation schedule
    unschedule propagation
    stop queue
    drop queue
    drop queue table
    The error occurs when the drop statement is executed.
    I tried restoring the existing configuration, but got the same error message while trying to add a subscription.
    Could you help me with this problem? What am I missing here?
    Thanks,
    Anupama

    In what version of Oracle?
    I see a couple of problems assuming you are working with a currently supported version:
    1. Never grant CONNECT to anyone: Ever. Grant CREATE SESSION.
    2. GRANT CREATE TABLE to AQ;
    Go to Morgan's Library at www.psoug.org and look at AQ Demo 1. You should have no problem cutting and pasting your way to where you are trying to go.

  • Sales Order Unable to Use New Condition Tables for Tax Condition Type

    Dear All,
    I am currently working on SAP R/3 4.0. I have a new requirement for my tax where I need to create new condition tables other than the 4 standard SAP tables which are Customer/Material, Division/Customer, Departure Country/Destination Country, Domestic Taxes and Export Taxes. My new tables consists of Departure Country/Destination Country/Shipping Point/Tax Code. The requirement is that the tax code is based on the chosen destination country and shipping point. The problem I am facing now is that no matter what types of table I create or even I generate with reference to the standard table, the access sequence will only refer to the 4 standard SAP tables above. Even if I put my own table in the highest priority for the access sequence, the same thing happens. My sales order will only pick up date from the standard table.
    I wonder if anyone encountered the same problem as me.
    Kindly advise.
    Thank you.
    Regards,
    Yvonne

    Hi
    Yvonne
    I suggest fist check a simple thing ,whether u have successfully determined shipping point for each line item ,it is possible that just adding a line item will not trigger shipping point determination . So after u update the shipping point on line level u can rerun pricing and check agian if u r getting it .
    Secondly for tax purposes I suggest   Try to have Customer and material tax classification approach  this allows to u have long term flexibiliy and also reduces your maintenance activity . As if u change or add number of shipping points and business changes using the sequence of shipping point ,the logic of just using shipping point will not work.
    In Tax classification u cna add new condition table for each new tax category and use it in different access sequences.
    This information can be passed on to FI using Different Tax code for Different combination.
    I hope this helps
    Regards
    Mandar

  • New Condition Table not working in Sales order

    Dear All,
    I am facing problem in pricing procedure. I have created new condition table(LIFNR & ROUTE), included Vendor(Fwd Agent) and Route in condition table with sales area. I have added that condition table in access sequence and assigned access sequence to condition type. Then Condition type added into pricing procedure and assigned pricing procedure to document type.
    In sales order I've added route and fwd agent but while checking in analysis system does not determine route and fwd agent.
    Thanks and Regards,
    Kaushal

    hi,
    i have a query to ask why you need LIFNR in condition table creation.
    where in sales order it will trigger automatically.
    please check the config settings for route determiantion automatically.
    so that if route comes automatically into the sales order then from where you will trigger LIFNR.
    please clarify.
    regards,
    balajia.

  • Configure Universal Adapter 2 generate New BAW Tables or use Existings OBAW

    Hi Experts,
    i have a doubt on if New OBAW tables have to be created as we add new subject areas from Universal Adapter Containers
    or can use existing OBAW tables that are generated from Other containers.
    For Example:
    Our Existing contianer is PeopleSoft 9.0 and OBAW Tables are created usign Peoplesoft Container.
    of all the subject areas from Peoplesoft Containers, Only Workforce Profile and HR Payroll is used.
    as the container is created using Peoplesoft 9.0, all the Tables (532 tABLES) are created for all the subject areas.
    now, we are planning to use Universal Adapters to configure rest of the subject areas like Absence Managementr and Recruitment because they are maintained by Third Party Vendors which have no relation with Peoplesoft.
    my doubt is,
    1. if i can use the same Existing OBAW Tables for Universal Adapters or create NEW OBAW tables using Universal Adapter container.
    2. if ii have to create New tables using Universal Adapter containers, all the table belonging to other Universal Adapters Subject areas like Loyalty Analytics, call center analytics are also created by default. how to avaoid this. i tried to create OBAW by creating a container with Only HR-Absence Management subject area and Recruitment subject area, unfortunatley, all the tables are again created.
    3. it looks like there are common dimension files used for this Universal Subject areas, is it Mandory to use them to Populate HR-Absence Managment subject area.
    Please HELP
    Is there is a good refernce guides on how to configure all this espically with Universal adapters in Out side world or in Metalink
    Thanks
    Kumar

    Please take a look at this article which states SYSDATE is not supported in a
    where clause.
    http://www.oracle.com/technology/pub/articles/bpel_cookbook/qualcomm-bpel.html
    Excerpt from the article:
    Here are three important things you should do in implementing the above design:
    Have the status of the record being processed stored in the database. The status includes the process state, next process attempt time, and processing attempt count.
    Create an updatable view that exposes only records that are ready to be processed. A view is needed because the database adapter cannot handle a where clause that compares against SYSDATE.
    Design logic that determines if a process instance that has faulted should be retried and when the retry should occur. This information will be updated in the database by use of a stored procedure. This can also be done with an update partner link and additional logic in BPEL.
    mahalo,
    a iii

  • New Condition Table in V/LB

    Dear Experts,
    We have created new condition table and created new access sequence with the new condition table.
    In V/LB ( Change Pricing report ) when i going to add new condition table in excisting pricing report system is not allowing.
    Please suggest is it possible to add new condition table in existing pricing report or have to create new priceing report incorparating new condition table.
    Regards,
    KC Choudhury

    Hi
    It is disabled in change mode (V/LB), only you would be able to select the tables in V/LA.
    thank you

  • New Z table updation

    Hi Gurus
    We have created new Z table. Also a new Tcode for the report genetaion for COPA.
    Let me know how do we update the table with daily data.  Is there any standard job SAP has provided.
    Replies are highly appreciated.
    Regards
    SAP only.

    Hi,
    If you need to update the Ztable you need to write a program and in program yu can use screens or
    normal calculations depending upon the requirement, you can also use update modify  along with insert commands in program,,
    Thanks & regards,
    Dileep .C

  • Error while creating new table

    Hi
    First I had deleted one custom table. Then I try to create the same table with different fields. Now I am gettinh the errors.
    1.    ZLV_COMP_TABLE: Inconsistency DD <-> DB (check table with analysis tool)
    2.   A table called ZLV_COMP_TABLE exists in the database
    3.   No active nametab exists for ZLV_COMP_TABLE
    4.   Termination due to inconsistencies
    5.  Table ZLV_COMP_TABLE (Statements could not be generated)
      6.  Error number in DD_DECIDE (9)
    Please help me ... how can I create a table with same name.
    thanks
    Subhankar

    Hello,
    goto SE14 -- Give the table name
    use Tables Radio button
    click on Edit
    check the Delete Data Radio button
    click on ACTIVATE AND ADJUST DATABASE.
    Now check the table in SE11.
    If it still exits you can change the same table or Delete it again & create a new table with Same Name.
    This might help your query.
    Anil.

  • Creating  A new Pricing table

    hi everyone
    i need to create  a new price table for ZS83 based on
    PM_COLOUR. This new table needs to allow me to set
    different special
    colour pricing for Coca Cola Canada customer for the
    different sizes this customer purchases: 813 (TBA), 466 (TBA), 465
    (TWA)
    waiting for the reply
    thank you
    praveen
    praveen

    Praveen,
    I don't think this is the right forum where you can get an answer on the pricing procdures.
    This forum is for ESA.
    Regards
    Ravi

  • Access key needed when creating a new database table with SE11

    Hi,
    I'm using SAP Testdrive (evaluation) on linux in order to learn a bit about ABAP programming. I want to create a new database table in the  dictionary to be used in my programs. I proceed in the following way:
    1) I run the SE11 transaction
    2) At the first entry I write the name of the table to be created (in the Database Table field)
    3) I click on the create button.
    But then the system asks me an Access Key to register, where can I get this?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    Ok I found the answer to my question in another thread
    Developer Key
    Make sure that your program names starts with "Z" or "Y", otherwise the system will ask you to register the object because it thinks you are creating/changing in the SAP namespace.
    In fact this was my error, my table name didn't start with neither "Z" nor "Y".
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on Nov 13, 2010 12:34 PM

  • I have Created new posting period but it assigns -1 in OFPR table

    I have created new posting period eg 2010 .with user manager but still there is value of -1 in usersign field of ofpr table
    i am getting confuse will you help me to rectify?
    Thanks for previous answer

    I have check our database and found out that all periods with usersign as -1 if they are not the periods belong to the first year.  It might be designed that way.
    Thanks,
    Gordon

  • When creating new table in sqllite db via Flex it become encoded as "utf-16le"

    Hi Guys
    I have some annoying problem with my AIR application
    The application is communicating with a local DB (sqllite).
    as part of initial installation I'm checking if the db exist.
    in case not then:
    I create one (file)
    create the relevent tables inside
    and populate them.
    For some reason, on the tables creation step the sqllite db become encoded as UTF-16le instead of UTF-8.
    The question is how can I make the tables creation step to leave the db as UTF-8
    thanks in advance for your help.
    This is my creation code
    the "connection" is from flash.data.SQLConnection type
    The "file" contain the following information
    <sql>
    <statement>
    CREATE TABLE IF NOT EXISTS MYTABLE
          MYTABLE_VERSION                NUMBER NOT NULL,
           MYTA|BLE_INSERT_DATE                 DATE NOT NULL
    </statement></sql>
    The below is the relevent code:
    var stream:FileStream = new FileStream();
                stream.open(file, FileMode.READ);
                var xml:XML = XML(stream.readUTFBytes(stream.bytesAvailable));
                stream.close();
                var statement:XML = null;
                try
                    connection.begin(lockType);
                    for each (statement in xml.statement)
                        var stmt:SQLStatement = new SQLStatement();
                        stmt.sqlConnection = connection;
                        stmt.text = statement;
                        stmt.execute();           
                } catch(err:Error)
                    connection.rollback();
                    throw err;
                connection.commit();

    It doesn't look like you're using DBSequence domain for the OrderLinesId attribute. If you are then you do not need to fill in the sequence as you've done in the create method.
    Getting back to create issue, You may want to set the 'order' id (foreign key) values before calling super and then call the getOrder() (or getXXX where XXX is the order accessor in this entity) method to verify if the order of the given ID exists/found in the cache.
    By the way, are you also using a similar create() in order with DBSequence as the type for the pK and you force a sequence value on top of it via setAttribute?
    Yes, this is the create method inside CrpOrderLinesImpl.java
    protected void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl s = new SequenceImpl("CRP_ORDER_LINES_ID_SEQ", getDBTransaction());
    setAttribute("OrderLinesId",s.getSequenceNumber());
    Thanks,
    Brad

Maybe you are looking for