Comments (2)
Could you please provide an example where more than one trigger is generated for the same table? In current JS implementation trigger functionality is aggregated under table_name_bui,
e.g.
dept /rowversion
name /lower
which generates
-- create tables
create table dept (
id number generated by default on null as identity
constraint dept_id_pk primary key,
name varchar2(255 char),
row_version integer not null
);
-- triggers
create or replace trigger dept_biu
before insert or update
on dept
for each row
begin
:new.name := lower(:new.name);
if inserting then
:new.row_version := 1;
elsif updating then
:new.row_version := NVL(:old.row_version, 0) + 1;
end if;
end dept_biu;
/
-- Generated by Quick SQL...
from quicksql.
Vadim,
Yes, the current implementation creates a single trigger. But the trigger that it creates is a ‘classic trigger’ rather than a compound trigger. The name of the trigger has an _biu at the end. This would encourage anyone who wanted logic to after after insert or update to create a second _aiu trigger. What I’m suggesting is we encourage the better behavior of a single trigger for each table, as a compound trigger, with the ‘extra’ spots commented out.
Does that make sense? I tried to communicate that previously, I’m sorry it wasn’t clear.
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.