The following was implemented and will be available in future snapshots
and versions:
> DB2 Plugin: The table details in the Object tree has a new tab
> which displays Check Constraints for DB2 LUW.
Thanks for the SQL, Dave.
If someone knew the OS400 or ZOS version for Dave's Check Constraint SQL
I'd be happy to include them in SQuirreL, too.
Gerd
On 6/23/25 14:39, David Clark wrote:
> Well, I've found that I can run a custom query for it. Seems this could
> be built in. But, I do understand that the system table names may
> change depending upon the connected DBMS.
>
> Select trim(con.tabschema) || '.' || trim(con.tabname) as table
> , con.constname as constraint_name
> , case tab.enforced
> when 'N' then 'Disabled'
> when 'Y' then 'Active'
> end as status
> , col.colname as column_name
> , cast(con.text as varchar(255)) as text
> from syscat.checks as con
> Join syscat.colchecks as col
> on col.constname = con.constname
> and col.tabschema = con.tabschema
> and col.tabname = con.tabname
> Join syscat.tabconst as tab
> on tab.constname = con.constname
> and tab.tabschema = con.tabschema
> and tab.tabname = con.tabname
> order by con.tabschema, con.tabname, col.colname;
>
> Thanks,
>
> Dave Clark
> --
> Winsupply Group Services
> 3110 Kettering Boulevard
> Dayton, Ohio 45439 USA
> (937) 294-5331
>
>
> On Sun, Jun 22, 2025 at 4:37 PM Gerd Wagner <ger...@t-...
> <mailto:ger...@t-...>> wrote:
>
>
>
> On 11.06.25 16:26, David Clark wrote:
> > I have found where to view indexes and foreign key constraints,
> but not
> > where to view check constraints. Is this available in SQuirrel 4.8?
> >
>
> No it's not.
>
> To my knowledge the JDBC-API does not offer access to check constraints
> and there isn't any other SQL standard way to access check constraints,
> either.
>
> Gerd
>
|