{
"code": 13,
"message": "org.postgresql.util.PSQLException: ERROR: syntax error at or near \"AND\"\n Position: 146",
"details": []
}
After this changes
Convert this sql
SELECT
C_ElementValue.C_ElementValue_ID,NULL,
COALESCE(C_ElementValue.Name,'-1'),
C_ElementValue.IsActive, C_ElementValue.UUID
FROM C_ElementValue
WHERE
C_ElementValue.IsActive='Y'
AND C_ElementValue.IsSummary='N'
AND C_ElementValue.C_Element_ID IN (
SELECT C_Element_ID
FROM C_AcctSchema_Element ase
WHERE ase.ElementType='U4'
AND ase.AD_Client_ID=1000001
)
AND C_ElementValue.C_ElementValue_ID=1000328
To sql
SELECT
C_ElementValue.C_ElementValue_ID,NULL,
COALESCE(C_ElementValue.Name,'-1'),
C_ElementValue.IsActive, C_ElementValue.UUID
FROM C_ElementValue
WHERE
AND C_ElementValue.IsSummary='N'
AND C_ElementValue.C_Element_ID IN (
SELECT C_Element_ID
FROM C_AcctSchema_Element ase
WHERE ase.ElementType='U4'
AND ase.AD_Client_ID=1000001
)
AND C_ElementValue.C_ElementValue_ID=1000328
Before this changes
SELECT
C_ElementValue.C_ElementValue_ID,NULL,
COALESCE(C_ElementValue.Name,'-1'),
C_ElementValue.IsActive, C_ElementValue.UUID
FROM C_ElementValue
WHERE
1=1
AND C_ElementValue.IsSummary='N'
AND C_ElementValue.C_Element_ID IN (
SELECT C_Element_ID
FROM C_AcctSchema_Element ase
WHERE ase.ElementType='U4'
AND ase.AD_Client_ID=1000001
)
AND C_ElementValue.C_ElementValue_ID=1000328
Request
Response
After this changes
Convert this sql
To sql
Before this changes
Additional context
fixes https://github.com/solop-develop/frontend-core/issues/2731