# Encountering "Unable to retrieve columns for table \[tablename\]" error when querying invoice and timeentry tables within NetSuite's SuiteQL schema

**URL:** <https://community.cdata.com/t/encountering-unable-to-retrieve-columns-for-table-tablename-error-when-querying-invoice-and-timeentry-tables-within-netsuites-suiteql-schema/1050>\
**Category:** CData Drivers\
**Tags:** question, netsuite, suiteql\
**Created:** [March 12, 2025, 9:40pm UTC](https://community.cdata.com/t/encountering-unable-to-retrieve-columns-for-table-tablename-error-when-querying-invoice-and-timeentry-tables-within-netsuites-suiteql-schema/1050 "2025-03-12T21:40:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewr](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@matthewr](https://community.cdata.com/u/matthewr)\
**Post date:** [March 12, 2025, 9:40pm UTC](https://community.cdata.com/t/encountering-unable-to-retrieve-columns-for-table-tablename-error-when-querying-invoice-and-timeentry-tables-within-netsuites-suiteql-schema/1050/1 "2025-03-12T21:40:33Z")

</div>

When executing queries on either of the **invoice** or **timeentry** tables in the SuiteQL schema within your NetSuite connection, you may receive the following error, replacing \<tablename\> with the name of the table being queried:

```auto
Unable to retrieve columns for table [<tablename>].

```

This error may be encountered even when permissions are properly configured and when the connection is successfully tested. With this in mind, what should be done to work around the error?

---

<div class="post-metadata">

**Author:** ![matthewr](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@matthewr](https://community.cdata.com/u/matthewr)\
**Post date:** [March 12, 2025, 9:42pm UTC](https://community.cdata.com/t/encountering-unable-to-retrieve-columns-for-table-tablename-error-when-querying-invoice-and-timeentry-tables-within-netsuites-suiteql-schema/1050/2 "2025-03-12T21:42:38Z")

</div>

NetSuite has recently informed us that each of the **invoice** and **timeentry** tables have been deprecated within the SuiteQL schema and are no longer supported. As such, any attempts to query either of these tables will cause SuiteQL to throw a search error, causing the “Unable to retrieve columns” error to appear.

As a workaround to querying the **invoice** table, invoice data may instead be returned within the SuiteQL schema by querying the **transaction** table and filtering by the **recordtype** column. To demonstrate, refer to the following example query:

```sql
SELECT * FROM transaction WHERE recordtype = 'invoice'

```

Alternatively, there is a table named **Invoice** exposed within the SuiteTalk schema that may be utilized for retrieving invoice data from your NetSuite instance. While SuiteTalk is an older schema than SuiteQL and does not possess the same robust support for executing SELECT queries that SuiteQL possesses, it may be beneficial to switch to utilizing this schema to gain access to additional invoice data via the **Invoice** table as a workaround.

In regards to workarounds for querying the **timeentry** table, retrieving timesheet data can be accomplished within the SuiteQL schema by instead querying the **timebill** table. Refer to the following example query as a demonstration:

```sql
SELECT * FROM timebill

```

Further, the SuiteTalk schema also exposes three additional tables that you may wish to use in order to retrieve timesheet data: the **TimeBill** , **TimeEntry** , and **TimeSheet** tables.

Due to these limitations of the SuiteQL schema and API provided by NetSuite, however, these will be the only workarounds for retrieving invoice and timesheet data at this time.

Should any issues persist, please reach out to [support@cdata.com](mailto:support@cdata.com) for further assistance.
