Problem whith my query sql in oracle

Hello everyone, I'm having difficulty getting my code to select data in the reports, specifically the 'Conta'(Account) regarding the FLEX_VALUE field.

cod01

SELECT 
GL_CODE_COMBINATIONS.SEGMENT1 AS Empresa,
GL_CODE_COMBINATIONS.SEGMENT3 AS Conta,
SUM(GL_JE_LINES.ACCOUNTED_DR) AS DR_Contabilizado
FROM 
GL_JE_HEADERS
JOIN GL_JE_LINES ON GL_JE_HEADERS.JE_HEADER_ID = GL_JE_LINES.JE_HEADER_ID
JOIN GL_CODE_COMBINATIONS ON GL_JE_LINES.CODE_COMBINATION_ID = GL_CODE_COMBINATIONS.CODE_COMBINATION_ID
JOIN gl_je_batches ON gl_je_batches.je_batch_id = GL_JE_HEADERS.je_batch_id
JOIN GL_LEDGERS ON GL_LEDGERS.LEDGER_ID = GL_JE_HEADERS.LEDGER_ID
WHERE 
GL_JE_HEADERS.default_effective_date >= '2024-01-01'
AND GL_JE_HEADERS.default_effective_date <= '2024-01-31'
and GL_JE_HEADERS.PERIOD_NAME <> '01_Jan-24'
AND GL_LEDGERS.NAME = 'PE_COA PE'
GROUP BY 
GL_CODE_COMBINATIONS.SEGMENT1,
GL_CODE_COMBINATIONS.SEGMENT3
ORDER BY 
GL_CODE_COMBINATIONS.SEGMENT3

cod02

SELECT A.FLEX_VALUE,C.DESCRIPTION
        FROM   FND_FLEX_VALUE_SETS   B,
               FND_FLEX_VALUES       A,
               FND_FLEX_VALUES_TL    C  
        WHERE  B.FLEX_VALUE_SET_NAME = 'CONTA PE_COA'
        AND    B.FLEX_VALUE_SET_ID   = A.FLEX_VALUE_SET_ID
        AND    A.ENABLED_FLAG        = 'Y'
        AND    A.FLEX_VALUE_ID       = C.FLEX_VALUE_ID  (+)
        AND    C.LANGUAGE            (+) = 'PTB'

The is a SQL Server site but the following will also apply for Oracle:

1 Like

There really should be an entire emotional/technical support community for Oracle EBS query writers.

Yes! they should reach out to there.