How to find workaround for xml.value() function in babelfish?

1

We encountered an xml issue during the poc of babelfish migration, how to rewrite a user define function based on 64-bit encryption that is very common in sql server. The following code you can find on many web site

CREATE FUNCTION [dbo].[FnBase64Encode](@src varchar(max))
  RETURNS VARCHAR(max)
as
begin
  declare @bin varbinary(max)
  set @bin=Convert(varbinary(max), @src)
  return cast(N'' as xml).value('xs:base64Binary(xs:hexBinary(sql:variable("@bin")))', 'varchar(max)')
end
GO

We know that the current version of babelfish(1.2.1) does not support xml methods such as xml.node and xml.value, is there any solution or sample code for this case?

AWS
已提問 2 年前檢視次數 323 次
1 個回答
0
已接受的答案

Hi, @Colin Tang.

As you understand, the XML feature of T-SQL is not supported in Babelfish 1.2.1 as of today.

If you want to do XML operations like this, you need to connect to the Aurora PostgreSQL port and consider whether you can use PostgreSQL's XML Functions instead.

profile picture
專家
iwasa
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南