Solved

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

Posted on 2016-08-08
7
126 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…

730 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