SoftwareSavant
SoftwareSavant

Reputation: 9747

How to enter in DateTime in Oracle

Some scope creep occured in the last couple of days and now I have to squeeze in date time. The Oracle stored procedure has a Date field (same with the table). Every time I try to enter in the date time value I get this refrain from the exception thrower:

ORA-01830: date format picture ends before converting entire input string
ORA-06512: at line 56

Here is what I try to enter:

SPECIALIST_APPT_DATETIMEIN := '09/Sep/1990 00:00:00'

Here is the param definition I try to squeeze it into:

PCP_APPOINTMENT_DATETIME`in `DATE`

Upvotes: 0

Views: 2511

Answers (1)

Justin Cave
Justin Cave

Reputation: 231711

It looks like you just need to use the TO_DATE function to convert the string to a date.

SPECIALIST_APPT_DATETIMEIN := to_date('09/Sep/1990 00:00:00', 
                                      'DD/MON/YYYY HH24:MI:SS' );

assuming that you intend to enter times in the 24-hour format (i.e. 17:30:00 for 5:30pm).

Upvotes: 2

Related Questions