Creating Multiple table in Oracle

2019-03-02 10:12发布

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

2条回答
\"骚年 ilove
2楼-- · 2019-03-02 10:48

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).

查看更多
Explosion°爆炸
3楼-- · 2019-03-02 10:52

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.

查看更多
登录 后发表回答