Showing posts with label language. Show all posts
Showing posts with label language. Show all posts

Monday, March 26, 2012

multi lingual where clause

I have a table with nvarchar column. In query analyzer when I run query with foreign language words that are already there in database it dose not return any rows

To test it I returned rows with Select * table. Then from result window I copy chinese characters and put it in SQL where clause in SQL analyzer .When I run query it dose not return results.

What could be the cause..its SQL 2k

found it add N infront of characters|||

As kyus94 indicated, to use UNICODE characters, including Chinese, you must preface the string with the character [ N ].

For example,

SELECT

Column1,

Column2,

etc

FROM MyTable

WHERE Column3 = N'ThisCouldBeChinese'

(Note the character No immediately before (no space) the string.)

sql

Multi Language Report Function

I have written a function which translates text based upon the language the
user chooses to see the report in (it can also be passed in as a data driven
parm for static runs) Anyway ... my question is this ... since I am new to RS
and new to Vb .Net I was wondering if someone out there can look at what I am
trying to do and suggest a better way ... since I dont want to have to code a
function like this for 25+ fields to be translated and in 4+ languages. I
think when you see the function I wrote you will get the idea and perhaps be
able to suggest an efficient way to translate all fields at once or perhaps
"generic" function (which I tried to code too with nested CASE statements but
abandoned). Anyway ... here is the newbie's (my) solution - dont laugh :-)
This is what I code in the text box for the expression ===>
=Code.TranslateTitle(Parameters!pm_language_code.value)
HERE IS THE FUNCTION
Function TranslateTitle ( ByVal Language_Code As String ) As String
Select Language_Code
Case "EN"
Return "Detailed Report : "
Case "FR"
Return "Rapport Détaillé : "
Case "DE"
Return "Ausführlicher Report : "
Case "NL"
Return "Gedetailleerd Rapport : "
Case Else
Return "Detailed Report : "
End Select
End Function
This works just fine ... but I have 25+ fields with translations !!!
Thanks in advanceHi,
You can use resource files just as in ASP.NET applications.
You can reference these resource dll files within a function written as a
custom code.
Eralper
http://www.kodyaz.com
"MJ Taft" wrote:
> I have written a function which translates text based upon the language the
> user chooses to see the report in (it can also be passed in as a data driven
> parm for static runs) Anyway ... my question is this ... since I am new to RS
> and new to Vb .Net I was wondering if someone out there can look at what I am
> trying to do and suggest a better way ... since I dont want to have to code a
> function like this for 25+ fields to be translated and in 4+ languages. I
> think when you see the function I wrote you will get the idea and perhaps be
> able to suggest an efficient way to translate all fields at once or perhaps
> "generic" function (which I tried to code too with nested CASE statements but
> abandoned). Anyway ... here is the newbie's (my) solution - dont laugh :-)
> This is what I code in the text box for the expression ===>
> =Code.TranslateTitle(Parameters!pm_language_code.value)
> HERE IS THE FUNCTION
> Function TranslateTitle ( ByVal Language_Code As String ) As String
> Select Language_Code
> Case "EN"
> Return "Detailed Report : "
> Case "FR"
> Return "Rapport Détaillé : "
> Case "DE"
> Return "Ausführlicher Report : "
> Case "NL"
> Return "Gedetailleerd Rapport : "
> Case Else
> Return "Detailed Report : "
> End Select
> End Function
> This works just fine ... but I have 25+ fields with translations !!!
> Thanks in advance|||Thanks for your response however I dont know asp .net - in fact ... just got
a book to learn it. So I dont know how to do what you are suggesting here.
Could you be more specific? Point to a simple example maybe?
"eralper" wrote:
> Hi,
> You can use resource files just as in ASP.NET applications.
> You can reference these resource dll files within a function written as a
> custom code.
> Eralper
> http://www.kodyaz.com
> "MJ Taft" wrote:
> > I have written a function which translates text based upon the language the
> > user chooses to see the report in (it can also be passed in as a data driven
> > parm for static runs) Anyway ... my question is this ... since I am new to RS
> > and new to Vb .Net I was wondering if someone out there can look at what I am
> > trying to do and suggest a better way ... since I dont want to have to code a
> > function like this for 25+ fields to be translated and in 4+ languages. I
> > think when you see the function I wrote you will get the idea and perhaps be
> > able to suggest an efficient way to translate all fields at once or perhaps
> > "generic" function (which I tried to code too with nested CASE statements but
> > abandoned). Anyway ... here is the newbie's (my) solution - dont laugh :-)
> >
> > This is what I code in the text box for the expression ===>
> >
> > =Code.TranslateTitle(Parameters!pm_language_code.value)
> >
> > HERE IS THE FUNCTION
> >
> > Function TranslateTitle ( ByVal Language_Code As String ) As String
> > Select Language_Code
> > Case "EN"
> > Return "Detailed Report : "
> > Case "FR"
> > Return "Rapport Détaillé : "
> > Case "DE"
> > Return "Ausführlicher Report : "
> > Case "NL"
> > Return "Gedetailleerd Rapport : "
> > Case Else
> > Return "Detailed Report : "
> > End Select
> > End Function
> >
> > This works just fine ... but I have 25+ fields with translations !!!
> >
> > Thanks in advance

