Git Product home page Git Product logo

Comments (5)

vadim-tropashko avatar vadim-tropashko commented on August 25, 2024

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.

stevemuench avatar stevemuench commented on August 25, 2024

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.

vadim-tropashko avatar vadim-tropashko commented on August 25, 2024

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.

stevemuench avatar stevemuench commented on August 25, 2024

Thanks for clarifying. I missed the /nn in there.

from quicksql.

vadim-tropashko avatar vadim-tropashko commented on August 25, 2024

in 1.2.6

from quicksql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.