Home » SQL & PL/SQL » SQL & PL/SQL » create table
create table [message #207032] Mon, 04 December 2006 00:04 Go to next message
ashish_pass1
Messages: 114
Registered: August 2006
Location: delhi
Senior Member
hello all

i want to create a table but unable to predict where i had done
mistake.please go through my syntax & revert me back about my mistake.


ashish>create table batch_code(
  2  batch_code number c_pr_key_batch_code primary key,
  3  days date check('MWF', 'TTS'),
  4  time varchar2(15) check('9:30am-11:30am', '11:30am-1:30pm')
  5  );
create table batch_code(
                       *
ERROR at line 1:
ORA-00922: missing or invalid option


Elapsed: 00:00:00.00
ashish>ed
Wrote file afiedt.buf

  1  create table batch_code (
  2  batch_code number c_pr_key_batch_code primary key,
  3  days date check('MWF', 'TTS'),
  4  time varchar2(15) check('9:30am-11:30am', '11:30am-1:30pm')
  5* )
ashish>/
create table batch_code (
                        *
ERROR at line 1:
ORA-00922: missing or invalid option



with regards
ashish
Re: create table [message #207047 is a reply to message #207032] Mon, 04 December 2006 00:36 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
The way to find out what is wrong is NOT to post it here once you get the errormessage.
The best way to learn SQL (or anything for that matter) is to try to figure out where you go wrong.
Eliminate every single item from your create table statement until it gives no more errors. Then drop the table and start adding your items back until the error returns. Then you know where you went wrong.
This is called debugging, and it is a fundamental part of coding.

Please report back if you either found your error, or really really are stuck (but then you must show what you tried!)

Other posters: please help him by NOT providing the answer before he tried himself.
Re: create table [message #207080 is a reply to message #207032] Mon, 04 December 2006 01:56 Go to previous messageGo to next message
ashish_pass1
Messages: 114
Registered: August 2006
Location: delhi
Senior Member
thanks frank

but i had done those things before posting.
i kn it is the basic thing which i post but
i unable to understand why this bracket sign
giving error, same type of problem i solved
which worked well.

with regards
ashish
Re: create table [message #207087 is a reply to message #207080] Mon, 04 December 2006 02:10 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Did you get it to work now?
And where was the error?
(the error is not always, or even often not, exactly at the location indicated by Oracle)
Re: create table [message #207089 is a reply to message #207032] Mon, 04 December 2006 02:15 Go to previous message
ashish_pass1
Messages: 114
Registered: August 2006
Location: delhi
Senior Member
frank
i got the error..
sorry, very silly mistake i had done.
i will take care in future before posting.


thanks
Previous Topic: select random numbers /
Next Topic: how to query and find out selected data in text file
Goto Forum:
  


Current Time: Sun Dec 11 08:29:31 CST 2016

Total time taken to generate the page: 0.05154 seconds