Advanced SQL input parameter does not save Japanese.
Question

Hi guys, sorry for any broken English first of all.
I trying to input some Japanese word to my Ext database using Agrregrate and it return "??" in the record. So I change to Advanced SQL and I try several input on it.


Success output with method :

Insert into {Banks_Japan_Import}({Banks_Japan_Import}.[BNK_CD],{Banks_Japan_Import}.[BNK_MEI_KNJ],{Banks_Japan_Import}.[BNK_MEI_KN],{Banks_Japan_Import}.[BNK_SITN_CD],{Banks_Japan_Import}.[TENPO_MEI],{Banks_Japan_Import}.[TENPO_MEI_KN] )
values(1,N'???',N'???',1,N'???',N'???')


Failed with method

Insert into {Banks_Japan_Import}({Banks_Japan_Import}.[BNK_CD],{Banks_Japan_Import}.[BNK_MEI_KNJ],{Banks_Japan_Import}.[BNK_MEI_KN],{Banks_Japan_Import}.[BNK_SITN_CD],{Banks_Japan_Import}.[TENPO_MEI],{Banks_Japan_Import}.[TENPO_MEI_KN] )
values(@BankCode,N@BankName,N@BankName2,@BankBranchCode,N@BankBranchName,N@BankBranchName2)


I know something to do with N'' but I ain't sure how to make this work.

mvp_badge
MVP

Hi

Hi using N'' is correct I believe.

Looks like you are using "varchar" datatype for your columns in the external database. '"rchar" can't store unicode values. Japanese characters will be in unicode format. So try using "nvarchar" instead.

Can you share the table definition as well as the database type?

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi

Hi using N'' is correct I believe.

Looks like you are using "varchar" datatype for your columns in the external database. '"rchar" can't store unicode values. Japanese characters will be in unicode format. So try using "nvarchar" instead.

Can you share the table definition as well as the database type?

Regards,

Daniel

 

 Hi, related columns is set as nvarchar before my testing.

Daniël Kuhlmann wrote:

Hi

Hi using N'' is correct I believe.

Looks like you are using "varchar" datatype for your columns in the external database. '"rchar" can't store unicode values. Japanese characters will be in unicode format. So try using "nvarchar" instead.

Can you share the table definition as well as the database type?

Regards,

Daniel

 The image attached was the output I tried in several ways.

 Those Japanese record Is hardcoded data.
When i try to get data from input parameter, it will return as ??? or N???

mvp_badge
MVP

Hi Chu,

I am still awaiting a reply from OutSystems on this, in the meantime I suggest you create an OutSystems support case asking for help directly from OutSystems.

Regards,

Daniel

Hello,

Late to the party, but as I bumped this same issue just a moment ago and did not see an answer, here's what I did:

Insert into {Banks_Japan_Import}({Banks_Japan_Import}.[BNK_CD],{Banks_Japan_Import}.[BNK_MEI_KNJ],{Banks_Japan_Import}.[BNK_MEI_KN],{Banks_Japan_Import}.[BNK_SITN_CD],{Banks_Japan_Import}.[TENPO_MEI],{Banks_Japan_Import}.[TENPO_MEI_KN] )
values(@BankCode,@BankName,@BankName2,@BankBranchCode,@BankBranchName,@BankBranchName2)

This syntax is ok in Advanced SQL, but all input parameters which can contain NVarchar types need to have Expand Inline parameter property set to Yes, to allow adding Sql Server Native datatype N'' syntax in Values clause.

For example, if @BankName parameter can contain Japanese / Chinese characters, it's expand inline property is set to Yes and input parameter to Advanced SQL widget would be formulated like "N'"+BankName+"'":

There's of course a TrueChange warning about this approach, as enabling expand inline query parameter property can open a SQL injection vulnerability.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.