Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2014
    Posts
    1

    Unanswered: Reverse Engineering

    Hallo,
    I need help
    I have a Data Model on a Oracle Database.
    Now I want write a script that make this Text: (for example)
    PHP Code:
    create table test(
    test_id int NOT NULL,
    test_text varchar2(60NOT NULL,
    );
    INSERT INTO test (test_id,test_textVALUES (1,'test');

    create table test2(
    test2_id int NOT NULL,
    test2_text varchar2(60NOT NULL,
    test2_d Date,
    );
    INSERT INTO test2 (test2_id,test2_texttest2_dVALUES (1,'test2',TO_DATE('29.12.04''DD.MM.YY'));

    .....
    test3...test4....test5.... 
    Also I need all constraints.

    Does anyone have a solution?

    I only have this first script:
    PHP Code:
    FOR (All tables)
        
    select 'create table ' || table_name || ' ( ' from User_tables where table_name '###TABLE###';
        
        
    select COLUMN_NAMEDATA_TYPENULLABLE','
        
    from USER_TAB_COLUMNS 
        where TABLE_NAME 
    '###TABLE###';

        
    Select ')' from dual;
    END 
    With Google I found only very big complex scripts. (It must be a Script, a tool doesn't help)

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Oracle provides no utility to automatically create INSERT statements.
    if you wish to move table or schema data, then you should use expdp & impdp
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Also, if you use Google, you may find there are many ways to extract (reverse-engineer) an Oracle schema.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •