感谢上一个回答我能够解决问题,现在将值插入到我的表中。但是我对以下内容有点问题;
CREATE TABLE RENTALAGREEMENT
( RENTAGREE_NUM NUMBER,
MEM_ID NUMBER,
STF_ID NUMBER,
ECAR_ID NUMBER,
ISSUE_DATE DATE,
RETURN_DATE DATE,
ACTUAL_RETURN DATE,
RENTAL_AMOUNT NUMBER,
LATE_RETURN_CHARGE NUMBER,
CONSTRAINT RENTAGREE_PK PRIMARY KEY (RENTAGREE_NUM),
CONSTRAINT RENTAGREE_FK1 FOREIGN KEY (MEM_ID) REFERENCES MEMBER,
CONSTRAINT RENTAGREE_FK2 FOREIGN KEY (STF_ID) REFERENCES STAFF,
CONSTRAINT RENTAGREE_FK3 FOREIGN KEY (ECAR_ID) REFERENCES ECAR
)
/ 我试图插入以下值
Insert into rentalagreement
values(001,'1001','201','300',21/04/2013,('dd/mm/yyyy'),22/04/2013,
('dd/mm/yyyy'),22/04/2013,('dd/mm/yyyy'),'80','null')
/
但是我一直得到太多的值语法错误。请任何人帮助我
谢谢
答案 0 :(得分:7)
可能你应该写
to_date('21/04/2013','dd/mm/yyyy')
而不是
21/04/2013,('dd/mm/yyyy')
所以这可能会起作用:
Insert into rentalagreement
values(001,1001,201,300,to_date('21/04/2013','dd/mm/yyyy'),to_date('22/04/2013',
'dd/mm/yyyy'),to_date('22/04/2013','dd/mm/yyyy'),80,null)
答案 1 :(得分:2)
试试这个
Insert into rentalagreement
values(001,'1001','201','300',to_date('21/04/2013','dd/mm/yyyy'),to_date('24/04/2013','dd/mm/yyyy'),to_date('22/04/2013','dd/mm/yyyy'),'80',null)