Comments (5)
To doublecheck:
departments
dname
emp /setnull
department_id /fk departments
ename
should output
...
create table emp (
id number generated by default on null as identity
constraint emp_id_pk primary key,
department_id number
constraint emp_department_id_fk
references departments on delete set null,
ename varchar2(255 char)
)
;
...
Then
team_members
username
projects /insert 2
name
project_lead /nn /references team_members /setnull
would raise an error due to conflicting directives.
from quicksql.
I didn't understand why the team_members and project example would not simply result in a foreign key project_lead that would be set null if the team member to which it referred was deleted. Can you clarify what you mean by conflicting directives? It would definitely be an error to list both /cascade and /setnull together, but I thought /references was a synonym for /fk and that the lack of having either /setnull or /cascade was what represented the default ON DELETE RESTRICT behavior (which is omitted from the DDL since it's the behavior of a foreign key by default).
from quicksql.
The /nn
directive is conflicting with /setnull
. (This is a test example for /cascade
that is converted to /setnull
, and /nn
is just an artifact).
from quicksql.
Thanks for clarifying. I missed the /nn
in there.
from quicksql.
in 1.2.6
from quicksql.
Related Issues (20)
- /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
- 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
- /rowkey table directive HOT 1
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.