I have a SAS dataset which holds todays date and datetime. My requirement here is to create SAS macro variables which hold the DATE and DATETIME values. And then Update those values in Oracle table. Could you please help me what formats I need to use to update date/timestamp values into Oracle table.
data customer;
input cust_id cust_login_dt cust_login_ts;
cust_id=100;
cust_login_dt=today(); /* Storing date values in SAS Format /
cust_login_ts=datetime(); / Storing datetime values in SAS Format */
run;
proc sql;
select cust_id,cust_login_dt ,cust_login_ts i
Into :custid,:custlgndt,:custlgnts
from customer;
quit;
/* Now I need to update above values in Oracle table using SQL Passthrough */
proc sql;
connect to oracle(user=xxx password=xxxx path=custora1);
execute (
upate cust_fact
set lgn_dt=&custlgndt,lgn_ts=&cuslgnts
where cust_id=&custid.
) by oracle;
execute(commit);
quit;
If I execute above query, Update query is failing with Invalid values to the input columns error.
Could you please help me to update SAS date and SAS Datetime values into Oracle table using SAS macro variables.
&custlgndta string, a number, or some proprietary date datatype? If a string, what format is it in (can you show a sample value)? What exactly is being will determine what you need to do to update a date column in Oracle.