0

I have a set of queries in Oracle which I need to run on a AWS redshift database.

My queries look like -

select tab1.col1, tab2.col2, tab3.col3...
From tab1,tab2,tab3
where tab1.col1=tab2.col1(+)
AND tab1.col1=tab3.col1(+)...

The queries are really big 700-900 lines and uses some oracle functions like TRUNC, XMLAGG, DECODE etc..

Which is the easiest way to convert these oracle queries to run on redshift ?

Thanks, Yatrik

user3258218
  • 71
  • 2
  • 7

2 Answers2

1

You want left outer join in any database:

select tab1.col1, tab2.col2, tab3.col3...
From tab1 left join 
     tab2
     on tab1.col1 = tab2.col1 left join
     tab3
     on tab1.col1 = tab3.col1;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
0

If your client/architecture team permits, you can use AWS SCT Schema conversion tool to convert your Oracle queries to Redshift compatible.

The functions or part of code which can't be converted will be highlighted for you to manually change them.

Read this: https://docs.aws.amazon.com/SchemaConversionTool/latest/userguide/CHAP_Converting.App.html

SwapSays
  • 407
  • 7
  • 18