94
Views
13
Comments
Solved
Incorrect syntax near ...
Question
Application Type
Reactive
Service Studio Version
11.54.43 (Build 63110)

Hi.

Since following error, I'm not able to publish the application.

I would appreciate if you help me..

If you need anything to solve this problem, please tell me.

Thank you.


2023-11-20 06-53-17
Neha Rathore
Solution

Hi Seheon,

This is an aggregate query you cannot change that, you need to share the aggregate and the filter conditions that you are using.

Otherwise convert aggregate into SQL. 

https://success.outsystems.com/documentation/11/developing_an_application/use_data/query_data/sql_queries/

Best to share the OML. That will be helpful

Thanks

UserImage.jpg
Seheon Oh

Hi neha rathore


Thank you for your support.


I think this error is because of following filter.


When I remove above filter, error didn't occured.


best regards


2023-11-20 06-53-17
Neha Rathore

Oh great.. mark this as solution then 

Thanks

2025-01-09 14-56-57
IQ78

hi read this:

https://www.sqlshack.com/understanding-sql-server-case-statement/

and don't forget to put single quote if it is a text.


2026-02-26 06-29-24
Rahul
 
MVP

Hi @Seheon,

Can you provide an SQL statement here about what you are trying it? SO we can find where you have written wrong. 



UserImage.jpg
Seheon Oh

Hi Rahul

Thank you for your reply.

SQL statement is following


SELECT TOP (17) [ENTEAM].[ID] [ID], [ENTEAM].[NAME] [NAME], (CASE WHEN ([ENSHAREPOINT].[ID] IS NOT NULL) THEN 1 ELSE 0 END) [SHAREBOOL], [ENSHAREPOINT].[ID] [SHAREPOINTID]

FROM ([OSDEV1].dbo.[OSSYS_GROUP_T20] [ENTEAM]

    FULL JOIN [OSDEV1].dbo.[OSUSR_4MS_SHAREPOINT] [ENSHAREPOINT] ON ([ENTEAM].[ID] = [ENSHAREPOINT].[TEAMID])) 

WHERE (([ENSHAREPOINT].[TYPE] = N'SkillUp')

    AND ([ENSHAREPOINT].[SKILLUPPLANID] IS NULL))

GROUP BY (CASE WHEN ([ENSHAREPOINT].[ID] IS NOT NULL) THEN 1 ELSE 0 END), [ENTEAM].[ID], [ENSHAREPOINT].[ID], [ENTEAM].[NAME]


Thank you for your help.

2025-01-09 14-56-57
IQ78

hi, 

Do u use Query Advance  widget, If yes, 

please set its Expand inline property to Yes 


UserImage.jpg
Seheon Oh

Dear ibox,

Thank you for reply.

But I can find Expan Inline on my application.

Where can I find that?

Best regards.

2025-01-09 14-56-57
IQ78

UserImage.jpg
Alexandre Yip

Hi Seheon Oh, 

You can achieve the same result with separate conditions and a union clause, something like this 

SELECT TOP (17) [ENTEAM].[ID] [ID], [ENTEAM].[NAME] [NAME], 1 [SHAREBOOL], [ENSHAREPOINT].[ID] [SHAREPOINTID]

FROM ([OSDEV1].dbo.[OSSYS_GROUP_T20] [ENTEAM]

    FULL JOIN [OSDEV1].dbo.[OSUSR_4MS_SHAREPOINT] [ENSHAREPOINT] ON ([ENTEAM].[ID] = [ENSHAREPOINT].[TEAMID])) 

WHERE (([ENSHAREPOINT].[TYPE] = N'SkillUp')

    AND ([ENSHAREPOINT].[SKILLUPPLANID] IS NULL))

AND [ENSHAREPOINT].[ID] IS NOT NULL

GROUP BY 1, [ENTEAM].[ID], [ENSHAREPOINT].[ID], [ENTEAM].[NAME]

UNION 

SELECT TOP (17) [ENTEAM].[ID] [ID], [ENTEAM].[NAME] [NAME], 0 [SHAREBOOL], [ENSHAREPOINT].[ID] [SHAREPOINTID]

FROM ([OSDEV1].dbo.[OSSYS_GROUP_T20] [ENTEAM]

    FULL JOIN [OSDEV1].dbo.[OSUSR_4MS_SHAREPOINT] [ENSHAREPOINT] ON ([ENTEAM].[ID] = [ENSHAREPOINT].[TEAMID])) 

WHERE (([ENSHAREPOINT].[TYPE] = N'SkillUp')

    AND ([ENSHAREPOINT].[SKILLUPPLANID] IS NULL))

AND [ENSHAREPOINT].[ID] IS NULL

GROUP BY 0, [ENTEAM].[ID], [ENSHAREPOINT].[ID], [ENTEAM].[NAME]


Hope that it helps you 

UserImage.jpg
Seheon Oh

Hi Alexandre Yip.


Thank you for your help.

But would you tell me where can I modify sql state?

It seems that I cannot modify on below screen.


Best regards

UserImage.jpg
Alexandre Yip
2023-11-20 06-53-17
Neha Rathore
Solution

Hi Seheon,

This is an aggregate query you cannot change that, you need to share the aggregate and the filter conditions that you are using.

Otherwise convert aggregate into SQL. 

https://success.outsystems.com/documentation/11/developing_an_application/use_data/query_data/sql_queries/

Best to share the OML. That will be helpful

Thanks

UserImage.jpg
Seheon Oh

Hi neha rathore


Thank you for your support.


I think this error is because of following filter.


When I remove above filter, error didn't occured.


best regards


2023-11-20 06-53-17
Neha Rathore

Oh great.. mark this as solution then 

Thanks

2025-01-09 14-56-57
IQ78

Hi i think this forum question is too fat, the topic goes wildly not in a single minded problem. So it is better to open another question, not to surrogate this one.

regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.