MySQL Forums
Forum List  »  MySQL Workbench

Workbench Stored Procedure not working with date '0000-00-00'
Posted by: Guru Cus
Date: September 14, 2008 04:56AM

Hi all,

I'm using MySQL Workbench for some time now, together with MySQL Query Broswer.

I export the SQL statements for my schema with the forward engineer... option.
Then load and execute the script in MySQL Query Broswer.

Today I dropped the schema and made a new one with a fresh generated script.

Thing is now, that it complains about invalid date value '0000-00-00' when I execute my Stored Procedure (INSERT statement).
I 'edited' (nothing changed, just chose 'edit') the stored procedure in the Query Browser and executed it again (drops and recreates it)

Now it just accepts '0000-00-00' and inserts the record.

So whats the difference between the script of Workbench and the Query Browser?
And how do I solve this without executing it again?


here's the whole script as exported by Workbench

this is the stored procedure executed again in Query Browser:
DELIMITER $$

DROP PROCEDURE IF EXISTS `prosidex`.`SP_tblOrder_INSERT` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_tblOrder_INSERT`(
    inOrderNumber   VARCHAR(45),
    inFK_CustomerID INT,
    inFK_PaymentTypeID  INT,
    inOrderDate     VARCHAR(15),
    inLCShipmentDate    VARCHAR(15),
    inLCExpiryDate  VARCHAR(15),
    inTurnover      DECIMAL(10,2),
    inCurrency      INT,
    inCurrencyRate  DECIMAL(3,2),
    inProfit        DECIMAL(10,2),
    inInstrDasbach  VARCHAR(15))
BEGIN
  INSERT INTO tblOrder (OrderNumber, FK_CustomerID, FK_PaymentTypeID, OrderDate, LCShipmentDate, LCExpiryDate, Turnover, Currency, CurrencyRate, Profit, InstrDasbach)
  VALUES(   inOrderNumber, inFK_CustomerID, inFK_PaymentTypeID, STR_TO_DATE(inOrderDate, '%d-%m-%Y'),
            STR_TO_DATE(inLCShipmentDate, '%d-%m-%Y'), STR_TO_DATE(inLCExpiryDate, '%d-%m-%Y'),
            inTurnover, inCurrency, inCurrencyRate, inProfit, STR_TO_DATE(inInstrDasbach, '%d-%m-%Y'));
END $$

DELIMITER ;



Edited 1 time(s). Last edit at 09/14/2008 04:57AM by Guru Cus.

Options: ReplyQuote


Subject
Views
Written By
Posted
Workbench Stored Procedure not working with date '0000-00-00'
7940
September 14, 2008 04:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.