Home » Eclipse Projects » Eclipse 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 |
Tore Van Grembergen Messages: 19 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
|
|
| |
Goto Forum:
Current Time: Sat Apr 20 02:41:36 GMT 2024
Powered by FUDForum. Page generated in 0.03529 seconds
|