Multi Language Form

Hi,

I have a table in an MS SQL 2000 database that represents fields on a form.

CREATE TABLE [dbo].[TagData](
[FieldName] [nvarchar](255),
[UserID] [int] NOT NULL,
[Data] [nvarchar](255)
)

A requirement has come up where some of these fields must contain Hebrew, or any other unicode character, data and some of the fields will be English. How can I go about saving and retrieving this information.

The current solution is a legacy Classic ASP application and I suspect I am going to have to redo this in ASP.Net

Thanks,
Leon

Since the data type in the table is nvarchar, you can store any unicode values.

You select/insert into the table as normal way of inserting the data there will not be any difference in doing DML operations.

Sample insert statement is as follows:

INSERT INTO TagData values(N'Sample Field', 10, N'Sample Data'); --> please "N" is for specifying it as nvarchar.

When you want to display content in ASP.Net depending on the language setting, we have to use localization and Globalization concepts in ASP.Net

Following URL will provide you more info on the same in ASP.Net:

http://www.codeproject.com/useritems/localization.asp

|||

I found this link which helped a lot.

http://www.microsoft.com/globaldev/getWR/steps/wrg_codepage.mspx

sql

Multi Language

Can anyone give insight on the proper way to store names in a multi
language database? For instance in English we store First, Middle,
Last. In Spanish there could be multiple last names. In Chinese the
whole name is only one name, (fits in one field). Any experience with
something like this?
Peter Cwik
It really depends on the requirements of the application, and whether you
are attempting to separate family name from given name, or preserve name
order for presentation. (In different cultures, the first name is the
family name, whereas in English, the first name is the given name.)
You may have different rules for different localizations, in defining what
is FirstName and LastName, but also have a common FullName field that is
populated in a language-specific or culture-specific manner.
Again, your business requirements will have much to do with the solution.
Cheers,
'(' Jeff A. Stucker
\
Senior Consultant
www.rapidigm.com
"Peter Cwik" <cwik4@.cox.net> wrote in message
news:1135790334.343599.101660@.z14g2000cwz.googlegr oups.com...
> Can anyone give insight on the proper way to store names in a multi
> language database? For instance in English we store First, Middle,
> Last. In Spanish there could be multiple last names. In Chinese the
> whole name is only one name, (fits in one field). Any experience with
> something like this?
> Peter Cwik
>
|||In general, "Family Name" and "Given Name" are less confusing than
"First", "Last", "Christian", "Sur", etc on multi-language forms. A
simple way to organize the columns might be something like this:
NameID(pk), FamilyName, GivenName, Name2, Name3,Name4, NameType --
where FamilyName is the only required name field and NameType is a
foreign key describing the naming convention of that particular person.
So long as the order preference is spelled out in the NameType, I don't
see a reason to distinguish between a middle name, second given name,
or second family name. You can use CASE to distinguish between them in
your select statements:
SELECT CASE NameType
WHEN '3a' THEN GivenName +' '+ Name4 +' '+ FamilyName
WHEN '4b' THEN Name2 +' '+ GivenName +' '+ FamilyName
WHEN '5c' THEN FamilyName +' '+ GivenName
ELSE GivenName+' '+FamilyName END AS FullName
>From Table1
(If you want, you could nest the CASEs so that they check fields for
null values before plugging them in so as to allow people to predict
naming conventions that might apply after marriage, confirmation, etc.)
--L

Multi Language

