Gossamer Forum
Home : Products : DBMan SQL : Discussion :

[HELP!] how to insert time in to_date?

Quote Reply
[HELP!] how to insert time in to_date?
I'm a beginner on using SQL developer and i got stuck inserting time on the table...
I want to insert data into a consultation table.

CREATE TABLE CONSULTATION (
ConsultationNum INTEGER NOT NULL ,
PatientNum INTEGER NOT NULL ,
ConsultationDate DATE NOT NULL ,
ScheduledStartTime DATE NOT NULL ,
ActualStartTime DATE ,
ActualEndTime DATE ,
CONSTRAINT pk_cosultation PRIMARY KEY(ConsultationNum),
CONSTRAINT fk_cosul_patient FOREIGN KEY(PatientNum)
REFERENCES PATIENT(PatientNum));

code:

INSERT INTO CONSULTATION
VALUES (CONSUL_ConsultationNum.nextval, PATIENT_PatientNum.nextval, to_date(('2-May-2008', '10:00:00', 'DD-MM-YYYY', 'HH:MI:SS'), ('10:05:00', '10:30:00', 'HH:MI:SS', 'HH:MI:SS');

when i run it, error msg shown if not "missing right parenthesis" or "Missing IN or OUT parameter at index 1"

do you have any ideas about this?

Thanks