|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
VeriSign Code Signing Digital Certificates provides assurance to end users. Read about this and more in the free white paper: “How to Digitally Sign Downloadable Code for Secure Content Transfer.” Learn More! |
|
#1
|
|||
|
|||
|
Hi,
I am new to oracle database. I have already created one table and its working fine. Now I want to create another table and I get an error . here is the code: CREATE TABLE member( memberID integer, name NOT NULL VARCHAR2(40), home_address NOT NULL VARCHAR(255), delivery_address NOT NULL VARCHAR(255), phone NOT NULL NUMBER(38), creditcard NOT NULL NUMBER(38), expiry NOT NULL NUMBER(38), email NOT NULL VARCHAR(40), username UNIQUE NOT NULL VARCHAR(20), password NOT NULL VARCHAR(20), PRIMARY KEY(memberID) ); this is the error: SQL> unknown command beginning "memberID i..." - rest of line ignored. SQL> unknown command beginning "name NOT N..." - rest of line ignored. SQL> unknown command beginning "home_addre..." - rest of line ignored. SQL> unknown command beginning "delivery_a..." - rest of line ignored. For a list of known commands enter HELP and to leave enter EXIT. SQL> unknown command beginning "phone NOT ..." - rest of line ignored. SQL> unknown command beginning "creditcard..." - rest of line ignored. SQL> unknown command beginning "expiry NOT..." - rest of line ignored. SQL> unknown command beginning "email NOT ..." - rest of line ignored. For a list of known commands enter HELP and to leave enter EXIT. SQL> unknown command beginning "username U..." - rest of line ignored. SQL> unknown command beginning "password N..." - rest of line ignored. SQL> SQL> unknown command beginning "PRIMARY KE..." - rest of line ignored. I hope someone can tell me how to correct this error.. Thanks! ![]() |
|
#2
|
|||
|
|||
|
Please try:
CREATE TABLE member( memberID integer, name VARCHAR2(40) NOT NULL , home_address VARCHAR(255) NOT NULL , delivery_address VARCHAR(255) NOT NULL, phone NUMBER(38) NOT NULL, creditcard NUMBER(38) NOT NULL, expiry NUMBER(38) NOT NULL, email VARCHAR(40) NOT NULL, username VARCHAR(20) NOT NULL , password VARCHAR(20) NOT NULL, PRIMARY KEY(memberID), CONSTRAINT uq_username UNIQUE(username) ) |
|
#3
|
|||
|
|||
|
syntax error
CREATE TABLE member(
memberID integer, name VARCHAR2(40)NOT NULL , home_address VARCHAR(255) NOT NULL , delivery_address VARCHAR(255) NOT NULL , phone NUMBER(38) NOT NULL , creditcard NUMBER(38) NOT NULL , expiry NUMBER(38) NOT NULL , email VARCHAR(40) NOT NULL , username VARCHAR(20) NOT NULL UNIQUE , password VARCHAR(20)NOT NULL , PRIMARY KEY(memberID) ) The syntax for the create table was wrong.... rest all is fine just put the constraints at the end of the column creation statement ... so not null, unique, primary key etcetc will be at the end... hope this helps... |
|
#4
|
|||
|
|||
|
CREATE TABLE error explaination
Hi, Cresent;
UserID: 'rshekdar' is absolutely correct with his create table command. An explaination to your problem was mostly because of the line space that was used because that will cause the code to exit the buffer. Rod |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > oracle database create table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|