Which DBMS is that SQL for?

In standard SQL and Calcite (and Oracle [1]), the CONVERT function changes the 
encoding of a character string. But I don’t think you mean that.

Julian

[1] 
https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions027.htm#SQLRF00620
 
<https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions027.htm#SQLRF00620>

> On Feb 20, 2020, at 6:25 AM, Danny Chan <[email protected]> wrote:
> 
> From varchar to date?
> 
> Suresh Krishnan <[email protected]>于2020年2月20日 周四下午1:55写道:
> 
>> Hi Team,
>> 
>> We are having trouble finding the right approach to convert the date
>> fields using calcite.
>> 
>> We are looking for something that will give us the below SQL equivalent
>>                SELECT CONVERT(varchar(12), GETDATE(), 101)         -
>> 06/29/2009
>> 
>> We have tried creating a rexNode using the below method. But it didn't
>> yield the expected result.
>> RelDataType type =
>> builder.getTypeFactory().createSqlType(SqlTypeName.DATE);
>> RexNode rexNode2 = builder.getRexBuilder().makeCall(type,
>> SqlStdOperatorTable.CONVERT, rexNodes);
>> 
>> 
>> Could you please help with this request?
>> 
>> Thanks,
>> Suresh Krishnan
>> This message, together with any attachments, is intended only for the use
>> of the individual or entity to which it is addressed and may contain
>> confidential and/or privileged information. If you are not the intended
>> recipient(s), or the employee or agent responsible for delivery of this
>> message to the intended recipient(s), you are hereby notified that any
>> dissemination, distribution or copying of this message, or any attachment,
>> is strictly prohibited. If you have received this message in error, please
>> immediately notify the sender and delete the message, together with any
>> attachments, from your computer. Thank you for your cooperation.
>> 

Reply via email to