I have a problem when I do a SQL query with Hebrew:
"select ProductName From Products WHERE TypeOfProduct ='מעבד'"
I have TypeOfProduct
set, that's have the value 'מעבד', but the query returns null
.
If I replace the hebrew word in something like numbers or english words, everything goes fine.
How do I use hebrew in SQL queries?
An SQL SELECT statement retrieves records from a database table according to clauses (for example, FROM and WHERE ) that specify criteria. The syntax is: SELECT column1, column2 FROM table1, table2 WHERE column2='value';
This IDE is specially designed for C and C++ and easy to use. SQLAPI++ is a C++ library (basically a set of header files) for accessing multiple SQL databases (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase, MySQL, PostgreSQL, SQLite, SQL Anywhere and ODBC).
The lists in the following sections provide a functional summary of SQL statements and are divided into these categories: Data Definition Language (DDL) Statements. Data Manipulation Language (DML) Statements.
You should use Unicode by using the "N" prefix before the string i.e. N'מעבד' in your where clause...
select ProductName From Products WHERE TypeOfProduct = N'מעבד'
You also need to make sure that your column is of type nvarchar
and not varchar
.
If you cannot use nvarchar
and Unicode string you will have to change the collation of your database from LATIN
to HEBREW
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With