Solved

MySQL Procedure compile completes w/o error but also w/o ANY notification

Posted on 2016-08-08
7
107 Views
Last Modified: 2016-08-16
I even have SQL_MODE = 'STRICT_TRANS_TABLES' set, hoping I'd find some cause.

I can't find any reference to this in my search so far.
DROP PROCEDURE ImportCellModemPlans_ATnT ;

SET @OLD_SQL_MODE = @@SQL_MODE , SQL_MODE = 'STRICT_TRANS_TABLES' ;
DELIMITER &&

CREATE PROCEDURE `ImportCellModemPlans_ATnT`(IN param_invoice_id INTEGER, IN param_invoice_identifier VARCHAR(50), IN take_notice TINYINT )
BEGIN
... 1300 lines later...
END &&

DELIMITER ;
SET SQL_MODE = @OLD_SQL_MODE ;

Open in new window


Any suggestions on what to look for?

I'm using MySQL Workbench 6.3 on Windows 7.  Seems a bit more buggy than the 6.2 version I used to use.

Thanks!
0
Comment
Question by:Ralph
  • 3
  • 3
7 Comments
 
LVL 26

Expert Comment

by:Zberteoc
ID: 41750299
There is no enough information on this. What notification do you expect?
0
 

Author Comment

by:Ralph
ID: 41751273
I'm using MySQL Workbench, but holds true for command line too.

Normally when I compile a PROC, (I include DROP theproc in line w/ its definition), I get:
3	159	16:28:40	DROP PROCEDURE `Census_ImportPlanChange`	0 row(s) affected	0.000 sec
3	160	16:28:40	CREATE PROCEDURE `Census_ImportPlanChange`(IN Pre_OR_Post VARCHAR(50), IN posting_period VARCHAR(50))
 BEGIN
   
   # -------------------------------------------------------------------------------------
   
     DROP TABLE IF EXISTS yPlan_Data_Change ;
     
   # =====================================================================================
   
   IF UPPER(Pre_OR_Post) = 'PRE' THEN
       
     UPDATE zModem_Census  AS z
     JOIN   ModemConfig    AS mc
       ON   mc.modem_config_id = z.modem_config_id
      AND   z.posting_period = posting_period
     SET    z.intlplancode_before_invoice = mc.intlplan_code
          , z.domplancode_before_invoice  = mc.domplan_code ;
     COMMIT ;
     
   END IF ;
   
   # -------------------------------------------------------------------------------------
   
   IF UPPER(Pre_OR_Post) = 'POST' THEN
     
     UPDATE zModem_Census  AS z
     JOIN   ModemConfig    AS mc
       ON   mc.modem_config_id = z.modem_config_id
      AND   z.posting_period = posting_period
     SET    z.intlplancode_after_invoice = mc.intlplan_code
          , z.domplancode_after_invoice  = mc.domplan_code ;
     COMMIT ;
     
     # ===================================================================================
     
     
     UPDATE zModem_Census  a
     JOIN   zModem_Census  b
       ON   a.posting_period = b.posting_period
      AND   a.modem_config_id = b.modem_config_id
     SET   a.import_changed_plans_data = (b.intlplancode_before_invoice != b.intlplancode_after_invoice) OR (b.domplancode_before_invoice != b.domplancode_after_invoice)
     WHERE a.posting_period = posting_period ;
     COMMIT ;
     
   END IF ;
   
 END	0 row(s) affected	0.000 sec

Open in new window


With this one large proc I get:  
3	155	16:28:27	DROP PROCEDURE ImportCellModemPlans_ATnT	0 row(s) affected	0.000 sec
3	155	16:28:27

Open in new window

0
 

Author Comment

by:Ralph
ID: 41751276
BTW, just changed that PROC so I hadn't yet cleaned it up and removed superfluous statement.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 26

Expert Comment

by:Zberteoc
ID: 41752608
Try this script:
DELIMITER $$

