Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Posts
    63

    Question Unanswered: Creating new table in sql developer with table structure given in excel

    I have a new table structure having around 50 columns in an excel sheet with all the required parameters such as COLUMN NAME, DATA TYPE, NULLABLE, DATA DEFAULT, COLUMN ID AND COMMENTS. ( It is a table structure and not data . So import data option is not suitable for this requirement)

    I need to export this table structure into sql developer.
    Is there any means available to create this table without manually writing create table statement? Please clarify...

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Well, you could load that Excel file (saved as a CSV file) into a table (pre-create it, using Excel columns' labels as column names). Then write SQL which will write SQL for you, something like
    Code:
    select 'create table my_table (' ||
      t.column_name ||' '||
      t.data_type   ||' '||
      t.nullable    ||' '||
      ...           ||');'
    from your_excel_table
    Then just copy/paste created CREATE TABLE statement and execute it.

  3. #3
    Join Date
    May 2014
    Location
    World Wide On The Web
    Posts
    16
    Quote Originally Posted by prem18 View Post
    Is there any means available to create this table without manually writing create table statement? Please clarify...
    One readymade option is using Text to DDL in SQL Fiddle. If you have a table structure, the Text to DDL functionality will give generate the table DDL for you. Make sure you select correct database in the dropdown. And get rid of the double-quotation marks which is ridiculous.

    I find it easy while answering in forums, and I need to quickly create a test case based on OP's table structure.
    Regards,
    Lalit

  4. #4
    Join Date
    Apr 2007
    Posts
    63
    Thank you Littlefoot and Lalit!! I will try both the options as there are lot of tables to be created based on excel sheets

Tags for this Thread

Posting Permissions

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