3

I create stored procedure in Navicat for MySQL as follow:

CREATE PROCEDURE myloop()

        BEGIN

                    DECLARE customerID INT DEFAULT 11;

                    first_loop: LOOP

                        SET customerID = customerID +1;

                        DECLARE itemID INT DEFAULT 0;                   

                    second_loop: LOOP

                        SET itemID = itemID +1;

                        Insert INTO tbl_order(customerId, itemId) VALUES
                        (customerID, itemID );  

                      IF itemID=3000 THEN
                         LEAVE second_loop;
                      END IF;
                    END LOOP second_loop;

                    IF customerID=3000 THEN
             LEAVE first_loop;
          END IF;
        END LOOP first_loop;

END

but i can't find anywhere to call my Stored Procedure.

how can i see and call my Created Stored Procedure?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
AKZap
  • 1,181
  • 6
  • 17
  • 31

2 Answers2

2

It's right under the tables selection.

screenshot

Alternatively you can just open a query window and write call yourProcedure()

fancyPants
  • 50,732
  • 33
  • 89
  • 96
  • My Navicat version is 9.0.8 and i don't see any Stored Procedures tag under tables selection. thanks – AKZap Apr 27 '12 at 04:39
  • @AKZap Are you sure that there actually is a stored procedure? There were no errors when you created it? – fancyPants Apr 27 '12 at 08:09
  • yes there is no errors when creating it. but i wonder i can see and call my created StoredProcdure from other DBSM software (eg. MySQL or SQLyog). Only Not appear in Navicat :( – AKZap Apr 27 '12 at 08:18
  • @AKZap Could it be, that it's under "Functions"? I mean that it's at the same place as stored procedures in my screenshot above, but that it was renamed? – fancyPants Apr 27 '12 at 08:25
  • At least I saw screenshots where "Stored Procedure" was missing, but there was "Functions". I am aware that there's a difference. – fancyPants Apr 27 '12 at 10:04
  • Thank you so much for your answer. yes,now i can create and see the stored procedure under functions tag. – AKZap Apr 28 '12 at 09:55
1

in Navicat 9.0.8 version there is no tab for your created Stored Procedure.

i prefer to use "SQLQueryBrowser" to overcome your problem.

emerald
  • 329
  • 4
  • 5
  • 10