DROP PROCEDURE IF EXISTS `Census_ImportPlanChange` $$
CREATE DEFINER=`root`@`%` PROCEDURE `Census_ImportPlanChange`(
  IN Pre_OR_Post VARCHAR(50), 
  IN posting_period VARCHAR(50)
)
BEGIN
   
   IF UPPER(Pre_OR_Post) = 'PRE' THEN
       
     UPDATE zModem_Census  AS z
     JOIN   ModemConfig    AS mc
       ON   mc.modem_config_id = z.modem_config_id
      AND   z.posting_period = posting_period
     SET    z.intlplancode_before_invoice = mc.intlplan_code
          , z.domplancode_before_invoice  = mc.domplan_code ;
     COMMIT ;
     
   END IF ;
   
   IF UPPER(Pre_OR_Post) = 'POST' THEN
     
     UPDATE zModem_Census  AS z
     JOIN   ModemConfig    AS mc
       ON   mc.modem_config_id = z.modem_config_id
      AND   z.posting_period = posting_period
     SET    z.intlplancode_after_invoice = mc.intlplan_code
          , z.domplancode_after_invoice  = mc.domplan_code ;
     COMMIT ;
     
     UPDATE zModem_Census  a
     JOIN   zModem_Census  b
       ON   a.posting_period = b.posting_period
      AND   a.modem_config_id = b.modem_config_id
     SET   a.import_changed_plans_data = (b.intlplancode_before_invoice != b.intlplancode_after_invoice) OR (b.domplancode_before_invoice != b.domplancode_after_invoice)
     WHERE a.posting_period = posting_period ;
     COMMIT ;
     
   END IF ;

END $$

DELIMITER ;

Open in new window

Maybe you can delete the definer part.
0
 

Author Comment

by:Ralph
ID: 41757014
Hi Zberteoc,

I don't have root perms on this remote server, so I can't try that.
Putting in my credentials gets me the same as w/o.  No feedback at all that compilation was successful.

It IS successful though.
At EO Compile I put show errors and show warnings commands.
No warnings, no errors.

This didn't used to happen.  It started rather recently when I made the large Proc even larger to its current size of 1353 lines.

It's importing data into 4 tables with a lot of logic to assure no redundancies, and a lot of code for detailed logging and optional debugging select to console evidence of progress.

I guess I can live with the status quo as long as it still compiles w/o errors...

Thanks!
0
 
LVL 26

Accepted Solution

by:
Zberteoc earned 500 total points
ID: 41757027
Yes, you can. Remove that part, I already mentioned that. It was just in the example I used. Here:
DELIMITER $$

DROP PROCEDURE IF EXISTS `Census_ImportPlanChange` $$
CREATE PROCEDURE `Census_ImportPlanChange`(
  IN Pre_OR_Post VARCHAR(50), 
  IN posting_period VARCHAR(50)
)
BEGIN
   
   IF UPPER(Pre_OR_Post) = 'PRE' THEN
       
     UPDATE zModem_Census  AS z
     JOIN   ModemConfig    AS mc
       ON   mc.modem_config_id = z.modem_config_id
      AND   z.posting_period = posting_period
     SET    z.intlplancode_before_invoice = mc.intlplan_code
          , z.domplancode_before_invoice  = mc.domplan_code ;
     COMMIT ;
     
   END IF ;
   
   IF UPPER(Pre_OR_Post) = 'POST' THEN
     
     UPDATE zModem_Census  AS z
     JOIN   ModemConfig    AS mc
       ON   mc.modem_config_id = z.modem_config_id
      AND   z.posting_period = posting_period
     SET    z.intlplancode_after_invoice = mc.intlplan_code
          , z.domplancode_after_invoice  = mc.domplan_code ;
     COMMIT ;
     
     UPDATE zModem_Census  a
     JOIN   zModem_Census  b
       ON   a.posting_period = b.posting_period
      AND   a.modem_config_id = b.modem_config_id
     SET   a.import_changed_plans_data = (b.intlplancode_before_invoice != b.intlplancode_after_invoice) OR (b.domplancode_before_invoice != b.domplancode_after_invoice)
     WHERE a.posting_period = posting_period ;
     COMMIT ;
     
   END IF ;

END $$

DELIMITER ;

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now