Add Query Layer - Pivot Table from Oracle Database

516
1
10-09-2017 03:11 PM
ModernElectric
Occasional Contributor III

I am working on importing a bunch of data from our Oracle Database into a File Geodatabase. The way it is set-up in the Oracle database is not how I need it in GIS. I understand I can take the data and manipulate it like you can in Microsoft Excel - by creating a Pivot table and that is exactly what I am trying to do with building a SQL query in ArcMap. 

Right now, I have this SQL Query:

select *
from
(
select ACCOUNTNO, VALUE, PHONE_TYPE
from ATSCBS.PHONE_NUMBERS
) src
pivot
(
MAX(VALUE)
for PHONE_TYPE in ('Home' as HOME_PHONE, 'Cellular' as MOBILE_PHONE, 'Business' as BUSINESS_PHONE, 'Pager' as PAGER, 'E-Mail' as EMAIL, 'Fax' as FAX_NUMBER)
) piv
order by ACCOUNTNO

It validates just fine however, when I open the table I get this error.

Any advice would be great.

Thank You

Tags (1)
0 Kudos
1 Reply
AlexandraDubovis2
New Contributor III

Hi, Did you ever figure out? I am trying to create a query layer from our Oracle database and getting the same error.

Thanks,

Alex

0 Kudos