Solved

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

Posted on 2016-08-08
7
127 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 27

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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 27

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 27

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

717 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