I'm simply trying to create a table and I get this error saying ORA-00922. What's wrong with my code and is there a site where I can look at all ORA- errors?
CREATE TABLE customer ( cus_id NUMBER (6), cus_address VARCHAR2 (30) CONSTRAINT customer_cus_address_nn NOT NULL, cus_phone_Number VARCHAR2 (12) CONSTRAINT customer_cus_phone_number_nn NOT NULL, cus_lname VARCHAR2 (15) CONSTRAINT customer_cus_lname_nn NOT NULL, cus_f_name VARCHAR2 (15) customer_cus_fname, CONSTRAINT customer_cus_id_pk PRIMARY KEY (cus_id) ); (cus_id NUMBER(6), * ERROR at line 2: ORA-00922: missing or invalid option
Here are the steps I use in attacking problems like this:
- Apply the given error message to the given line.
Without looking anything up, try to see if there is something obviously wrong concerning an option at line 2 or the end of line 1. (If the error message does not locate the error exactly, then most often the error occurred immediately before the given line.) Unfortunately, this is one of those cases where the line number given in the error message is meaningless.
- Look up the error message
Do so using any of these sources:
- The documentation CD that came with the database installation disks. Ask your DBA to have this copied to your network or to let you borrow the disk.
- Oracle Technology Network. You can set up an account for free. Error messages are found under the database documentation.
- A printed Server Messages manual, available from Oracle Store. At $202 a copy, this is very expensive, even by computer book standards.
Dig Deeper on Using Oracle PL-SQL
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.