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!
View 1 Replies
ADVERTISEMENT
May 11, 2006
Hi
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?
View 7 Replies
View Related
May 11, 2008
Hi,
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?
Mike
View 6 Replies
View Related
Feb 17, 2006
How do I go about inserting records on a table that has a PK/FK relationship with another table?? I get a foreign key error everytime I try :)
View 1 Replies
View Related
Oct 26, 2007
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'.
The statement has been terminated.
please if anyone know do reply.....
View 3 Replies
View Related
Sep 13, 2006
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.
View 4 Replies
View Related
Apr 5, 2007
Can anybody tell me of any documentation or books that talk about working SQL and other Languages and give examples.
Thanks
Danny Dubroc
View 1 Replies
View Related
Apr 27, 2007
Hi,
how to defined add a language to the language selection on the Full-text Specification in columns designed like "Arabic language".
Regards
View 4 Replies
View Related
Aug 15, 2004
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..
View 2 Replies
View Related
Sep 17, 2007
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?
View 1 Replies
View Related
Oct 31, 2007
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?
THX
View 1 Replies
View Related
Sep 25, 2015
I was wondering if there was a strong need to learn scripting languages to elevate your level of skill, in regards to database development.
Would Python or Powershell be good to pick up to handle tasks in and outside of the RDMBS?
View 7 Replies
View Related
Jan 11, 2007
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.
View 4 Replies
View Related
Jul 20, 2005
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
View 1 Replies
View Related
Apr 14, 2007
HELLO ALL!
select * from sys.fulltext_languages
this query results nothing, so I need to add languages to sqlserver to be used with FTS.
Is there any way to do that???
THANK YOU!!!
View 6 Replies
View Related
Aug 17, 2006
Is it possible to a memo field in English and another memo field in say, Chinese or Frech or anything other than English in the same table?
Thanks.
View 1 Replies
View Related
Jan 9, 2007
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...
View 1 Replies
View Related
Jan 24, 2008
Hi,
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.
Thanks in advance.
View 1 Replies
View Related
Aug 26, 2007
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.
View 3 Replies
View Related
Apr 11, 2005
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?
Thanks,
Richard
View 2 Replies
View Related
Jul 14, 2004
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...?
Thanks.
View 1 Replies
View Related
Mar 31, 2014
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.
Example
Create table dateLanguage(
monthName nvarchar(20),
monthNameEs nvarchar(20),
monthNameFr nvarchar(20),
MonthNamePt nvarchar(20)
)
So for example
January,
Enero,
Janvier,
janeiro
View 3 Replies
View Related
Feb 5, 2008
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.
Is the first thing doable?
Hoe can i accomplish this?
Thnks
View 2 Replies
View Related
Mar 1, 2007
Dear Friends..
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.
Please Help...
View 7 Replies
View Related
Sep 1, 2006
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.
View 16 Replies
View Related
Feb 27, 2006
Hi,
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.".
View 5 Replies
View Related
Feb 19, 2006
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?
thanks,
Flavelle
View 1 Replies
View Related
Nov 16, 2007
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?
View 5 Replies
View Related
Sep 3, 2006
Hi,
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!!!
View 7 Replies
View Related
Apr 6, 2006
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?
View 3 Replies
View Related
Jul 29, 2011
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.
View 9 Replies
View Related
Jul 13, 2006
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.
Thanks,
Manisha
View 6 Replies
View Related
Aug 2, 2006
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?
Thanks
View 10 Replies
View Related