# Is there a way to get the column labels while running system.db.runNamedQuery?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-column-labels-while-running-system-db-runnamedquery/80932>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 24, 2023, 8:12pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-column-labels-while-running-system-db-runnamedquery/80932 "2023-10-24T20:12:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [October 24, 2023, 8:12pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-column-labels-while-running-system-db-runnamedquery/80932/1 "2023-10-24T20:12:12Z")

</div>

Say I want to query against an entire table, and get some number of rows back. `system.db.runNamedQuery` returns only the resulting values, without any information about the columns. Is there an equivalent method to do this that would return the header of the table? Or do I have to go through the rigamarole of defining the column ordering in the query instead of being able to use something like `SELECT * FROM table WHERE :parameter = :value LIMIT 1;`?

If I wanted to run something like `SELECT pg_get_result_column_names('your_query_name_or_statement');`, where would I do it?

---

<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:** [October 24, 2023, 8:14pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-column-labels-while-running-system-db-runnamedquery/80932/2 "2023-10-24T20:14:46Z")

</div>

> [@sherman](#):
>
> without any information about the columns

Named queries return datasets. Which have methods to `.getColumnNames()` and to `.getColumnTypes()`, which, thanks to jython, can be abbreviated NetBeans style as `.columnNames` and `.columnTypes`, respectively.

---

<div class="post-metadata">

**Author:** ![sherman](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@sherman](https://forum.inductiveautomation.com/u/sherman)\
**Post date:** [October 24, 2023, 8:15pm UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-column-labels-while-running-system-db-runnamedquery/80932/3 "2023-10-24T20:15:26Z")

</div>

Perfect, thank you Phil.
