Hi All,
I am trying to insert today's date into oracle table from SAS but getting error. How can we do this?
I am doing below:-
a.
PROC SQL ;
insert into ORA.test
Select
SYSDATE, OO.* from WORK.OUTPUT OO ;
QUIT;
Below is error i am getting:-
ERROR: The following columns were not found in the contributing tables: SYSDATE.
b.PROC SQL ;
insert into ORA.test
Select
today(), OO.* from WORK.OUTPUT OO ;
QUIT;
Below 2 things happen:-
1. Sometimes it shows error saying:- invalid character ( because of brackets in today() )
2.And sometimes it enter "01/JAN/60" date into the oracle table.
Thanks
RDS
Please try:
insert into ORA.TEST
select datetime(), * from WORK.OUTPUT ;
Please try:
insert into ORA.TEST
select datetime(), * from WORK.OUTPUT ;
sysdate is an oracle keyword,
date() returns a date. Oracle usually stores date times.
Dates count days. Datetimes count seconds. Search the topic if you are unaware.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.