[midPoint] scriptedsql example

Wojciech Staszewski wojciech.staszewski at diagnostyka.pl
Fri Aug 3 22:58:42 CEST 2018


If you don't want to handle this date as a real date, just convert it to
string using mysql cast function:

select cast(timestamp as char) as timestamp


W dniu 03.08.2018 o 21:27, Frigerio, Joshua pisze:
>> You have:
>> sql.eachRow("SELECT name,timestamp,id,notes,birthdate,netid FROM person "
>> + where, {result.add([__UID__:it.id, __NAME__:it.netid,  ])} );
>>
>> Should be:
>> sql.eachRow("SELECT name,timestamp,id,notes,birthdate,netid FROM person "
>> + where, {result.add([__UID__:it.id, __NAME__:it.netid, notes:it.notes,
>> birthdate:it.birthdate])} );
> Ug, that was right there in the example too, somehow I missed thatŠ.
> Thanks!
>
> Although it doesn¹t work for date fields (datetime or timestamp mysql
> types). If I try to add the ³timestamp² field or the ³birthdate" field, it
> says, ³Got unexpected exception: java.lang.IllegalArgumentException:
> Attribute 'birthdate' type 'class java.sql.Timestamp' is not supported."
> In the schema groovy script, I told it to treat it as a String.class, but
> it doesn¹t work anyway. :-(
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-- 
Wojciech Staszewski
Administrator Systemów Sieciowych
tel. kom: 663 680 236
www.diagnostyka.pl
Diagnostyka Sp. z o. o.
ul. Prof. M. Życzkowskiego 16, 31-864 Kraków
Numer KRS: 0000381559 (Sąd Rejonowy dla Krakowa-Śródmieścia w Krakowie, XI Wydział Gospodarczy KRS)
NIP: 675-12-65-009; REGON: 356366975
Kapitał zakładowy: 33 756 500 zł.

Pomyśl o środowisku zanim wydrukujesz ten e-mail.




More information about the midPoint mailing list