Home:ALL Converter>Join (INNER JOIN) local Excel table in Oracle SQL Query - VBA

Join (INNER JOIN) local Excel table in Oracle SQL Query - VBA

Ask Time:2016-09-30T07:31:04         Author:Pedro Ferreira

Json Formatter

I'm having trouble performing a query on a remote Oracle SQL Server via Excel VBA while trying to perform an INNER JOIN in the same query with a local table in a Excel file sheet. Example:

  • Excel Sheet with local table ["LTE_Cells$LTE_Cells_Tmp"]:

Sheet "LTE_Cells"

Oracle SQL Query

SELECT  a.STARTDATE, a.ENODEB, a.EUTRANCELLFDD, (a.COUNTER_1/8/1024)+
a.COUNTER2/8/1024) AS Total_Total_Traffic_TB FROM »»»LOCAL_EXCEL_TABLE«««« 
INNER JOIN REMOTE_DATABASE.LTE_KPI_1 a ON  
((»»»LOCAL_EXCEL_TABLE««««.EUTRANCELLFDD = 
REMOTE_DATABASE.LTE_KPI_1.EUTRANCELLFDD) AND  
(»»»LOCAL_EXCEL_TABLE««««.ENODEB = REMOTE_DATABASE.LTE_KPI_1.ENODEB)) WHERE 
(((REMOTE_DATABASE.LTE_KPI_1.STARTDATE)>=sysdate-3));`

Thanks in advance for the help!

Author:Pedro Ferreira,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39781551/join-inner-join-local-excel-table-in-oracle-sql-query-vba
yy