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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:00:27+00:00 2026-05-16T21:00:27+00:00

hey guys,i’m new to mysql.here i wrote a procedure that error occured: DELIMITER $$

  • 0

hey guys,i’m new to mysql.here i wrote a procedure that error occured:

DELIMITER $$

USE `flower2`$$

DROP PROCEDURE IF EXISTS `test`$$

CREATE   PROCEDURE `test`()

BEGIN

DECLARE soldcount INT;

DECLARE goodsid INT;

DECLARE not_found INT;

DECLARE  curGoodsId CURSOR FOR  SELECT goods_id FROM ecs_order_goods;  

DECLARE  curSoldCount CURSOR FOR  SELECT sold_count FROM ecs_goods;  

DECLARE CONTINUE HANDLER FOR NOT FOUND SET not_found = 1; 

DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;  

START TRANSACTION; 

OPEN curGoodsId;  

OPEN OPEN curSoldCount;

WHILE not_found = 0 DO

FETCH curSoldCount INTO soldcount; 

FETCH curGoodsId INTO goodsid;

    SELECT COUNT(goods_id) FROM ecs_order_goods INTO soldcount;

    UPDATE ecs_goods SET sold_count=soldcount WHERE goods_id=goodsid;

IF NOT not_found THEN  

    SET not_found = 0 ;  

END IF;

END WHILE;

CLOSE curGoodsId;

CLOSE curSoldCount;

COMMIT;

END$$

DELIMITER ;

Error message:

(0 row(s) affected)
Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:015
Total Time     : 00:00:00:015

(0 row(s) affected)
Execution Time : 00:00:00:000
Transfer Time  : 00:00:01:141
Total Time     : 00:00:01:141

Query : **CREATE   PROCEDURE `test`() BEGIN DECLARE soldcount INT; DECLARE goodsid int; DECLARE not_found INT; DECLARE  curGoodsId CURSOR ...
Error Code : 1324
Undefined CURSOR: OPEN**
Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:000
Total Time     : 00:00:00:000
  • 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-16T21:00:28+00:00Added an answer on May 16, 2026 at 9:00 pm

    You wrote

    OPEN OPEN curSoldCount;
    

    Try

    OPEN curSoldCount;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I just noticed that my join statement here SELECT * FROM reports
Hey guys I'm following the rails tutorial found here http://net.tutsplus.com/tutorials/ruby/the-intro-to-rails-screencast-i-wish-i-had/ and I've gotten to
Hey guys, sorry I'm kind of new to programming, but I had a small
Hey guys I'm creating a quick mysql file to create a DB with some
Hey guys I can't seem to get the syntax here right, I'm just trying
Hey guys here is my php: $x = array(one, two, three); foreach ($x as
Hey guys I am new to android development, I am currently making an application.The
Hey guys i am currently working on an android app that will allow me
Hey guys I'm getting three things right now that I'm trying to take care
hey guys should be a easy one...I have some javascript that is turning my

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.