Hello everyone!
I’m having trouble to create a quick report. I’m having an error message saying that my SQL expression is wrong, even though it runs on PLSQL developer and it runs on the SQL query tool.
I even created an IAL, that works on both methods I’ve mentioned, exepct when I try to save it as a quick report
Here is the query I’m trying to save as a quick report:
SELECT FUR.IDENTITY AS USUARIO,
UF.COMPANY AS EMPRESA,
UGMF.USER_GROUP AS GRUPO_USUARIO,
CASE
WHEN UGMF.USER_GROUP = 'AC' THEN
'FINANCEIRO'
WHEN UGMF.USER_GROUP = 'CB' THEN
'CONTABILIDADE'
WHEN UGMF.USER_GROUP = 'FS' THEN
'FISCAL'
WHEN UGMF.USER_GROUP = 'FT' THEN
'FATURAMENTO'
WHEN UGMF.USER_GROUP = 'GR' THEN
'GERAL'
WHEN UGMF.USER_GROUP = 'LG' THEN
'LOGISTICA'
WHEN UGMF.USER_GROUP = 'TR' THEN
'TESOURARIA'
WHEN UGMF.USER_GROUP = 'YE' THEN
'FECHAMENTO ANUAL'
END DESCRICAO_GRUPO_USUARIO,
CASE
WHEN GLU.AUTH_CLASS IS NULL THEN
'SEM PERMISSÃO'
ELSE
'CLASSE DE AUTORIDADE MAX'
END FUNCAO_CONTABILIDADE,
CASE
WHEN OC.AUTHORIZE_CODE IS NOT NULL THEN
'COORDENADOR'
WHEN OC.AUTHORIZE_CODE IS NULL THEN
'SEM PERMISSÃO'
END FUNCAO_ESTOQUE_DISTRIBUICAO_GERAL,
CASE
WHEN (PB.BUYER_CODE IS NOT NULL AND PR.REQUISITIONER_CODE IS NOT NULL AND QCA.QC_CODE IS NOT NULL) THEN
'COMPRADOR - REQUISITANTE - CONTROLE DE QUALIDADE'
WHEN (PB.BUYER_CODE IS NOT NULL AND QCA.QC_CODE IS NOT NULL) THEN
'COMPRADOR - CONTROLE DE QUALIDADE'
WHEN (PR.REQUISITIONER_CODE IS NOT NULL AND QCA.QC_CODE IS NOT NULL) THEN
'REQUISITANTE - CONTROLE DE QUALIDADE'
WHEN (PB.BUYER_CODE IS NOT NULL AND PR.REQUISITIONER_CODE IS NOT NULL) THEN
'COMPRADOR - REQUISITANTE'
WHEN PB.BUYER_CODE IS NOT NULL THEN
'COMPRADOR'
WHEN PR.REQUISITIONER_CODE IS NOT NULL THEN
'REQUISITANTE'
WHEN QCA.QC_CODE IS NOT NULL THEN
'CONTROLE DE QUALIDADE'
ELSE
'SEM PERMISSÃO'
END FUNCAO_COMPRAS,
CASE
WHEN IPP.BUYER_CODE IS NOT NULL THEN
'PLANEJADOR'
ELSE
'SEM PERMISSÃO'
END FUNCAO_ESTOQUE,
CASE
WHEN SPS.SALESMAN_CODE IS NOT NULL THEN
'VENDEDOR'
ELSE
'SEM PERMISSÃO'
END FUNCAO_ORDEM_DE_VENDA,
CASE
WHEN PA.AUTHORIZER_ID IS NOT NULL THEN
'AUTORIZADOR CONTAB TÍTULO'
ELSE
'SEM PERMISSÃO'
END FUNCAO_TITULO_DO_FORNECEDOR,
CASE
WHEN CAU.CREDIT_ANALYST_CODE = 'MA' THEN
'GERENTE DE CRÉDITO'
WHEN CAU.CREDIT_ANALYST_CODE = 'CA' THEN
'ANALISTA DE CRÉDITO'
ELSE
'SEM PERMISSÃO'
END FUNCAO_GERENCIAMENTO_DE_CREDITO,
CASE
WHEN IFSGFT.SUPPORT_PERSON_API.Is_Support_User(FUR.IDENTITY) = 'TRUE' THEN
'USUÁRIO DE SUPORTE'
ELSE
'SEM PERMISSÃO'
END FUNCAO_CENTRO_DE_SUPORTE,
CASE
WHEN CE.COST_ESTIMATOR_ID IS NOT NULL THEN
'ESTIMADOR DE CUSTO'
ELSE
'SEM PERMISSÃO'
END FUNCAO_CUSTO,
CASE
WHEN ME.MANUF_ENGINEER_CODE IS NOT NULL THEN
'ENGENHEIRO DE MANUFATURA'
ELSE
'SEM PERMISSÃO'
END FUNCAO_MANUFATURA,
FUR.ROLE AS CONJ_PERMISSAO
FROM IFSGFT.FND_USER_ROLE_TAB FUR
LEFT JOIN IFSGFT.USER_GROUP_MEMBER_FINANCE UGMF ON UGMF.USERID = FUR.IDENTITY
LEFT JOIN IFSGFT.USER_FINANCE UF ON UF.USERID = FUR.IDENTITY
LEFT JOIN IFSGFT.GEN_LED_USER GLU ON GLU.USERID = FUR.IDENTITY
AND GLU.COMPANY = UF.COMPANY
LEFT JOIN IFSGFT.ORDER_COORDINATOR OC ON OC.AUTHORIZE_CODE = FUR.IDENTITY
LEFT JOIN IFSGFT.PURCHASE_BUYER PB ON PB.BUYER_CODE = FUR.IDENTITY
LEFT JOIN IFSGFT.PURCHASE_REQUISITIONER PR ON PR.REQUISITIONER_CODE = FUR.IDENTITY
LEFT JOIN IFSGFT.QUALITY_CTRL_ANALYST QCA ON QCA.QC_CODE = FUR.IDENTITY
LEFT JOIN IFSGFT.INVENTORY_PART_PLANNER IPP ON IPP.BUYER_CODE = FUR.IDENTITY
LEFT JOIN IFSGFT.SALES_PART_SALESMAN SPS ON SPS.SALESMAN_CODE = FUR.IDENTITY
LEFT JOIN IFSGFT.POSTING_AUTHORIZER PA ON PA.COMPANY = UF.COMPANY
AND PA.AUTHORIZER_ID = FUR.IDENTITY
LEFT JOIN IFSGFT.CREDIT_ANALYST_USER CAU ON CAU.USERID = FUR.IDENTITY
AND CAU.COMPANY = UF.COMPANY
LEFT JOIN IFSGFT.COST_ESTIMATOR CE ON CE.COST_ESTIMATOR_ID = FUR.IDENTITY
LEFT JOIN IFSGFT.MANUF_ENGINEER ME ON ME.MANUF_ENGINEER_CODE = FUR.IDENTITY
Can anyone help me figuring out what is wrong?
Thanks!