Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

SQL Plus syntax for adding a field to a table

  • 28-05-2007 03:57PM
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    How do I add a field to a table in sql plus on oracle?
    whats the correct syntax can Ive an example?

    Ive tried

    alter table tablename add(fieldname varchar2(25));

    It said table or view doesn't exist so am puzzled cos the tablename I used does exist.


Comments

  • Registered Users, Registered Users 2 Posts: 169 ✭✭DonnieBrasco


    sounds like a security issue

    try providing the schema name with the table name

    Alter SchemaName.TableName ...


  • Registered Users, Registered Users 2 Posts: 23,202 ✭✭✭✭Tom Dunne


    Yeah, are you sure you have permissions, because the syntax is correct.


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Its possible that the table you're referencing is owned by another user, and that you're avoiding having to supply the schema-name because of a public synonym.

    I think that in a case like ALTER TABLE, public synonyms won't be used so if its owned by another user, then you need to use schemaname.tablename as DonnieBrakso suggested.


  • Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭quinnd6


    Yep there was a different command I had to enter in order to edit the table cheers guys.


  • Closed Accounts Posts: 2,616 ✭✭✭8k2q1gfcz9s5d4


    are you in the correct database? that always gets me!


  • Advertisement
Advertisement