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

Hi,

 

   Am trying to extract data from oracle into a dataset and append the data into Teradata .

since some of the native funtionality of teradata is not working when connecting to orcale.so ended up in pulling data to SAS and then upload to terdata.

 

proc sql;
connect to oracle (PATH=XXXX USER=XXXX PASSWORD="XXXX" PRESERVE_COMMENTS );
create table work.OracleTabExtract
as select * from
connection to oracle(
select /*+ parallel(16)*/ * from oracle.tablename 
) ;

 

i want to convert all columns present in the oracle table to character if its numeric.since the date columns are not getting loaded properly into teradata as its warning out.

is there any idea which i can include in the above step? the problem is i have more than 300 columns in the table

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
JBailey
Barite | Level 11

Hi @Saranya_Sub

 

It is possible to do this without landing the data in SAS. Adding a Teradata Parallel Transporter load to the create table could help with performance. DBTYPE= can help with the conversion. 

 

That being said, @LinusH is correct. 300 columns is a lot to deal with. The program to do this could be long.

View solution in original post

2 REPLIES 2
LinusH
Tourmaline | Level 20

First, 300 columns sounds like a bad data model, which will give trouble. And you are experiencing that right now. It gets very syntax intense.

Perhaps you don't need to convert all numerical columns. If you hit a SAS date limit on ly data/datetime columns need transformation.

If you already going through the trouble of writing explicit pass-through, just add cast() operations on the columns you wish to convert.

Reducing no lines code is done via macro in SAS. But since this is one time job, I think you'll won't save much time on creating such logic, so copy/paste I guess...

Data never sleeps
JBailey
Barite | Level 11

Hi @Saranya_Sub

 

It is possible to do this without landing the data in SAS. Adding a Teradata Parallel Transporter load to the create table could help with performance. DBTYPE= can help with the conversion. 

 

That being said, @LinusH is correct. 300 columns is a lot to deal with. The program to do this could be long.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1308 views
  • 2 likes
  • 3 in conversation