1

I am using Oracle Express 10g and I'm enter the following text to create 2 tables in the sql command line, but it is not working.

CREATE TABLE student (
    matric_no     VARCHAR2(8),
    first_name    VARCHAR2(20),
    last_name     VARCHAR2(20),
    date_of_birth DATE
);

CREATE TABLE student1 (
    matric_no     VARCHAR2(8),
    first_name    VARCHAR2(20),
    last_name     VARCHAR2(20),
    date_of_birth DATE
);

Can anyone see what I am doing wrong.

Thanks

6
  • "It's not working" is not a valid Oracle error message. Please post the full error message that you get. Commented Nov 3, 2011 at 21:57
  • Haha forgot ORA-00911: invalid character Commented Nov 3, 2011 at 22:03
  • The statements are fine (I copied them and ran them locally just to be sure). Did you copy & paste the SQL from somewhere? Maybe there are some invisible characters that make SQL*PLus choke. Commented Nov 3, 2011 at 22:11
  • I did but they both run individually fine Commented Nov 3, 2011 at 22:22
  • They work both for me - even if pasted in "one go". Commented Nov 3, 2011 at 22:34

2 Answers 2

1

By "command line" you probably mean the web application that comes with Oracle Express 10g. This application has several browser incompatibilities and is basically unable to execute several statements at once (also see Oracle 10g - invalid character on DB importing).

Either put your statements in a text file and upload them as a SQL script. Or switch to a better tool such as SQL Developer (downloadble from Oracle web site).

Sign up to request clarification or add additional context in comments.

Comments

0

Are you sure you didn't type this out in WORD?

Sometimes there are problems with "invisible" characters. For example if you hit TAB in WORD, it will store it as a special character which will thereby cause an error when you try running it in SQLPlus.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.