oracle - Date format while importing table in sql developer -
i trying import details csv file creating through bi publisher query table.
in query , have date formatted column:
effective_start_date 1951-01-01t00:00:00.000+00:00 1901-01-01t00:00:00.000+00:00
now when importing entire table in excel. how should import in sql developer in such way date format comes 'dd-mon-yyyy'
right few records date getting imprted in table null !
also targer column format not editable screen in sql devleoper
oracle setup:
create table test_load ( id int, effective_start_date date );
csv:
id,effective_start_date 1,1951-01-01t00:00:00.000+00:00 2,1901-01-01t00:00:00.000+00:00
import (sql developer 4.1.0.19):
- in connections panel, right-click on table name , choose "import data..."
- browse csv file click "next >".
- select "insert script" insert method , click "next >".
- click "next >" accept default selected columns.
- in column definitions,
effective_start_date
have warning triangle next , "data not compatible column definition...". change formatyyyy-mm-dd"t00:00:00.000+00:00"
click "next >" - click "finish"
- this should bring dialog saying "task successful , sent worksheet."
- optionally: find/replace on script replacing
to_date\(('.*?'), '.*?'\)
cast( to_timestamp_tz( $1, 'yyyy-mm-dd"t"hh24:mi:ss.fftzh:tzm' ) date )
, select regular expression option , "replace all". - run script (press
f5
).
output
select * test_load; id effective_start_date -- -------------------- 1 1951-01-01 00:00:00 2 1901-01-01 00:00:00
(the format of date depend on nls settings.)
Comments
Post a Comment