Hi,
I am trying to read one of the Teradata table DATE and DATETIME column values into SAS and then need to load into the ORACLE table DATE and DATETIMETSMAP columns.
I am trying as below.
proc sql;
connect to teradata(&myconnections.);
create table src1 as select * from connection to teradata (select dt1,dt_ts1 from tab1);
quit;
proc print data=src1;run;
dt1 dt_ts1
16JUN2023 16JUN2023:06:41:05.655255
Also below are proc contents output.
# Variable Type Len Format Informat
1 dt1 Num 8 DATE9. DATE9.
2 dt_ts1 Num 8 DATETIME26.6 DATETIME26.6
Could you please help me how can I load above two date values into Oracle table with data types: DATE and TIMESTAMP(6). Thank you so much In advance.
Example of what you tried.
It should work normally.
libname td teradata ..... ;
proc sql;
insert into td.td_table (date,datetime)
select date,datetime
from saslib.sas_dataset
;
quit;
Have a read of Data Types for Oracle
If you want full control what data types you get in the Oracle table - i.e. not just TIMESTAMP but TIMESTAMP(6) then use explicit SQL passthrough and create the Oracle table explicitly before loading into it.
According to the Oracle documentation the default for TIMESTAMP is TIMESTAMP(6) so you should be fine even if leaving the job to SAS.
The SAS docu states for automatic conversion "any date, time,....format...": In my experience with no more current releases of SAS things didn't work as expected with formats other than Date and DateTime. But may-be that's fixed now.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.