Good day all! I was wondering if someone could giv...
# general
a
Good day all! I was wondering if someone could give me some insight into why this suiteql query isn't working?
select vendor.id, vendor.firstname, vendor.lastname, vendor.email, vendor.isinactive from vendor where isperson = 'T' union select employee.id, employee.firstname, employee.lastname, employee.email, employee.isinactive from employee
I'm just trying to get back all people that are vendors and employees but I just keep getting a generic unexpected error that doesn't mention what was wrong.
n
maybe try in suiteql channel if nobody answers
🙌 1
a
Oh thanks!
g
@Alex I just copied your query and ran it in my SuiteQL tool and did not get an error.
a
Huh, maybe postman is doing something funky.
g
are you using a RESTlet with the query module?
a
No I am just hitting the query endpoint directly from postman
It works fine if I just do either employee or vendor, the union seems to cause the error for me.
@GeneralKenobi but I just get this back:
Copy code
{
  "type": "<https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1>",
  "title": "Internal Server Error",
  "status": 500,
  "o:errorDetails": [
    {
      "detail": "An unexpected error occurred. Error ID: XXXXXX",
      "o:errorCode": "UNEXPECTED_ERROR"
    }
  ]
}
g
I need to test that never thought of querying directlyusing POSTMAN
Sorry couldn't be more help,
a
No worries! I also tried doing it directly in C# using an integration test I already had setup and got the same error. Maybe there is some random setting that is preventing me from doing this. 😞
@GeneralKenobi got it! It's weird and I have no idea why this did it because the documentation is sparse at best but this is what worked:
select t.* from ((select id, firstname, lastname, email, isinactive from vendor where isperson = 'T') union (select id, firstname, lastname, email, isinactive from employee)) t