I have a bunch of SQL that I need to execute, but Oracle complains about this error:
Error Message : ORA-00911: invalid character
Position : 27
Statement : (dump below)
I am not sure what causes this. I tried removing the semicolon at the end, as some answers suggested, but this does not do the trick. I am trying to run this SQL dump on Laravel 5.2 using a method DB::unprepared()like:
DB::connection('oracle')->unprepared(File::get(base_path('/path/to/oracle_dump.sql')));
This is the SQL I'm trying to run:
DROP TABLE "MYUSERNAME"."POSTS";
DROP SEQUENCE "MYUSERNAME"."POST_SEQ";
CREATE TABLE POSTS
(
ID NUMBER(*, 0) NOT NULL, TITLE VARCHAR2(1000 BYTE), CONSTRAINT SYS_C004109 PRIMARY KEY(ID)
USING INDEX
(
CREATE UNIQUE INDEX SYS_C004109 ON POSTS (ID ASC)
LOGGING
TABLESPACE TEST_TABLSPACE
PCTFREE 10
INITRANS 2
STORAGE
(
INITIAL 65536
NEXT 1048576
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
)
NOPARALLEL
)
ENABLE
)
LOGGING
TABLESPACE TEST_TABLSPACE
PCTFREE 10
INITRANS 1
STORAGE
(
INITIAL 65536
NEXT 1048576
MINEXTENTS 1
MAXEXTENTS UNLIMITED
BUFFER_POOL DEFAULT
)
NOPARALLEL
CREATE SEQUENCE POST_SEQ INCREMENT BY 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 CACHE 20
CREATE TRIGGER POST_BIR
BEFORE INSERT ON posts
FOR EACH ROW
BEGIN
SELECT post_seq.NEXTVAL
INTO :new.id
FROM dual;
END;
I used SQLDeveloper on Mac to get this dump.
Any help on why this does not work and how it can be fixed will be appreciated.
source
share