Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

remove trailing zeros from a timestamp when inserting into Oracle SQL

nad KhaMay 28 2025

Using sqlpldevveloper Version 22.2.1.234… oracle dbase "Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0"

I get a data result for a timestamp column 28-MAR-15 14.30.00.000000000 I need just 14:30.

Relatively new to oracle (actually coming back to it after decades)..Trying to insert into a simple table where AppointTime has a dataype of timestamp using the following insert

insert into CandidateAppointment2 values (1,DATE '2015-03-28',to_timestamp(TO_CHAR('YYYY-MM-DD HH24:MI:SS.FF', 'YYYY-MM-DD HH24:MI:SS.FF')),'Bellfields','Y','Y',15000);

getting error -

Error starting at line : 11 in command -
insert into CandidateAppointment2 values (1,DATE '2015-03-28',to_timestamp(TO_CHAR('YYYY-MM-DD HH24:MI:SS.FF', 'YYYY-MM-DD HH24:MI:SS.FF')),'Bellfields','Y','Y',15000)
Error report -
ORA-01722: invalid number

What am I blindly missing?

Comments
Post Details
Added on May 28 2025
5 comments
317 views