Was hoping that this question
Getting Error - ORA-01858: a non-numeric character was found where a numeric was expected
Would provide an answer, however it seems like this scenario is different than what any of the answers cover.
I am making this table
CREATE TABLE Patients
(PatientID NUMBER(5) PRIMARY KEY,
FirstName CHAR(20) NOT NULL,
LastName CHAR(20) NOT NULL,
ZipCode NUMBER(5) NOT NULL,
City CHAR(20) NOT NULL ,
State CHAR(20) NOT NULL,
DOB DATE NOT NULL,
EmailAddress CHAR(30) NOT NULL,
PhoneNumber NUMBER(11) NOT NULL,
Comments VARCHAR(200));
and this sequence
CREATE SEQUENCE Pat_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NOCYCLE;
and then filling out the table with an insert of this format
INSERT INTO Patients VALUES
(Pat_seq.nextval,
'John',
'Smith',
'11277',
'Southampton',
'New York',
'10-Jan-1980',
'John.Smith@gmail.com',
'5555555555',
'No Comments');
This worked successfully in a SQL Plus Oracle server last night. I only have access to this server on my schools campus however, so to practice at home I requested a workspace through the Apex Oracle website.
When I attempt to run the insert statement on the Apex Workspace, I recieve the error in the title.
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "SYS.DBMS_SQL", line 1721
1. INSERT INTO Patients VALUES
2. (Pat_seq.nextval,
3. 'John',
From what I can tell, the error is being triggered because the sequence is conflicting with the PatientID being a Number datatype. My question is why?
This is the correct way to insert a sequence, no? It works fine in SQL Plus, so is this just a flaw of the Apex Oracle workspace?
EDIT:
To clarify: - I am using the Oracle APEX tool, version 19.2. I'm having trouble finding the documentation specifying the exact version of Oracle this uses.
- The exact same code worked last night using SQL Plus.