0
SET TERMOUT ON
PROMPT Building Hotel tables.  Please wait.
--SET TERMOUT OFF

DROP TABLE BD;
DROP TABLE BR;
DROP TABLE D;
DROP TABLE R;

CREATE TABLE RT
    (TYPE VARCHAR2(11) NOT NULL,
    RATE NUMBER(6,2),
    CONSTRAINT roomtype_pk PRIMARY KEY(TYPE));

        INSERT INTO RT VALUES ('MAGNIFICENT', 200.00);

  ....



COMMIT;

Hey all, something strange about SQLPlus oracle sql statements to note here. I have a create.sql file which looks like the above snippet example, which builds my database tables. Contains both 'INSERT' and 'CREATE' statements. Today and yesterday its working fine on terminal, all tables being dropped and created as instructed. I leave home it being working fine and come home and execute start create.sql and apprently all tables does not exist!!!!

ERROR : 
ORA-00942: table or view does not exist

No matter what I do, restart computer, restart terminal, change file name... nothing works. No line has changed since leaving it working fine. Whats the issue. Note I do have foreign key constraints which are correctly integrated with tables. The same happened to my group member working on the same file. but different times.

Hoody
  • 2,942
  • 5
  • 28
  • 32
  • it does have COMMIT. Like in the original question I said it was executing but suddenly not anymore with no lines of code changes. – Hoody Mar 22 '13 at 00:52
  • Sorry about that. Seeing everything that's posted is not one of my strengths. – Dan Bracuk Mar 22 '13 at 00:53
  • Is the ORA-00942 the only error you get? And is it reported for a DROP or an INSERT? – Ed Gibbs Mar 22 '13 at 03:20
  • have you checked the tables exist in the schema? You see, your script will only work on the existing schema. If there are no tables in the schema (e.g. for a new schema) it will stop on the first `DROP TABLE` line. BTW, what happened with old good `CREATE OR REPLACE`. It is more efficient than DROP TABLE statement (http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9003.htm) – cha Mar 22 '13 at 03:24
  • Is this an exact replica of your script? If so, you've dropped four tables (bd, br, d & r) which haven't been re-created. The `ora-00942` will be on these tables. – Chris Saxon Mar 22 '13 at 13:40
  • ok, I've just found out its nothing to do with the code itself. at campus we all access oracle through a server and we all experienced the same problem. something back end not allowing it work. the following day the issue resolved itself. – Hoody Mar 23 '13 at 12:49

0 Answers0