0
votes

Please advise! New to SQL...

QL Error: ORA-01861: literal does not match format string

  1. 00000 - "literal does not match format string"

*Cause: Literals in the input must be the same length as literals in the format string (with the exception of leading whitespace). If the "FX" modifier has been toggled on, the literal must match exactly, with no extra whitespace.

*Action: Correct the format string to match the literal.

INSERT INTO STUDENT (Marticulationno, studentname, homeaddress, dob, sex, studentcategory, nationality, smoker, specialneeds, comments, enrollmentstatus, courses) 
VALUES ('1', 'Lemeuel Im', '101 Main Street TX 77070', '19800101', 'M', 'graduate', 'hindu', '0', 'na', 'none', 'enrolled', 'economics');
2
this is not the same error as before. What is your question exactly? And please elaborate more, don't show only your errors. - davejal
Oh, that's nice. So... you asked a lot of questions and have yet to accept any answers. This site goes both ways. If you expect help, you should reward those who help you by accepting their answer. Read meta.stackexchange.com/q/5234/308249? and start giving back to the community. - davejal

2 Answers

1
votes

As the error already states. You don't have enough values you want to insert.

I think one of these smoker, specialneeds, comments doesn't have a value

Either remove it from your query or add a value for that field.

1
votes
Marticulationno -> '1'
studentname ->  'Lemeuel Im'
homeaddress ->  '101 Main Street TX 77070'
dob ->  '19800101'
sex ->  'M'
studentcategory ->  'graduate'
nationality ->  'hindu'
smoker ->  '0'
specialneeds ->  'na'
comments ->  'enrolled'
enrollmentstatus ->  'economics'
courses ->

This is what you currently have. You are missing 1 value.