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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:49:52+00:00 2026-06-08T12:49:52+00:00

hi i am using a stored procedure in mysql when i try to DECLARE

  • 0

hi i am using a stored procedure in mysql

when i try to

 DECLARE CONTINUE HANDLER FOR NOT FOUND SET no_more_prefrences=1 ;

and try to compile , it is giving an error in phpmyadmin .

1193 – Unknown system variable ‘no_more_prefrences’

i have used the same line with a different name in another stored procedure . it is working correctly .

this my stored procedure .

DELIMITER $$
 DROP PROCEDURE IF EXISTS get_all_children_of_lob$$

CREATE PROCEDURE get_all_children_of_lob(
   IN parent_id INT
)

BEGIN

     DECLARE lob_preferenceid INT;
     DECLARE lob_parentid INT;
     DECLARE lob_value VARCHAR(100);
     DECLARE lob_isavailable INT;
     DECLARE lob_ischildavailable INT;
     DECLARE lob_isuseradded INT;
  
     DECLARE cur CURSOR for select PreferenceID,ParentID,Value,IsAvailable,IsChildAvailable,IsUserAdded from table WHERE ParentID=parent_id ;
     DECLARE CONTINUE HANDLER FOR NOT FOUND SET no_more_prefrences=1 ;

     CREATE TEMPORARY TABLE IF NOT EXISTS temp_lob(

          ID int(11) NOT NULL AUTO_INCREMENT,
          preferenceIDTmp INT(11),
          parentIDTmp INT(11),
          valueTmp varchar(255),
          isAvailableTmp INT(11),
          isChildAvailableTmp INT(11),
          isUserAddedTmp INT(11),
          PRIMARY KEY (ID)     
     );
    
          SET no_more_prefrences=0;
          OPEN cur;
          
             dept_loop:WHILE(no_more_prefrences=0) DO

                     FETCH cur INTO lob_preferenceid,lob_parentid,lob_value,lob_isavailable,lob_ischildavailable,lob_isuseradded;
                     IF no_more_prefrences=1 THEN
                        LEAVE dept_loop;
                     END IF;

                                     INSERT  INTO temp_lob(preferenceIDTmp,parentIDTmp,valueTmp,isAvailableTmp,isChildAvailableTmp,isUserAddedTmp)
                                        VALUES  (lob_preferenceid,lob_parentid,lob_value,lob_isavailable,lob_ischildavailable,lob_isuseradded);
                                                                          
                                     CALL get_all_children_of_lob(lob_preferenceid);

             END WHILE dept_loop;

          CLOSE cur;    
      
END$$
DELIMITER ;

i have no idea why is this happening , please help 🙁

  • 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-08T12:49:54+00:00Added an answer on June 8, 2026 at 12:49 pm

    It seems the local variable declaration is missing.

    Add:

    DECLARE no_more_prefrences INT;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MYSQL 5.5, How to do Error Handling with Nested Stored Procedure. Pretty
I am using mysql stored-procedure.My SP return dataset ,how to bind the value into
I am using mysql which i have a stored procedure which has an input
I'm using a stored procedure in MySQL, with a CASE statement. In the ELSE
I'm using adodb5 to call this stored procedure but MySQL doesn't understand $sealID is
Not sure I'm in the correct here. I have a stored procedure in MySQL,
I want to implode a query result using , inside my mysql stored procedure.
I m calling a stored procedure inside another stored procedure in MySQL The error
I'm trying to call a MySQL stored procedure from Twisted adbapi using the MySQLdb
Is there a way to call a MySQL stored function (not procedure) in Zend

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.