Dimitris Poulopoulos
Dimitris Poulopoulos

Reputation: 147

How can I retrieve the column names of a table in Apache Derby, via an SQL query?

I want to retrieve the column names of a table (e.g., MAIN_ENGINE_DATA), under a specific schema (e.g., APP) using an SQL query.

How can I achieve this in Apache Derby?

Upvotes: 2

Views: 1453

Answers (1)

Dimitris Poulopoulos
Dimitris Poulopoulos

Reputation: 147

Ok, I found the solution. The SQL query would be like:

SELECT COLUMNNAME FROM SYS.SYSCOLUMNS INNER JOIN SYS.SYSTABLES ON SYS.SYSCOLUMNS.REFERENCEID = SYS.SYSTABLES.TABLEID WHERE TABLENAME = 'MAIN_ENGINE_DATA'

Upvotes: 2

Related Questions