SQL Error ORA-01861 literal does not match format string 01861

0 votes

I am trying to insert data into an existing table and keep receiving an error.

INSERT INTO Patient  
(
  PatientNo,
  PatientFirstName,
  PatientLastName,
  PatientStreetAddress,
  PatientTown,
  PatientCounty,
  PatientPostcode,
  DOB,
  Gender,
  PatientHomeTelephoneNumber,
  PatientMobileTelephoneNumber
)
VALUES 
(
  121, 
  'Miles', 
  'Malone', 
  '64 Zoo Lane', 
  'Clapham', 
  'United Kingdom',
  'SW4 9LP',
  '1989-12-09',
  'M',
  02086950291,
  07498635200
);

Error:

Error starting at line : 1 in command -
INSERT INTO Patient (PatientNo,PatientFirstName,PatientLastName,PatientStreetAddress,PatientTown,PatientCounty,PatientPostcode,DOB,Gender,PatientHomeTelephoneNumber,PatientMobileTelephoneNumber)
VALUES (121, 'Miles', 'Malone', '64 Zoo Lane', 'Clapham', 'United Kingdom','SW4 9LP','1989-12-09','M',02086950291,07498635200)
Error report -
SQL Error: ORA-01861: literal does not match format string
01861. 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.

Just confused as to why this keeps occurring. I'm currently studying SQL, so any assistance would be highly appreciated!

Sep 12 in Database by Kithuzzz
• 12,240 points
81 views

1 answer to this question.

0 votes
Try replacing the string literal for date '1989-12-09' with TO_DATE('1989-12-09','YYYY-MM-DD').
answered Sep 13 by narikkadan
• 20,880 points

Related Questions In Database

0 votes
0 answers

SQL Error: ORA-00942 table or view does not exist

I'm using SQL Developer, and after creating ...READ MORE

Sep 4 in Database by Kithuzzz
• 12,240 points
35 views
0 votes
0 answers

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

I experimented with the following code in ...READ MORE

Aug 22 in Database by Kithuzzz
• 12,240 points
232 views
0 votes
1 answer
0 votes
1 answer

SQL error "ORA-01722: invalid number"

When an effort is made to convert ...READ MORE

answered Feb 15 in Database by Neha
• 8,920 points
846 views
0 votes
1 answer

Automating Oracle script with nolio

Depending upon the details of your script ...READ MORE

answered Jul 17, 2018 in Other DevOps Questions by ajs3033
• 7,280 points
360 views
0 votes
1 answer

Is there any boolean type in Oracle database?

Nope. I don't think there is one But ...READ MORE

answered Oct 10, 2018 in Database by Neha
• 6,300 points
325 views
0 votes
1 answer

Please name some online websites to compile and run PL/SQL?

For executing Oracle SQL queries and PL/SQL ...READ MORE

answered Feb 11 in Database by Neha
• 8,920 points
154 views
0 votes
1 answer

ORACLE LIVE SQL IMPORT CSV DATA (live oracle sql)

Convert CSV to SQL http://www.convertcsv.com/csv-to-sql.htm This programme may be ...READ MORE

answered Feb 11 in Database by Neha
• 8,920 points
3,207 views
0 votes
1 answer

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452) in sql 2008

Solution Go to Start > Programs > Microsoft SQL Server > Enterprise Manager. Right-click the SQL ...READ MORE

answered Sep 12 in Database by narikkadan
• 20,880 points
39 views
0 votes
1 answer

SQL Error: ORA-00922: missing or invalid option

The lack of an underscore between "chartered" ...READ MORE

answered Sep 15 in Database by narikkadan
• 20,880 points
64 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP