Comments (5)
By table level check constraints do you mean SQL Assertions, or something narrower in the scope?
from quicksql.
No, not SQL Assertions. Here's an example that creates a table with two constraints: one column-level and one table-level. Table-level constraints can work with multiple columns.
create table t(
c1 varchar2(10) check (c1 in ('A','B','C')),
c2 varchar2(10),
check (not (c1 = 'B' and c2 is null))
);
from quicksql.
In your particular example the constraint can be refactored into the two independent column-level constraints. However, I get the point, the suggested QSQL syntax should be something like this:
t /check not(c1 || c2 = 'A1' )
c1 /check c1 in ('A','B','C')
from quicksql.
In your particular example the constraint can be refactored into the two independent column-level constraints.
I don't believe this is true. You have to be able to check the values of two columns simultaneously.
suggested QSQL syntax should be something like this
Yes. An alternative would be something like /checkraw
. "raw" meaning: we're not expecting an in list (as /check
currently does). Instead, we'll take anything between /checkraw
and the subsequent directive (if there is one) to be the expression.
from quicksql.
Implemented, see https://github.com/oracle/quicksql/blob/main/test/constraints.qsql
from quicksql.
Related Issues (20)
- Boolean type uses the wrong case for the default value HOT 1
- /fk directive overrides INT data type to number HOT 1
- "Prefix primary keys with table name" with SYSGUID error HOT 6
- Use key words in the column name to default the data type HOT 1
- cannot create composite primary keys HOT 2
- email address parsing error for column defaults HOT 3
- Certain check constraint values can change column data type HOT 1
- Performance generating SQL with more than a few tables is not great
- Boolean Datatype 23c (Was: Order of 'default' with boolean produces invalid SQL) HOT 7
- Please Support /setnull Option Wherever /cascade is Supported to Enable Reverse Engineering Existing Schemas to Quick SQL HOT 5
- Escape character for /values HOT 2
- "Prefix primary keys with table name", table api error
- Confusing that #semantics:default is required to get default semantics HOT 1
- Update default `db` setting to be 19c or 23c HOT 1
- Missing customer_id in the diagram
- Unique constraint name unexpectedly leaves out table prefix if used
- /insert generates unexpected 'N/A' string for a blob column & data too long for vc20
- Add Oracle Text column directive
- Sample Data Model (Departments and Employees) produces bad SQL. Missing semi-colon, and bad BLOB insert. HOT 1
- FK reference to other tables HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quicksql.