英文:
Inserting the SAS date value (mmddyy10.) to Oracle table
问题
I have a requirement where i need to insert date(mmddyy10.) from a dataset into the oracle table column(Date type). After executing the proc sql insert as shown below date inserted in oracle table are showing as '01/Jan/1960''
Sample :
oracle table : Test
column : close_date
date type : date
SAS data set: Test1
column : close_date
data type: mmddyy10.
proc sql; insert into test (close_date) select close_date from test1; quit;
Please let me know how to handle this issue.
我需要将数据集中的日期(mmddyy10.格式)插入到 Oracle 表的日期列中。在执行如下所示的 PROC SQL 插入后,插入到 Oracle 表中的日期显示为 '01/Jan/1960'。
示例:
Oracle 表:Test
列:close_date
日期类型:date
SAS 数据集:Test1
列:close_date
数据类型:mmddyy10.
proc sql; insert into test (close_date) select close_date from test1; quit;
请告诉我如何处理这个问题。
英文:
I have a requirement where i need to insert date(mmddyy10.) from a dataset into the oracle table column(Date type). After executing the proc sql insert as shown below date inserted in oracle table are showing as '01/Jan/1960'
Sample :
oracle table : Test
column : close_date
date type : date
SAS data set: Test1
column : close_date
data type: mmddyy10.
proc sql;
insert into test (close_date) select close_date from test1;
quit;
Please let me know how to handle this issue
答案1
得分: 0
尝试插入与您的日期相对应的日期时间
... DHMS(closedate,0,0,0) ...
尽管1960年1月1日也是SAS日期纪元的日期(即SAS日期是一个数字,表示自1960年1月1日以来的天数),所以您的数据集中可能会有一个0。
英文:
Try inserting datetime corresponding to your date
... DHMS(closedate,0,0,0) ...
Although 01-jan-1960 is also the date of SAS date epoch (i.e. a SAS date is a number. Then number of days since 01-jan-1960). So, you might have a 0 in your data set.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论