Problem Inserting Foreign Languages Into Ms Sql Using Java
Aug 24, 2004
hi there, i'm having a real problem here.
I have some foreign language encoded characters in the database. They are those characters that makes no sense when using the wrong charset to view them. Now I need to retrieve them from the database and re-insert as unicode so that they can be viewed properly.
Now the problem is this: when I retrieve them from the database using java, some characters tend to contain single quote (') or brackets in there, thus screwing up my whole update statement. Below is the coding I am using. It works when there isn't any single quotes or brackets.
Connection con = db.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select b.en_transID, b.trans_content from translations a, en_translations b where a.en_transID=b.en_transID and a.language_ID='3'");
while (rs.next())
{
String original = rs.getString("En_transID");
byte bytes[] = rs.getBytes("trans_content");
if (bytes != null)
{
String s = new String(bytes, "UTF-16LE");
s = new String(s.getBytes(), "big5");
Statement tempStmt = con.createStatement();
tempStmt.executeUpdate("update En_Translations set trans_content = (N'"+s+"') where En_transID = '"+original+"'");
tempStmt.close();
}
Is there any way to get around this? Please help! Will appreciate it very much!
We have an application we are developing that will run worldwide. When we are searching data for peoples names I would like to use Soundex but I am not sure it works effectivly for any language other than English. Does anyone know if it is effective in Dutch, German, French etc?
I'm playing around with a training-wheel database. I have a table that stores magazine subscription info. I have a lookup table that stores the delivery period, ie. 'weekly', 'monthly', etc. I have a primary key ID field in tblPeriods and a foreign key field in the main table, tblMags. I want to insert data into tblMags without having to memorize the correlation between the period key and the period itself. Here's what I tried first:
INSERT INTO tblMags ( vcName, fkPeriodID ) VALUES ( 'The New Yorker', (SELECT tblPeriods_ID FROM tblPeriods WHERE vcPeriod = 'Weekly'));
This gives the following message:
Server: Msg 1046, Level 15, State 1, Line 6 Subqueries are not allowed in this context. Only scalar expressions are allowed.
I'm thinking there must be a way to insert data like this and take advantage of a foreign key relationship without looking up a value each time. Any ideas?
Hi guys, I have created 3 tables namely Static, Dynamic and Demo... Static has colums FormID(uniqueidentifier, PrimaryKey) and FormName(Nvarchar(50)). Dynamic has colums formID(uniqueidentifier,PrimaryKey) and FormName(Nvarchar(50)). Demo has 4 colums namely ValueID(uniqueidentifier, Primary Key), formID(uniqueidentifier, foreign key), Name(nvarchar(50)), Value(nvarchar(50).
Now the formID coloum in Demo table i have set as foreign key to both the dynamic table as well as static table on the formID colum in both table.
Now first i insert a row in the dynamic table then take the uniqueidentifier which is generated automatically and try to insert in the Demo table in formID colum as that colum is FK to dynamic and static but when i try to insert a row it show that its violating the FOREIGN KEY CONSTRAINT
the exact error is
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Demo_Dynamic1". The conflict occurred in database "huzefaJTest", table "dbo.Dynamic", column 'formid'.
Ok, I'm really new at this, but I am looking for a way to automatically insert new records into tables. I have one primary table with a primary key id that is automatically generated on insert and 3 other tables that have foreign keys pointing to the primary key. Is there a way to automatically create new records in the foreign tables that will have the new id? Would this be a job for a trigger, stored procedure? I admit I haven't studied up on those yet--I am learning things as I need them. Thanks.
in my project I am using three languages in one data base (English, Arabic, Turkish), the problem is when i search about arabic character, there is no results, and when i change the default language to Arabic and search about turkish character there is no result.
what can i do to solve this problem?? plzzzzzz answer me..
I need to create databases in other languages (ie French, German, Spanish). Basically what I have learned all that needs to be modified from my current English DDL is the collation.
My question is regarding indexes in these other languages. Will indexes that I currently have in English work in French, German, or Spanish as long as I have the correct collation set at the database level?
In SQL Server 2005 standar edition, is it possible to change the language for the product during the installation? I mean, if I purchase the product in a Spanish spoken country; However, I want my SQL 2005 in English, can I swicht language during the install process? I an buying the software and the salesman says that I can chosse the language during the install, is that true?
how to configure sql server 2005 to support foreign language? i mean, i need to support asian language in my sqlserver. what are the things to consider while designing the table and the databases as well as entering the data to the table.
It would be fine if someone could reply me with all the detail configuration and things to consider if i am to let my sqlserver support chinese language.
Hi,Can the English version of Sql Server (or other DBMSs) store data/records inother languages (e.g. French, Chinese, etc.) ordo you have to use the French version of Sql Server to store French data?Where can I go to read more on this?Thanks.Eric
I have been thinking of using SQL server 2005 as i would like the flexibility i get through UDT. Retrieving the UDT data in managed could is ok but i would like to retrieve it in non .NET languages too.
For example lets say i create a UDT "Point". I insert data in a table that has some columns of type point.
Now is there a way i can get the data of the type point in a point object in non .NET languages like perl, python...
My source is Excel and one column has data in different languages. But when i try loading it to my Database errant data gets loaded. I tried loading data to Flat file with no success.
Hi, I Use Ajax auto suggest text box. this autosuggest text box lookup throw table string field(nvarchar).It works find for Numbers and English words. But When I use LTR languages like arabic,the textbox does not show anything at all. I use UTF-8 and when I search this field it leads to correct results. and I use "sql Latin1 CP CI AS"but I don't know what is the problem with it.
All, I am working on a project where I need to save numberous unicode languages in the same table (Chinese, Japanese, Thai, etc.). I understand that I need to setup the columns to use the nchar, nvarchar, etc. as a column data type. What I am struggling with is which coalation to use. Is there a generic Unicode coallation that I can/should use on the DB, along with the nchar, nvarchar, etc. and making sure that my code is using the N declaration before all string values that are going into the DB. Is there anything that I am missing on setting up the DB to support this?
Is it possible to store multiple languages in one sql server.Now i have a sqlserver with US English.Can i store spanish and french data in the DB?If possible how can i store it...?
Is there a way to make a single insert (in a loop) and take system dates and insert them in different languages without making a new loop for each language.
Hi, I have got a column which should multi languages data(Chinese,English etc). Source for this data is Excel. I have kept this column DataType as NVARCHAR but Chinese data is shown as 'Boxes'.But when i copy this and paste on Query pane i get proper data.
I need help if any one can... My need is that...I am devloping my Cube using SSAS. I want to access my cube in multi languages e.g.: English, Japanese or other. At the movement I have two languages description in SQL Database like English and Japanese.
But In SSAS Translations, I can translate Measures Groups, Dimensions, Perspectives, KPIs, Actions, Named Sets & Calculated Members names. But there will be a need to Map Columns as per selected Lenguage so that I can display in proper language data.
Suppose I select Japanese the description should come from Column where Japanese description is stored.
OR any othere method by doing I can see my reports/data in any language.
Hi,I am tasked with creating a site in two languages: English and Farsi (Persian), which is a right-to-left language.I am having problems with the Faris version when it comes to stroing and retrieving data. I can use Farsi fonts and type data into tables, but when I try to retrieve them they are displayed as ?????. I check the table and it says there were problems retriving data and asks to run the query again. When I click on "Execute SQL", the content of the fields that were in Farsi change to ?????.I am new to MS-SQL and would appreciate it if you could tell me how to set up non-English database.TIA.
I have an access database that is storing text in english and chinese characters. I am importing the data using SSIS and it is putting a 'square' character in place of all the chinese characters. Can I associate multiple code pages to a control? If this is not possible, I would just like to Extract the data and Load it into a table, and i will just handle the errors and write the key fields to an error log. The problem is that the error handler is not redirecting the row. It just simply fails. I have changed all the error actions to Redirect Row too. I currently have a script checking if the 'square' character exists but i feel this should be handled a better way? Has anyone run into this issue or have any suggestions??
This is the error code i get
Data conversion failed. The data conversion for column "FDCDOPS0" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
I have a view that retrieves the details for sys.messages in SQL Server Express and noticed that the language ID is 1033 (U.S. English). I will need French and Portuguese, and understand that these are standard. Is there a set of DDL Scripts that will install the sys.messages for these languages?
we'd like our users to have the option of choosing the language (eg French) for column headings (maybe report heading too). I'm sure I'd have to provide the translations somehow but I'd like to know what feature, if any in RS2005 comes the closest to doing/supporting this, even if it is something like making column headings themselves dependent on a variable?
I Have the same problem, i execute the T-sql statement select * from sys.fulltext_languages and i get zero rows, i uninstalled and installed again and nothing happend i still have zero when executing that statement, i try another computer and there evrything went fine!.. i do have Microsoft Net framework, and everything but i still can get this to work! help please!!!
I have SQL Server 2005 Developer Edition installed on my PC. I also have the Express Editions of VB and C# installed. Is there any purpose served in my installing SQL Express, also?
I've read comments that the Express languages can only connect to SQL Express databases and not SQL Server 2005 databases; however, I'm not sure how that is enforced. The 'connect to database' wizard does seem to be different in the Express IDE than it is in Visual Studio.
I've read other Express language references that say that they can only connect to SQL Server databases via something called User Instances; however, it's not clear to me if that infers that only SQL Express supports User Instances.
Regarding User Instances, it's not clear to me whether this technology is for single-user (i.e., exclusive) access or not. What scenarios are User Instances good for?
We have a database where the nvarchar columns currently holding English only data. It keeps the training information. Currently the default collation is Latin Case insensitive accent insensitive.
Now we are planning to allow multiple language support. When we go for it, we will upload the data from different languages. Based on user preferences, he/she should be able to query the data (One language at a time).
I am worried on how the existing queries will work if I load all language data in the same database.
For example, some characters in English are used in Norwegian too. But they have different sort order. ALso LIKE conditions too may fail.
So far I thought of few solutions: Add the Collation information along with select , order by clauses. It means we need to add more procedures (one set per collation) The other option is to create new database for each language. Each will have its own collation. The dowside is we need more databases which may lead to more servers and more maintenance work.
Can I specify a collate value for a column in a table that includes all the possible languages in the world or atleast Latin 1 and Eastern European languages.
My DB Collation is set to Latin 1 and the columns in the tables are all nvarchar or ntext, but certain hungarian characters are not displayed correctly.
What do all these collation codes represent:
SQL_EBCDIC037_CP1_CS_AS
211
SQL_EBCDIC273_CP1_CS_AS
212
SQL_EBCDIC277_CP1_CS_AS
213
SQL_EBCDIC278_CP1_CS_AS
214
SQL_EBCDIC280_CP1_CS_AS
215
SQL_EBCDIC284_CP1_CS_AS
216
SQL_EBCDIC285_CP1_CS_AS
217
SQL_EBCDIC297_CP1_CS_AS
They seem generic. Is there one collation that includes all the Eastern Europen Languages and Latin 1 charset. Please let me know.
I've downloaded SQL Server Express with Advanced Services from http://msdn.microsoft.com/vstudio/express/sql/download/ and installed all components. When I try to create a full-text catalog, I get the following message:
No full-text supported languages found.
select * from sys.fulltext_languages returns no lines.
How can neutral, English or maybe Hungarian word breakers be installed?