Installing the Oracle SCOTT schema for testing with Visual COBOL
I have installed Oracle 11g Express and Pro*COBOL precompiler to test this COBOL program with embedded SQL that uses the SCOTT schema:
EXEC SQL INCLUDE SQLCA END-EXEC
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 USERNAME PIC X(10).
01 PASSWD PIC X(10).
EXEC SQL END DECLARE SECTION END-EXEC.
MOVE "SCOTT" TO USERNAME
MOVE "TIGER" TO PASSWD
:USERNAME IDENTIFIED BY :PASSWD
However when I run my program I receive an error ORA-01017: invalid username/password; logon denied, what is wrong?
The SCOTT schema contains a number of tables that can be used for testing purposes, and needs to be installed.
The follow these steps to install the schema:
- Open a command prompt
- Change directory to C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin
this directory contains a number of SQL scripts including SCOTT.SQL
- Start SQLPlus as follows:
SQLPLUS /AS SYSDBA (this logs onto the database as SYSDBA in order to carry out some admin tasks :
Having successfully logged on, the SCOTT.SQL script needs to be run as follows:
Now check the tables exist by running the following query:
Now run the program again - successfully: