BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RDS2020
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Please try:

insert into ORA.TEST 

select datetime(), * from WORK.OUTPUT ;

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

Please try:

insert into ORA.TEST 

select datetime(), * from WORK.OUTPUT ;

RDS2020
Calcite | Level 5
Hi Chris,
Thanks for reverting quickly. What is the reason behind sysdate and today() to not work and datetime() to work.
Regards,
RDS
ChrisNZ
Tourmaline | Level 20

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.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2138 views
  • 0 likes
  • 2 in conversation