Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert a 'Ñ' by using it's CHAR value.

Status
Not open for further replies.

ratinakage

Programmer
Feb 26, 2006
18
ZA
Hi guys,

My sql programming it not the best. What I want to do is insert the String 'Ñ' into a table. But the OSQL parser I am using keeps turning this into a 'N'. Does anyone know another way to insert this string? Perhaps by means of Char or Asci values?

Let me know.
Thanks
G
 
it will surely have something to do with the collations allowed by your database

what's OSQL? what database is this?

perhaps you should re-post the question in the appropriate forum for your database, as this forum is for ANSI SQL

r937.com | rudy.ca
 
INSERT INTO sometable VALUES (U&'\00D1')

Where 00D1 is the Unicode code for Ñ.

"A unicode-string-literal is used in order to facilitate the specification of Unicode characters in an ASCII environment. It consists of a sequence of Unicode characters enclosed in string delimiters and preceded by the letter U and an ampersand, i.e. U&. The standard string delimiter is the single quotation mark: '. Two consecutive single quotation marks within a string are interpreted as a single quotation mark. Unicode characters are given by four hexadecimal digits preceded by a backslash character (\) or, by six hexadecimal digits preceeded with a backslash character and a plus character. Two consecutive backslash characters within a string are interpreted as a single backslash character. The case of the preceding U is irrelevant.
 
That should work. Make sure that your column's data type is unicode of course. If you have been trying to load the Ñ from a file or form and it is not working, I suspect you don't have unicode columns.

How do you type this? I always feel like a tool typing n(tilde)

A wise man once said
"The only thing normal about database guys is their tables".
 
Actually it'll work for plain 8-bit ASCII as well, as long as all codes < 00ff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top