on ‎2019 Apr 09 2:50 PM
how can we check the constraints applied on the columns of a table?
Request clarification before answering.
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;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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'

Hybris doesn't generate any constraints in a db schema apart from what is required from a DB engine for PK uniqueness.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apart from PK, Hybris generates constraint for unique/index (Ref: https://help.hybris.com/1811/hcd/8ecae959b9bd46b8b426fa8dbde5cac4.html )
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.