I insert some value to sql Oracle.
My query in procedure is:
INSERT INTO CHAT_CUSTOMER(customerId, customerName, status, lastLogin, isAdmin)
VALUES (v_customerId, v_customerName, v_status, to_date(v_lastLogin, 'dd/MON/yyyy hh24:mi:ss'), v_isAdmin);
And I run my procedure:
V_CUSTOMERID := '111';
V_CUSTOMERNAME := 'AAA';
V_STATUS := 'Busy';
V_LASTLOGIN := '08/AUG/2015 21:02:44';
V_ISADMIN := '1';
Then I receive error:
ORA-01830: date format picture ends before converting entire input string
ORA-06512: at line 11
I have searched some topics relating to this, but those didn't solve my problem. I add "to_date" but it still doesn't work.
Is there anything wrong here? Please explain for me and help me to solve it.
You declared v_last_login as a date, then you are doing a to_date on it when you do the insert. Try and change it so that the declaration on v_last_login is a varchar2. Then see if it gives you the error still.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With