Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot query Arabic and Japanese text in sql database

I have one table in sql db where I store sentences in three languages: Arabic , English , and Japanese

scheme


    CREATE TABLE [dbo].[Buns]
    (
        [ID] INT NOT NULL PRIMARY KEY IDENTITY,
        
        [ENTRY] NVARCHAR(50) NULL, 
        [LEVEL] NCHAR(10) NULL,
        [JAPANESE] NVARCHAR(MAX) NULL, 
        [ARABIC] NVARCHAR(MAX) NULL, 
        [ENGLISH] NVARCHAR(MAX) NULL, 
        
    )

sample data
https://i.imgur.com/ARL1PmL.png

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I can query the English sentences only

The commented statements don’t yield any result
https://i.imgur.com/6KOZV2y.png

SELECT ARABIC, JAPANESE , ENGLISH
FROM dbo.Buns
--WHERE JAPANESE = '私は良子に花をあげた。'
--WHERE ARABIC = 'أعطيت لهاناكو زهرة';
WHERE ENGLISH = 'I gave Yoshiko flowers';

appreciate your support with clear steps as am still a beginner

thanks

>Solution :

To specify an nvarchar string literal, you need to prefix it with N:

SELECT ARABIC, JAPANESE, ENGLISH
FROM dbo.Buns
WHERE ARABIC = N'قيمة للبحث عنها'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading