Home » SQL & PL/SQL » SQL & PL/SQL » How do I insert data and time into oracle with data datatype
How do I insert data and time into oracle with data datatype [message #2476] Fri, 19 July 2002 05:22 Go to next message
Mitesh
Messages: 7
Registered: July 2002
Junior Member
I am trying to insert the data and time into a date field through SQLPlus. But it gives me the following error:

ORA-01830: date format picture ends before converting entire input string

This is my insert statement:
insert into test10 values(23, 'VJ', '11-Jul-2002 21:21:21')
Here the third values is going to a date datatype.

Any clues...?

TIA
Mitesh
Re: How do I insert data and time into oracle with data datatype [message #2482 is a reply to message #2476] Fri, 19 July 2002 08:24 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> create table test10
  2  (id number,
  3  name varchar2(10),
  4  d date);

Table created.

SQL> insert into test10 values(23, 'VJ', '11-Jul-2002 21:21:21')
  2  ;
insert into test10 values(23, 'VJ', '11-Jul-2002 21:21:21')
                                    *
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string

SQL> alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';

Session altered.

SQL>  insert into test10 values(23, 'VJ', '11-Jul-2002 21:21:21');

1 row created.

SQL> select * from test10;

        ID NAME       D
---------- ---------- --------------------
        23 VJ         11-jul-2002 21:21:21
Previous Topic: Retrieving an entire table's rows, one row at a time.
Next Topic: How to write a select statement in cursor of PL/SQL
Goto Forum:
  


Current Time: Tue May 07 03:44:06 CDT 2024