Re: Amphibious SPL call
Posted in 2005
Have you tried the differnece between
Call myfunc("31/05/2005"::date)
Call myfunc(EXTEND("31/05/2005", YEAR TO FRACTION(3)))
Jonathan Leffler wrote:
> Paul Watson wrote:
>
>>Is it supposed to do this?
>>
>>create function myfunc( DATE ) etc
>>create function myfunc( DATETIME YEAR TO FRACTON(3) ) etc>>
>>Call myfunc("31/05/2005")
>>
>>and I get a 9700 amphibous function. I didn't think there were implicit
>>casts between these types but do forget things
>
>
> The trouble is that there's a cast from string to DATE and a cast from
> string to DATETIME - assuming the FRACTON is only a typo in the posting
> - and that the server has no basis on which to choose either as the
> preferred function, so it can't make its mind up whether to call the
> frog or the toad. (Err...is CALL supported?)
>
> So:
>
> CALL MYFUNC(DATE("31/05/2005")) will work in the UK but not the US (in
> general).
>
> CALL MYFUNC(EXTEND("31/05/2005", YEAR TO FRACTION(3))) will probably
> work - I haven't formally tested it.
>
> You probably can't use DATETIME("31/05/2005") YEAR TO FRACTION(3)
> because the data in the parentheses is not allowed to be anything very
> different from DATETIME(2005-05-31 00:00:00.000) YEAR TO FRACTION(3).
>
> Suggestion: don't take up C++ coding just yet - the ambiguities will get
> you into bigger trouble there.
>
--
Jos' Luis Matute Mart'nez
Responsable Divisi'n Sistemas
Contacto Local del Grupo de Usuarios de Informix en Espa'a
D&D Grupo Dydes
Poligono EUROPOLIS Edif. Al Andalus Calle X, n' 4 y 6
28230 Las Rozas (Madrid)
Tf: +34 91 6407080 Fax: +34 91 6373280
sending to informix-list