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 585717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:01:55+00:00 2026-05-13T15:01:55+00:00

If i run every block of this script in mysql-query-browser, it works. If i

  • 0

If i run every block of this script in mysql-query-browser, it works.

If i run it as mysql db < script.sql it gives me an error[1] that the documentation says it’s for using reserved keywords.

Already tried to use ; everywhere.

-- table
CREATE TABLE `days` (
  `day` date NOT NULL,
  PRIMARY KEY  (`day`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

-- proc
CREATE PROCEDURE db.filldays()
BEGIN
  DECLARE v1 DATE DEFAULT '2039-01-01';
  WHILE v1 > '2009-01-01' DO
    INSERT days VALUES (v1);
    SET v1 =  DATE_SUB( v1, INTERVAL 1 DAY );
  END WHILE;
END

-- call proc
call filldays();

-- clean
drop procedure filldays;

[1] the erro:
ERROR 1064 (42000) at line 8: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 3

  • 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-05-13T15:01:55+00:00Added an answer on May 13, 2026 at 3:01 pm

    you need to change DELIMITER before CREATE PROCEDURE and change it back to ; after .

    DELIMITER $$
    

    CREATE PROCEDURE db.filldays()
    BEGIN
    DECLARE v1 DATE DEFAULT ‘2039-01-01’;
    WHILE v1 > ‘2009-01-01’ DO
    INSERT days VALUES (v1);
    SET v1 = DATE_SUB( v1, INTERVAL 1 DAY );
    END WHILE;
    END $$
    DELIMITER ;

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

Sidebar

Related Questions

If I have a cron job that run every 10 minutes and for some
I have a PHP page that I run every minute through a CRON job.
I have a php script I need to run every 5 seconds (run, wait
I have a Perl script which I want to run every 4 hours through
The Ruby script i am writing is going to be run every morning and
I am trying to get a timer run every minute in sync with the
I have a program which I would like to run every X min the
I'm trying to schedule a repeating event to run every minute in Python 3.
I have the following code, which is run every 10ms as part of a
I want to set up a cron job. The job has to run every

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.