Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Convert SQL Server Query to Oracle query

Author  Topic 

zwheeler
Starting Member

25 Posts

Posted - 2012-06-27 : 10:43:54
Hi our oracle developer is out for the rest of the week and i need to convert a sql server query to an oracle query. Any help would be greatly appreciated.

<code>

update stg_property
set tag_fama_score = pa.tag_fama_score,
cat_fama_score_color = pa.cat_fama_score_color
from stg_property p
inner join oe_mf_data_mart..mf_loan_perf_quartly_panel Pa
on p.pk_property_id = pa.fk_property_id
and
--Bring back Maximum Year
Pa.fk_fiscal_year = (select max(qp0.fk_fiscal_year) FROM oe_mf_data_mart..mf_loan_perf_quartly_panel qp0 WHERE qp0.fk_fha_number = pa.fk_fha_number )
--Bring back Maximum Quarter
AND Pa.fk_fiscal_quarter = (select max(qp1.fk_fiscal_quarter) FROM oe_mf_data_mart..mf_loan_perf_quartly_panel qp1 WHERE qp1.fk_fha_number = pa.fk_fha_number )


</code>

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2012-06-28 : 00:57:33
They're not that different. I suspect the trouble you'll have is here:
oe_mf_data_mart..mf_loan_perf_quartly_panel
which is looking at a different database. There is no direct comparison here, you will have to check your own implementation for this part. If it were me I'd be using a linked table. Take a look at the dependencies on that table and see if you can find a previously convered example. Nobody outside your organisation will be able to help you with that I'm afraid.
The rest of it should just work.
Go to Top of Page

prett
Posting Yak Master

212 Posts

Posted - 2012-06-28 : 02:35:04
You can use the 'Translation Scratch Editor' in SQL*Developer to translate SQL Server statements to Oracle.
SQL*Developer is free of cost & you can download it from here:

http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html

After installation start it up after that:
'Tools'>>'Migration'>>'Translation Scratch Editor'
Go to Top of Page

zwheeler
Starting Member

25 Posts

Posted - 2012-06-28 : 16:55:11
thank you

i just used the translation scratch editor.
will test results tomorrow.
Go to Top of Page

granuharmot
Starting Member

31 Posts

Posted - 2014-09-23 : 05:22:58
unspammed
Go to Top of Page
   

- Advertisement -