This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Unable to create a table for Oracle using the Services\Databases window; (jdbc drivers) ORA-00904: invalid identifier - in other works the SQL it wants to run to generate the table is not valid oracle syntax.
Can you please describe the specific steps you took - usually this works fine. What was the name of the table, and the names and types of the columns? What modifiers (unique, null, etc.) did you apply to the columns?
Ok, this is weird I'm running it against and Oracle XE database - I think this is Oracle specific; the script runs perfect in sqlplus from the command line, e.g: bash> sqlplus user/pass @scriptname.sql ---START--- -- ----------------------------------- -- -- NOW returns the current system date -- -- ----------------------------------- -- DROP FUNCTION NOW; CREATE OR REPLACE FUNCTION NOW RETURN DATE IS ret DATE; BEGIN SELECT SYSDATE INTO ret FROM DUAL; RETURN ret; END; / -- ------------------------------------------ -- -- Table and sequence for the application log -- -- ------------------------------------------ -- DROP TABLE FND.log; DROP SEQUENCE FND.seq_log; CREATE TABLE FND.log ( ID INTEGER NOT NULL, stamp DATE DEFAULT SYSDATE, description VARCHAR2(80) NOT NULL, PRIMARY KEY(ID) ); CREATE SEQUENCE FND.seq_log START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE; CREATE OR REPLACE TRIGGER FND.trg_log BEFORE INSERT ON FND.log FOR EACH ROW BEGIN DECLARE lID INTEGER; BEGIN SELECT FND.seq_log.NEXTVAL INTO lID FROM DUAL; :NEW.ID := lID; END; END; / COMMIT; QUIT; ---END--- It creates the following results from the IDE: Executed successfully in 1.359 s, 0 rows affected. Line 9, column 1 Executed successfully in 0.382 s, 0 rows affected. Line 10, column 1 Error code 6550, SQL state 65000: ORA-06550: line 2, column 37: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ; Line 14, column 1 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 16, column 5 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 17, column 1 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 17, column 1 Executed successfully in 0.02 s, 0 rows affected. Line 24, column 1 Error code 955, SQL state 42000: ORA-00955: name is already used by an existing object Line 25, column 1 Executed successfully in 0.027 s, 0 rows affected. Line 31, column 1 Executed successfully in 0.338 s, 0 rows affected. Line 33, column 1 Error code 6550, SQL state 65000: ORA-06550: line 2, column 53: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ; Line 40, column 5 Error code 17439, SQL state 99999: Invalid SQL type Line 42, column 9 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 43, column 5 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 44, column 1 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 44, column 1 Error code 900, SQL state 42000: ORA-00900: invalid SQL statement Line 47, column 1 Execution finished after 2.126 s, 11 error(s) occurred.
The original error is caused by setting a primary key when trying to create the table; it's due to the Oracle specific syntax I think here - as you can see in the script... it also shows a sequence and trigger for Oracle; the combination of which creates a serial field for the table.
The problem is that you are trying to execute a trigger which has multiple statements that must be run as a single statement. By default NB executes each ';' delimited statement separately. As of just last week, I checked in a fix that allows you to work around this by changing the delimiter character: delimiter $$ // or whatever delimiter you want CREATE OR REPLACE TRIGGER FND.trg_log BEFORE INSERT ON FND.log FOR EACH ROW BEGIN DECLARE lID INTEGER; BEGIN SELECT FND.seq_log.NEXTVAL INTO lID FROM DUAL; :NEW.ID := lID; END; END$$ delimiter ;
Marking as incomplete, waiting to hear back whether the delimiter approach works.
No reply from reporter for a long time, so closing.