Can anyone give insight on the proper way to store names in a multi
language database? For instance in English we store First, Middle,
Last. In Spanish there could be multiple last names. In Chinese the
whole name is only one name, (fits in one field). Any experience with
something like this?
Peter CwikIt really depends on the requirements of the application, and whether you
are attempting to separate family name from given name, or preserve name
order for presentation. (In different cultures, the first name is the
family name, whereas in English, the first name is the given name.)
You may have different rules for different localizations, in defining what
is FirstName and LastName, but also have a common FullName field that is
populated in a language-specific or culture-specific manner.
Again, your business requirements will have much to do with the solution.
--
Cheers,
'(' Jeff A. Stucker
\
Senior Consultant
www.rapidigm.com
"Peter Cwik" <cwik4@.cox.net> wrote in message
news:1135790334.343599.101660@.z14g2000cwz.googlegroups.com...
> Can anyone give insight on the proper way to store names in a multi
> language database? For instance in English we store First, Middle,
> Last. In Spanish there could be multiple last names. In Chinese the
> whole name is only one name, (fits in one field). Any experience with
> something like this?
> Peter Cwik
>|||In general, "Family Name" and "Given Name" are less confusing than
"First", "Last", "Christian", "Sur", etc on multi-language forms. A
simple way to organize the columns might be something like this:
NameID(pk), FamilyName, GivenName, Name2, Name3,Name4, NameType --
where FamilyName is the only required name field and NameType is a
foreign key describing the naming convention of that particular person.
So long as the order preference is spelled out in the NameType, I don't
see a reason to distinguish between a middle name, second given name,
or second family name. You can use CASE to distinguish between them in
your select statements:
SELECT CASE NameType
WHEN '3a' THEN GivenName +' '+ Name4 +' '+ FamilyName
WHEN '4b' THEN Name2 +' '+ GivenName +' '+ FamilyName
WHEN '5c' THEN FamilyName +' '+ GivenName
ELSE GivenName+' '+FamilyName END AS FullName
>From Table1
(If you want, you could nest the CASEs so that they check fields for
null values before plugging them in so as to allow people to predict
naming conventions that might apply after marriage, confirmation, etc.)
--L

Multi Language

Can anyone give insight on the proper way to store names in a multi
language database? For instance in English we store First, Middle,
Last. In Spanish there could be multiple last names. In Chinese the
whole name is only one name, (fits in one field). Any experience with
something like this?
Peter CwikIt really depends on the requirements of the application, and whether you
are attempting to separate family name from given name, or preserve name
order for presentation. (In different cultures, the first name is the
family name, whereas in English, the first name is the given name.)
You may have different rules for different localizations, in defining what
is FirstName and LastName, but also have a common FullName field that is
populated in a language-specific or culture-specific manner.
Again, your business requirements will have much to do with the solution.
--
Cheers,
'(' Jeff A. Stucker
\
Senior Consultant
www.rapidigm.com
"Peter Cwik" <cwik4@.cox.net> wrote in message
news:1135790334.343599.101660@.z14g2000cwz.googlegroups.com...
> Can anyone give insight on the proper way to store names in a multi
> language database? For instance in English we store First, Middle,
> Last. In Spanish there could be multiple last names. In Chinese the
> whole name is only one name, (fits in one field). Any experience with
> something like this?
> Peter Cwik
>|||In general, "Family Name" and "Given Name" are less confusing than
"First", "Last", "Christian", "Sur", etc on multi-language forms. A
simple way to organize the columns might be something like this:
NameID(pk), FamilyName, GivenName, Name2, Name3,Name4, NameType --
where FamilyName is the only required name field and NameType is a
foreign key describing the naming convention of that particular person.
So long as the order preference is spelled out in the NameType, I don't
see a reason to distinguish between a middle name, second given name,
or second family name. You can use CASE to distinguish between them in
your select statements:
SELECT CASE NameType
WHEN '3a' THEN GivenName +' '+ Name4 +' '+ FamilyName
WHEN '4b' THEN Name2 +' '+ GivenName +' '+ FamilyName
WHEN '5c' THEN FamilyName +' '+ GivenName
ELSE GivenName+' '+FamilyName END AS FullName
>From Table1
(If you want, you could nest the CASEs so that they check fields for
null values before plugging them in so as to allow people to predict
naming conventions that might apply after marriage, confirmation, etc.)
--L