ORA-00907: missing right parenthesis showing again and again [closed] - sql

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 10 months ago.
Improve this question
Please help me to rectify the error, i have checked all the parenthesis.
CREATE TABLE employee
(
Fname varchar2(15),
Minit char(1),
Lname varchar(15) NOT NULL,
Ssn char(9) NOT NULL,
Bdate date(7),
Address varchar2(32),
Sex char(1),
Salary number(22),
Super_ssn char(9),
Dno number(22),
CONSTRAINT s_con PRIMARY KEY (Super_ssn)
);

Sql does not parameterize its DATE datatype. Thus use Bdate date instead of Bdate date(7).

Related

Manager " keyword not on a valid Position" [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
I have working on a project. i found that SQL code on internet. i have not familiar with SQL. anyone help me regarding this. I have facing difficulties to execute this query in SQL work bench after login as administration.
Line number 1, 4, 5 and 6 getting error. Please correct this code what things I need to correct or change.
create user reservation identified by manager;
grant dba to reservation;
commit;
connect reservation/manager;
create table admin6(uname varchar2(40) primary key,name varchar2(40),
pword varchar2(50),mail_id varchar2(60),phone_no varchar2(12));
create table train6(tr_no number(10) primary key,tr_name varchar2(70),
from_stn varchar2(20),to_stn varchar2(20),available number(5),fare number(5));
create table register(uname varchar2(40) primary key,pword varchar2(50),
fname varchar2(40),lname varchar2(40),
addr varchar2(100), phno varchar2(12), mailid varchar2(60));
insert into admin6 values('admin','admin','admin','admin#train.com','9874561230');
insert into admin6 values('shashi','shashi','admin','shashi#train.com','98323561230');
insert into train6 values(10101,'Jodhpur Exp','Howrah','Jodhpur',152,450);
insert into train6 values(10102,'Mumbai Mail','Gaya','Mumbai',182,650);
insert into register values('shashi','shashi','Shashi','Raj','Tekari, Gaya, Bihar',954745222,'shashiraj.972#gmail.com');
commit;

sql error while creating a table "ORA-00907: missing right parenthesis" [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I'm trying to create tables but an error is occurring at table ROUTE. I have no idea why. Can you point me the issue? thanks.
create table LOCATION (
airportCode VARCHAR2(10) not null,
country VARCHAR2(15) not null,
address VARCHAR2(50) not null,
PRIMARY KEY(airportCode));
create table ROUTE (
routeID VARCHAR2(10) not null,
airportCode VARCHAR2(10) not null,
description VARCHAR2(100) not null,
PRIMARY KEY(routeID, airportCode)
FOREIGN KEY(airportCode) REFERENCES LOCATION(airportCode));
This error is coming, ORA-00907: missing right parenthesis. all the parenthesis are correctly placed but still showing this error.
There is a , (comma) missing between PRIMARY KEY(routeID, airportCode)and FOREIGN KEY(airportCode)

I am trying to extract only date value from Oracle's SYSDATE but my query is giving me ORA-02290: check constraint violated [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I want to insert current date into my record, First I executed this query successfully.
insert into Member values (1, 'Richa Sharma', 'Pune', TO_DATE('10-Dec-05', 'DD-MM-YY'), 'Lifetime', '25000', 5, 50);
Then while executing the following query I'm getting the above error code.
insert into Member values (2, 'Garima Sen', 'Pune', SYSDATE, 'Annual', 100, 3, NULL);
EDIT: This is the query I used to create table.
create table Member (Member_Id number(5),
Member_Name varchar2(30),
Member_Address varchar2(50),
Acc_Open_Date date,
Membership_Type varchar2(20),
Fees_Paid number(6),
Max_Books_Allowed number(2),
Penalty_Amount number(7,2),
PRIMARY KEY(Member_Id),
CHECK (Membership_Type IN ('Lifetime',' Annual', 'Half Yearly',' Quarterly')));
Your check constraint has a leading space in ' Annual' change to 'Annual'

Error in Code Newbie to Sql [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
Can you please tell me what is wrong with the code
CREATE TABLE VISIT
PET_ID NUMBER (25),
VET_ID VARCHAR2(20),
VISIT_DATE DATE,
BASIC_COST NUMBER (8,2),
SYMPTOM VARCHAR2 (80),
TREATMENT VARCHAR2 (25),
);
First the opening bracket '(' is missing, ie CREATE TABLE VISIT ( .
Second ',' not required after the last column, ie TREATMENT VARCHAR2 (25).
CREATE TABLE VISIT (
PET_ID NUMBER (25),
VET_ID VARCHAR2(20),
VISIT_DATE DATE,
BASIC_COST NUMBER (8,2),
SYMPTOM VARCHAR2 (80),
TREATMENT VARCHAR2 (25)
);

INSERT INTO suppliers casue Schema Creation Failed: ORA-00922: missing or invalid option [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
What's causing this error?
Schema Creation Failed: ORA-00922: missing or invalid option
.........................
CREATE TABLE suppliers
(
sid int,
sname varchar(20),
address varchar(30)
)
CREATE TABLE product
(
pid int,
pname varchar(20),
color varchar(30)
)
CREATE TABLE catalog
(
sid int,
pid int,
cost int
)
INSERT INTO suppliers
(sid, sname,address)
VALUES
(1, "name1","address1"),
(2, "name2","address2");
SQL Fiddle
Also, your INSERT statement will probably fail in Oracle (though this is not the reason why you are getting ORA-00922)
Change it to:
INSERT ALL
INTO suppliers(sid, sname,address) VALUES (1, 'name1','address1')
INTO suppliers(sid, sname,address) VALUES (2, 'name2','address2')
SELECT * FROM dual;