cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

table constraints

Former Member
0 Likes
1,240

how can we check the constraints applied on the columns of a table?

Accepted Solutions (1)

Accepted Solutions (1)

arvind-kumar_avinash
Active Contributor
0 Likes

Hybris does not provide any interface to view the constraints applied on the columns of a table. You need to check it in database itself. Given below are some examples:

In Oracle:

 SELECT * FROM user_cons_columns WHERE table_name = 'your-table-name';

In HSQLDB:

 SELECT * FROM information_schema.table_constraints WHERE table_name = 'YOUR-TABLE-NAME-IN-UPPER-CASE'

In MySQL:

 SHOW CREATE TABLE your-table-name;
Former Member
0 Likes

how can we check the table structure in HAC. just like we have command "desc", do we have a similar thing in hybris also?

arvind-kumar_avinash
Active Contributor
0 Likes

Hi Rajat - You can check the table structure by using the command DESC table-name in the SQL Query tab as shown in the attached screenshot. Please note that DESC works for only Oracle and MySQL. For HSQLDB and MSSQL the equivalent command is:

 SELECT * FROM information_schema.columns WHERE table_name = 'your-table-name' 

Answers (1)

Answers (1)

Former Member
0 Likes

Hybris doesn't generate any constraints in a db schema apart from what is required from a DB engine for PK uniqueness.

arvind-kumar_avinash
Active Contributor
0 Likes

Apart from PK, Hybris generates constraint for unique/index (Ref: https://help.hybris.com/1811/hcd/8ecae959b9bd46b8b426fa8dbde5cac4.html )