Solved

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

Posted on 2016-08-08
7
124 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

790 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