2 Replies - 826 Views - Last Post: 19 February 2009 - 07:07 AM Rate Topic: -----

#1 jpt420  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 38
  • Joined: 12-December 08

Create Table

Post icon  Posted 17 February 2009 - 10:25 PM

I am tring to create a new table and I get that error message and Im not sure why. That is exactly how it is in the book, can anyone tell me why I get this error?

SQL> CREATE TABLE tablename
  2  (columnname datatype [DEFAULT value],
  3  (columnname datatype [default value], ...);
(columnname datatype [DEFAULT value],
					 *
ERROR at line 2:
ORA-00907: missing right parenthesis


haha, nevermind I just needed to read the next page that is the syntax for creating a table, how do you delete a post?

Is This A Good Question/Topic? 0
  • +

Replies To: Create Table

#2 jpt420  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 38
  • Joined: 12-December 08

Re: Create Table

Posted 17 February 2009 - 10:32 PM

a real question now, why do I get an error? that is exactly how the example is in the book

 SQL> CREATE TABLE acctmanager
  2  (amid CHAR(4),
  3  amfirst VARCHAR2(12)
  4  amlast VARCHAR2(12)
  5  amedate DATE DEFAULT SYSDATE,
  6  region CHAR(2));
(amid CHAR(4),
*
ERROR at line 2:
ORA-00922: missing or invalid option

Was This Post Helpful? 0
  • +
  • -

#3 bruce779  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 18
  • Joined: 29-May 07

Re: Create Table

Posted 19 February 2009 - 07:07 AM

View Postjpt420, on 17 Feb, 2009 - 09:32 PM, said:

a real question now, why do I get an error? that is exactly how the example is in the book

 SQL> CREATE TABLE acctmanager
  2  (amid CHAR(4),
  3  amfirst VARCHAR2(12)
  4  amlast VARCHAR2(12)
  5  amedate DATE DEFAULT SYSDATE, 
  6  region CHAR(2));
(amid CHAR(4),
*
ERROR at line 2:
ORA-00922: missing or invalid option


You don't have any commas at the end of the amfirst or amlast declerations.
Also, I'm not sure if you can set a default on a date field, can't remember 100% ;)

This post has been edited by bruce779: 19 February 2009 - 07:09 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1