2015-11-22 77 views
0

請指教!新建SQL ...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'); 
+0

這與以前不一樣。你的問題到底是什麼?請詳細說明,不要只顯示你的錯誤。 – davejal

+0

哦,那很好。所以......你問了很多問題,但還沒有接受任何答案。這個網站是雙向的。如果你期望得到幫助,你應該通過接受他們的回答來獎勵那些幫助你的人。閱讀http://meta.stackexchange.com/q/5234/308249?並開始回饋社區。 – davejal

回答

1
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 -> 

這是你現在擁有的。您缺少1個值。

+0

謝謝你的幫助。解決了。然後我遇到了我在我的頁面上編輯的下一個錯誤,因爲我無法每超過90分鐘發佈一個以上的錯誤。 – Starbucks

+0

[This](http://stackoverflow.com/questions/13518506/oracle-literal-does -not-match-format-string-error)應該有所幫助。基本上,日期變量需要不同的格式。考慮使用'to_date('2010-01-01','YYYY-MM-DD')' – klippix

1

由於錯誤已經指出。您沒有足夠的值要插入。

我覺得這些smoker, specialneeds, comments的一個不具有價值

無論是從您的查詢刪除或該字段添加值。

+0

謝謝你的幫助。解決了。然後我遇到了我在我的頁面上編輯的下一個錯誤,因爲我無法每超過90分鐘發佈一個以上的錯誤。 – Starbucks

+0

您應該接受答案,然後提出一個新問題。 – davejal