Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Executing "store service" with date field adds 'TO_DATE' to the SQL. Function unknow to
Executing "store service" with date field adds 'TO_DATE' to the SQL. Function unknow to [message #1535632] Mon, 29 December 2014 20:51 Go to next message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 12
Registered: July 2014
Location: Bassevelde
Junior Member
Hi,

When executing "store service" with a date field in, 'TO_DATE' is added in the generated SQL.
MySQL does not know this function.

the code snippet where this is happening is below :

 public DrankenFormData store(DrankenFormData formData) throws ProcessingException {
    if (!ACCESS.check(new UpdateDrankenPermission())) {
      throw new VetoException(TEXTS.get("AuthorizationFailed"));
    }
    String cSQL;

    cSQL = "call sp_tdtdrank_update1(:omschr, " +
        ":grdnplat, " +
        ":alcvol, " +
        ":alcgew, " +
        ":drnktypnr, " +
        ":srtgew, " +
        ":orggrav, " +
        ":specgrav, " +
        ":fingrav, " +
        ":ibu, " +
        ":srm, " +
        ":ebc, " +
        ":co2bier, " +
        ":co2fles, " +
        ":co2vat, " +
        ":mindagfles, " +
        ":mindagvat, " +
        ":gebrkrnrup, " +
        ":datupdate, " +
        ":dranknr, " +
        ":updteller) ";

    SQL.update(cSQL, formData);

    return formData;
  }



In the server log, I found that this is send to MySQL :

CALL SP_TDTDRANK_UPDATE1 ( 'Orvalletje' , 14.0 , 6.2 , 4.96 , 1 , 1.0 , 0.0 , 0.0 , 0.0 , 32.0 , 0.0 , 22.0 , 0.0 , 0.0 , 0.0 , 270 , 270 , NULL , [b]TO_DATE ( '19.07.2014 00:00:00' , 'dd.mm.yyyy hh24:mi:ss' )[/b] , '6' , NULL )


If I copy this to the mysql command line i get the following error :
mysql> CALL SP_TDTDRANK_UPDATE1 ( 'Orvalletje' , 14.0 , 6.2 , 4.96 , 1 , 1.0 , 0.0 , 0.0 , 0.0 , 32.0 , 0.0 , 22.0 , 0.0 , 0.0 , 0.0 , 270 , 270 , NULL , TO_DATE ( '19.07.2014 00:00:00' , 'dd.mm.yyyy hh24:mi:ss' ) , '6' , NULL );
ERROR 1305 (42000): FUNCTION albatrostest.TO_DATE does not exist


Is there a way to circumvent this behaviour ?
The date type used is java.util.Date

I found somewhere that TO_DATE would be a MSSQL function, but it is not a mysql function.

Kind regards

Tore
Re: Executing "store service" with date field adds 'TO_DATE' to the SQL. Function unknow [message #1535706 is a reply to message #1535632] Mon, 29 December 2014 21:51 Go to previous message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 12
Registered: July 2014
Location: Bassevelde
Junior Member
Issue probably can be closed.
I have not yet found the reason why, but now the stored procedure works and data is updated correctly.
Probably there is somewhere a difference between what is logged in the console and what is send to the database.



Previous Topic:Widget is disposed Exception when all Outline Pages are closed
Next Topic:Complete Scout Newbie
Goto Forum:
  


Current Time: Wed Oct 18 09:34:43 GMT 2017

Powered by FUDForum. Page generated in 0.01701 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software