Get table schema or table structure in netbeans, derby

I am creating a database in derby / netbeans. And I would like to derive the database structure, not just export the entire database. How to do it?

I tried both the "EXEC" table name '; "that returned" Error code -1, SQL status 42X01: Syntax error: "exec" was detected in row 1, column 1. "as well as" SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'table name'; "which returned" Error code -1, SQL state 42Y07: Schema "INFORMATION_SCHEMA" does not exist. "

I read on several forums that this should work, you guys don't know what I'm doing wrong?

+4
source share
4 answers

GET TABLE STRUCTURE

select COLUMNNAME,COLUMNDATATYPE 
FROM sys.systables t, sys.syscolumns 
WHERE TABLEID = REFERENCEID and tablename = 'FRIENDS' 

enter image description here

Other fields you can use in select

  • Columnddefult
  • COLUMNDEFAULTID
  • AUTOINCREMENTVALUE
  • AUTOINCREMENTSTART
  • AUTOINCREMENTINC

Inside Netbeans

Expand the node tables under the sample database connection, right-click the node table and select Grab Structure.

enter image description here

In the opened Grab Table dialog box, specify the location on your computer to save the capture file that will be created. Click "Save."

The grab file writes the table definition for the selected table. Expand the APP node diagram in the Contact DB database connection, right-click the node table and select Restore Table to open the Create Recreation Table dialog box.

enter image description here

" " , CUSTOMER, "", " ".

enter image description here

GET TABLES

.

select * from SYS.SYSTABLES;

enter image description here

TABLENAME

select TABLENAME from SYS.SYSTABLES where TABLETYPE='T'

enter image description here

Derby

+5

NetBeans (8.0, , ): " ..." , " SQL Script CREATE". SQL script.

+2

- : DESCRIBE table_name;

0

All Articles