Hi,

This worked for me:

SELECT CONVERT(test,CHAR(5))
FROM (SELECT CONVERT('test',CHAR(5)) AS test)

Regards,

Fred

2015-04-10 18:21 GMT-03:00 Fred&Dani&Pandora&Aquiles <[email protected]>:

> Hi,
>
> I'm not able to test this now, but I think you inverted the parameters of
> the convert function:
>
> CONVERT ( value <http://www.h2database.com/html/grammar.html#value> ,
> dataType <http://www.h2database.com/html/grammar.html#data_type> )
>
> Regards,
>
> Fred
> Em 10/04/2015 13:14, <[email protected]> escreveu:
>
>> Hi,
>>
>> I'm using h2-1.4.186 in a java program. I'm using
>> Mode.getInstance("MSSQLServer").swapConvertFunctionParameters = true to
>> swap parameters of the convert function (to use CONVERT(dataType, value).
>> When I want to execute the following query
>>
>>> SELECT CONVERT(CHAR(5), test)
>>> FROM (SELECT CONVERT(CHAR(5),'test') AS test)
>>
>> I have this message
>>
>>> SELECT CONVERT(CHAR(5), test)
>>> FROM (SELECT CONVERT(CHAR(5),'test') AS test) : Unknown data type: "'";
>>> SQL statement:
>>> SELECT
>>>     CONVERT('test',CHAR(5)) AS TEST
>>> FROM SYSTEM_RANGE(1, 1) [50004-186]
>>
>>
>> That happens when I do a SELECT CONVERT into a FROM
>> Why the parameters of the second CONVERT are swaped during the execution
>> ? How can I fix ?
>>
>> Thanks
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to