1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Cannot create table?

Discussion in 'Databases' started by nvidia, Jan 13, 2007.

  1. #1
    Hi i am trying to create a table called 'ITEM' with the following code:

    
    -- Creation of Item Table
    DROP TABLE ITEM CASCADE CONSTRAINTS;
    CREATE TABLE ITEM(
    ITEMID  NUMBER (6)      NOT NULL,
    
    
    
    );
    
    Code (markup):
    I'm executing using @table.sql and i get this error message
    
    SQL> @table.sql
    DROP TABLE ITEM CASCADE CONSTRAINTS
               *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    
    
    Input truncated to 2 characters
    unknown command ")" - rest of line ignored.
    
    Code (markup):
    After executing the script i should get a message saying' table created' but i don't. Bear in mind that i have not populated it. Should this affect it? It shouldn't should it?
     
    nvidia, Jan 13, 2007 IP
  2. The Stealthy One

    The Stealthy One Well-Known Member Affiliate Manager

    Messages:
    3,043
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Why do you have the first line dropping the table, if it hasn't even been created yet? That looks to be the problem. :)
     
    The Stealthy One, Jan 13, 2007 IP
  3. The Critic

    The Critic Peon

    Messages:
    392
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, remove the drop line or add an IF EXISTS condition.
     
    The Critic, Jan 13, 2007 IP
  4. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #4
    I think you can jsut click on the left side of the phpadmin where there will tables

    you should click on top where it will show no of tables like this (4)

    if you click on this it will ask for table name and the fields you can choose whatever you want and then press go

    thats it

    the table would be created
     
    Freewebspace, Jan 16, 2007 IP
  5. The Stealthy One

    The Stealthy One Well-Known Member Affiliate Manager

    Messages:
    3,043
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    105
    #5
    ^^^ But I think the OP would like to do this with a SQL command. :)
     
    The Stealthy One, Jan 17, 2007 IP