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.

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 2252 views
  • 0 likes
  • 2 in conversation