You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I am start experiment with sqlite in mobile development. I am familiar with firebird and I would like your suggestions to translate the following trigger code to SQLite.
The table is:
CREATE TABLE SECTIONS
(
ID Integer NOT NULL,
ISACTIVE boolean DEFAULT True,
ITYPE Integer NOT NULL,
"NAME" varchar ( 64 ) NOT NULL,
VATID Integer NOT NULL,
VAT numeric ( 6, 2 ) NOT NULL,
POS Integer,
REG timestamp DEFAULT current_timestamp,
CONSTRAINT SECTIONS_PK PRIMARY KEY (ID)
);
The trigger to translate to SQLite is:
CREATE TRIGGER SECTIONS_BI FOR SECTIONS ACTIVE
before insert POSITION 0
begin
-- New.ID = next value for "Section_Gen" ;
New.POS = New.ID ;
Select Vat
From Vats
Where ( ID = New.VatID )
Into New.Vat ;
end ;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello
I am start experiment with sqlite in mobile development. I am familiar with firebird and I would like your suggestions to translate the following trigger code to SQLite.
The table is:
CREATE TABLE SECTIONS
(
ID Integer NOT NULL,
ISACTIVE boolean DEFAULT True,
ITYPE Integer NOT NULL,
"NAME" varchar ( 64 ) NOT NULL,
VATID Integer NOT NULL,
VAT numeric ( 6, 2 ) NOT NULL,
POS Integer,
REG timestamp DEFAULT current_timestamp,
CONSTRAINT SECTIONS_PK PRIMARY KEY (ID)
);
The trigger to translate to SQLite is:
CREATE TRIGGER SECTIONS_BI FOR SECTIONS ACTIVE
before insert POSITION 0
begin
-- New.ID = next value for "Section_Gen" ;
New.POS = New.ID ;
Select Vat
From Vats
Where ( ID = New.VatID )
Into New.Vat ;
end ;
Any suggestions?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions