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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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