0

I want to get data from multiple databases in Django ORM

Select em.EMPLOYEEID_N, tran.TRANSFERID_N,dep.HRDEPT_ID_V as HRDEPT_ID_V, dep.ACCOUNTSDEPT_ID_V as ACCOUNTSDEPT_ID_V, dep.ADMINDEPT_ID_V as ADMINDEPT_ID_V, dep.ITDEPT_ID_V as ITDEPT_ID_V,NVL(chk.HR_DPT,'N') HR_DPT, NVL(chk.ACCOUNTS_DPT,'N') ACCOUNTS_DPT , NVL(chk.ADMIN_DPT,'N') ADMIN_DPT , NVL(chk.IT_DPT,'N') IT_DPT, dep.RECIEVINGACCOUNTSDEPT_ID_V, NVL(dep.RECIEVINGACCOUNTSCHECK,'N') RECACCOUNTS_DPT, hr.UNITID_N USRUNITID,DEP.UNITID_N TFRUNITID From PYR_EMM_EMPLOYEEMASTER em,PYR_EMM_TRANSFERINOUTSTATUS tran,PYR_EMM_TRANSFERADV_CHECKLIST chk,PYR_EMM_TA_DEPTALERT dep, PYR_EMM_EMPLOYEEMASTER hr Where em.EMPLOYEEID_N = tran.EMPLOYEEID_N and tran.TRANSFERID_N = chk.TRANSFERID_N and tran.EMPLOYEEID_N = chk.EMPLOYEEID_N and tran.TRANSFERID_N = dep.TRANSFERID_N and tran.EMPLOYEEID_N = dep.EMPLOYEEID_N and hr.ACTDIRUSERNAME_V = 'ithd.ggn' and chk.UNITID_N = dep.UNITID_N and (dep.HRDEPT_ID_V = 'ithd.ggn'||'@bilt.com' or dep.ACCOUNTSDEPT_ID_V = 'ithd.ggn'||'@bilt.com' or dep.ADMINDEPT_ID_V = 'ithd.ggn'||'@bilt.com' or dep.ITDEPT_ID_V = 'ithd.ggn'||'@bilt.com' or dep.RECIEVINGACCOUNTSDEPT_ID_V = 'ithd.ggn'||'@bilt.com')

  • Read the docs, implement it, and ask a question if you face any specific issue. As it stands now, you haven't told us about any problem you're facing, so this question should be closed. – dirkgroten Aug 19 at 8:20
  • Thankyou dirkgroten actually I'm confused in multi database-related query – Aman Modi Aug 21 at 4:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.