SQL Error: ORA-01861: littérale ne correspond pas au format de la chaîne de 01861

Je suis en train d'essayer d'insérer des données dans une table existante et continuez à recevoir une erreur.

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
);

Erreur:

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.

Juste ne sais pas pourquoi ça arrive tout le temps je suis l'apprentissage du SQL pour le moment, toute aide sera grandement appréciée!

  • pouvons-nous voir votre structure de la table? Je soupçonne que c'est les numéros de téléphone qui sont VARCHAR2 ou quelque chose et que vous êtes de les insérer comme NUMBER
  • CRÉER la TABLE Patient ( PatientNo CHAR(5) not NULL PRIMARY KEY, InvoiceNo CHAR(5) not NULL, PatientFirstName VARCHAR2(20) not NULL, PatientLastName VARCHAR2(20) not NULL, PatientStreetAddress VARCHAR2(40) not NULL, PatientTown VARCHAR2(20), PatientCounty VARCHAR2(20), PatientPostcode VARCHAR2(8) not NULL, date de naissance DATE not NULL, Sexe CHAR(1) CONTRAINTE pat_g_nn PAS NULL, PatientHomeTelephoneNumber VARCHAR2(11) CONTRAINTE pat_phtn_nn );
  • Je parie que c'est la DOB colonne. Si c'est le cas, essayez d'utiliser le TO_DATE fonction pour analyser la chaîne de date '1989-12-09' correctement.
  • PatientHomeTelephoneNumber est varchar2, vous êtes à l'insérer en tant que NUMBER, il doit être entouré par des '' et je ne vois pas PatientMobileTelephoneNumber dans votre instruction create.
InformationsquelleAutor LizzyPooh | 2014-03-20