Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8441225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:30:46+00:00 2026-06-10T08:30:46+00:00

I have issues creating this trigger second_loop in sqlite3: It is part of more

  • 0

I have issues creating this trigger second_loop in sqlite3:
It is part of more code but it’s this exact part that’s giving errors.
When I execute the code on the database I get the following: near “CREATE”: syntax error.

I am sure the part inside the trigger works well as I’ve tested it separately, but there must be some other kind of problem with this.

Note that I have another trigger in the same SQL and it is working just fine!

Please advise, Thanks

CREATE TRIGGER second_loop AFTER UPDATE OF stack_count ON global WHEN NEW.stack_count<>0

BEGIN
 CREATE TEMP TABLE last_row(id INTEGER PRIMARY KEY, unvisited INTEGER DEFAULT 1, predecessor INTEGER DEFAULT 0, discovery INTEGER DEFAULT 0, finish INTEGER DEFAULT 0);

 INSERT INTO last_row
        SELECT *
        FROM nodes
        WHERE id = (SELECT node_id
                   FROM stack
                   ORDER BY oid DESC LIMIT 1);

 UPDATE last_row SET unvisited =0, predecessor = (SELECT parent_id FROM global), discovery = (SELECT time FROM global);

 UPDATE global SET current_id = (SELECT node_id FROM stack WHERE ROWID = (SELECT MAX(ROWID) FROM stack));
 UPDATE global SET time = time + 1;

 DELETE FROM stack WHERE ROWID = (SELECT MAX(ROWID));

 INSERT INTO stack(node_id)
   SELECT DISTINCT edges.target_id
   FROM nodes, edges, global
   WHERE edges.source_id=global.current_id AND nodes.unvisited=1;

  -- update stack count to go to second_loop trigger
  UPDATE global SET stack_count = stack_count + 1;
 END;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:30:48+00:00Added an answer on June 10, 2026 at 8:30 am

    SQLite3’s CREATE TRIGGER statement does not support embedded CREATE TEMP TABLE substatements according to the syntax diagram.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question, but let me first say that this is being performed
I have issues with Firefox and keydown function. It will not trigger the function
I have a jQuery UI Dialog box, that I'm creating. It starts out as
The following code is from a tutorial ( http://net.tutsplus.com/php/creating-a-php5-framework-part-1/ ), not mine. I have
This is a more specific question to follow up on [another question that I
I’m having issues creating an IN clause using C# and lambdas. I have the
I currently have a hierarchy that looks like this MainWindowViewModel TabViewModel EditorViewModel ReviewingServices ConflictFinder
IE6 is always surprising me but this one is REALLY odd. I'm creating a
I have an older form that I really don't want to rewrite at this
I'm creating quite a cool image viewer but am stuck in one particular part:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.