Version: 13.0-dev-14
Build #: 30127
Build Date: 2012-Nov-09 03:59:50 PM
I can create a table with check constraints in SQLite, but when I script it back with Script to New Window--> FULL, i dont see the created check contraints in the DDL.
For e.g.
CREATE TABLE [CON_CHK](
[ProductID]INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
[ProductName]TEXT NOT NULL,
[SupplierID]INTEGER,
[CategoryID]INTEGER,
[QuantityPerUnit]TEXT,
[UnitPrice]NUMERIC DEFAULT 0,
[UnitsInStock]INTEGER DEFAULT 0,
[UnitsOnOrder]INTEGER DEFAULT 0,
[ReorderLevel]INTEGER DEFAULT 0,
[Discontinued]TEXT NOT NULL DEFAULT '0',
CHECK ([UnitPrice]>=(0)),
CHECK ([ReorderLevel]>=(0)),
CHECK ([UnitsInStock]>=(0)),
CHECK ([UnitsOnOrder]>=(0))
)
When I script the sql from sqlite_master dictionary table, i see it.
select * from sqlite_master where name='CON_CHK'
We use the available system tables and commands to retrieve meta data. We don't parse the CREATE TABLE statement to figure out what the meta data is.
This is a limitation of SQLite. You can create check and unique constraints with the CREATE TABLE statement, but there is no system table or command to retrieve the constraints.
Issue #7948 |
Closed |
Won't Fix |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
We use the available system tables and commands to retrieve meta data. We don't parse the CREATE TABLE statement to figure out what the meta data is.
This is a limitation of SQLite. You can create check and unique constraints with the CREATE TABLE statement, but there is no system table or command to retrieve the constraints.