Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get group by data based on customTextBlock in rest service #13

Open
harigkp opened this issue Jul 7, 2020 · 0 comments
Open

Comments

@harigkp
Copy link

harigkp commented Jul 7, 2020

Hi,

Group by for customTextBlock5, I did same as category but this is not working.

Request URL:https://public-rest777.bullhornstaffing.com/rest-services/2TINES/query/JobBoardPost?where=id IN (47236,50802,70844,86360,104347,111318,112002,112544,113523,115239)&groupBy=customTextBlock5&fields=customTextBlock5,count(id)&count=500&orderBy=+customTextBlock5,-count.id&start=0
Request method:GET
Status code: 400

{
"errorMessage": "javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query",
"errorCode": 400
}

I have tried group by as following sql as well
SELECT count(jobOrderID)

--  ,[customTextBlock5]

FROM [TTTT].[dbo].[JobOrder]
where [TTTT].[dbo].[JobOrder].[jobOrderID] in (47236,50802,70844,86360,104347,111318,112002,112544,113523,115239)

group by [TTTT].[dbo].[JobOrder].[customTextBlock5]

I analyzed that customTextBlock5 data type is text in DB and you cannot make group by on text data type. I ran following and its working

SELECT count(jobOrderID)

--  ,[customTextBlock5]

FROM [BHDMQA].[dbo].[JobOrder]
where [BHDMQA].[dbo].[JobOrder].[jobOrderID] in (47236,50802,70844,86360,104347,111318,112002,112544,113523,115239)

group by CAST([BHDMQA].[dbo].[JobOrder].[customTextBlock5] AS NVARCHAR(MAX))

In career portal code as follows:
assembleForGroupByWhereIDs: function assembleForGroupByWhereIDs(fields, orderByFields, start, count, jobs) {

					return '?where=' + _this3.requestParams.whereIDs(jobs, false) + '&groupBy=' + fields + '&fields=' + fields + ',count(id)&count=' + count + '&orderBy=+' + orderByFields + ',-count.id&start=' + start;
					
                },

So, I want to know how will make group by for customTextBlock5

Based on this issue I am unable to make sidebar for this customTextBlock5 i.e Brand offering in career portal(angularjs)

Thanks,
Hari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant