3 Replies Latest reply on May 27, 2016 10:24 AM by Ramesh Reddy

    How to get check constraint in database Schema text returned by Teiid

    Nishant Agrawal Novice

      I have created a table in sqlserver database with check constraint on salary column.


      CREATE TABLE check_test (emp_id int PRIMARY KEY,

                                emp_name varchar(45) NOT NULL,

                                salary int not null,

         CONSTRAINT chk_constraint CHECK (salary>0))



      I refreshed the vdb file.


      I called the teiid API to get database schema text.


      I got the below database schema text.But it does not contain any check constraint.


      CREATE FOREIGN TABLE check_test (

        emp_id integer NOT NULL OPTIONS (NAMEINSOURCE '"emp_id"', NATIVE_TYPE 'int'),

        emp_name string(45) NOT NULL OPTIONS (NAMEINSOURCE '"emp_name"', NATIVE_TYPE 'varchar'),

        salary integer NOT NULL OPTIONS (NAMEINSOURCE '"salary"', NATIVE_TYPE 'int'),

        CONSTRAINT PK__check_te__1299A861252F4FE2 PRIMARY KEY(emp_id)



      Can you please help me How do i get check constraint on database schema text returned by teiid getSchema() method.