# Issue with Database Query

**URL:** <https://forum.inductiveautomation.com/t/issue-with-database-query/85088>\
**Category:** Ignition\
**Created:** [February 1, 2024, 12:11pm UTC](https://forum.inductiveautomation.com/t/issue-with-database-query/85088 "2024-02-01T12:11:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRASHANTH\_KAKKIRALA](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PRASHANTH\_KAKKIRALA](https://forum.inductiveautomation.com/u/PRASHANTH_KAKKIRALA)\
**Post date:** [February 1, 2024, 12:11pm UTC](https://forum.inductiveautomation.com/t/issue-with-database-query/85088/1 "2024-02-01T12:11:30Z")

</div>

I'm facing an issue while using a query with PostgreSQL.  
Named Query:  
SELECT "A".\*,"B"."B\_data1", "B"."B\_data2" FROM "A" join "B" ON ("A"."id" = "B"."A\_id") WHERE "A"."E" ='P\_Test' LIMIT 1

Error :  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c69921f9a52cd2663f28b90b470a7d02ca820c84.png)

When I remove the \*, there is no error. My requirement is to collect all the data from table 1 and few columns from table 2 with some conditions.  
Can someone assist in this issue?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 1, 2024, 1:17pm UTC](https://forum.inductiveautomation.com/t/issue-with-database-query/85088/2 "2024-02-01T13:17:30Z")

</div>

List the columns in A by name. To test, omit each column one by one to find the column datatype that doesn't work in JDBC. Once you find it, you will need to cast it to something that the JDBC driver can handle.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 1, 2024, 5:25pm UTC](https://forum.inductiveautomation.com/t/issue-with-database-query/85088/3 "2024-02-01T17:25:32Z")

</div>

From a quick peek at the Postgres JDBC driver, it looks like typecode 2003 corresponds to an array type.

---

<div class="post-metadata">

**Author:** ![PRASHANTH\_KAKKIRALA](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@PRASHANTH\_KAKKIRALA](https://forum.inductiveautomation.com/u/PRASHANTH_KAKKIRALA)\
**Post date:** [February 2, 2024, 8:58am UTC](https://forum.inductiveautomation.com/t/issue-with-database-query/85088/4 "2024-02-02T08:58:36Z")

</div>

Yeah. Thanks for the response.  
Changing the datatypes (from \_int8 to int8) fixed the issue.
