Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot create TRIGGER as shown in SQLite Example #1470
Details for the issue
What did you do?
I tried to create a trigger on an existing database. But without success. So instead I went over to sqlite.org and tried the examples.
The executed lines are:
And it fails on the last line.
What did you expect to see?
I expected to execute the sample code and thus successfully create a trigger.
What did you see instead?
incomplete input: CREATE TRIGGER cust_addr_chng INSTEAD OF UPDATE OF cust_addr ON customer_address BEGIN UPDATE customer SET cust_addr=NEW.cust_addr WHERE cust_id=NEW.cust_id
Useful extra information
The three statements execute successfully in the sqlite3 command line tool which is
What operating system are you using?
What is your DB4S version?
Did you also
Aah, that's probably the 'gotcha' then. When executed as one lump, DB4S just 'eats the lot'. When told to parse each 'line', it gets a bit confused with the last line ending with ;END, as a semi-colon is normally used to terminate a SQL statement (as in the top two lines). So DB4S is actually treating the 3rd line as 2 separate commands...
So the workaround is to move the 3rd line in all its glory to a separate Execute SQL tab, so it can be run as a whole. So you can still execute it line by line, but not fully on the last line.....
An easier workaround would be to select the current line and click the normal
But yeah, this is definitely a bug. The easiest way to trigger it is by only having this simple statement and trying to execute it by clicking the
As @chrisjlocke suspected, this is because we split the statement at the semicolon. See #780 for details why. I'll have to think about this a bit more - no idea how to fix this and still have the features from #780.