I am executing the following query, but it is inserting partial value of first field, i.e 95362 instead of 95362-07
Insertion query::
INSERT INTO ACCIDENT VALUES(95362-07,'Orthoptic education on visual ergonomics','Orthoptic education on visual ergonomics');
Getting values in the table ::
95362,Orthoptic education on visual ergonomics,Orthoptic education on visual ergonomics.
Table structure:
desc accident
Name Null Type
--------------------------------------------------
ID NUMBER
ACC_NAME VARCHAR2(4000)
ACC_DESC VARCHAR2(4000)
Here’s the problem, your first column is expecting a data type of
NumberAnd then, when you insert your query, the first parameter is being computed only the NUMBER part of it, which is
95362.To store your ID records in the form
XXXXX-XXyou must change yourIDcolumn to aVARCHAR2data type. Otherwise you’ll keep getting this result.I hope it helped. Cheers