• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6210
  • Last Modified:

Cannot insert special characters

Hi,

I need to insert special characters on the Oracle 8i database, i got an insert statement like this:

Insert into TBLADMIN (UserID, Pwd, Email, AccessType, Status) Values ('admin','¡uºË¬pMþ','user@domain.com', 'admin', 'active');

however, when i check back the password field, it's inserted as:

­u§EªpM_

instead!

What's happened here? Currently the password field is:  VARCHAR2(20) NULL

Can anyone help me resolve this problem here? I need save whatever characters user provided to me.

Thank you.
0
trowa
Asked:
trowa
  • 6
  • 5
  • 4
  • +1
3 Solutions
 
MetanilCommented:
set your NLS setting to proper characterset, like NLS_LANG.

Metanil
0
 
trowaAuthor Commented:
Sorry, in this case, what do i need to do here? I'm not sure what is NLS setting, a guide is appreciated here.

Thank You.
0
 
MetanilCommented:
what is your NLS_LANG setting? You can view this using following query:
select * from v$nls_parameters;

For more info on this, take a look at this:
http://www.cs.umbc.edu/help/oracle8/server.815/a67789/ch2.htm

Metanil
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
trowaAuthor Commented:
Thanks for the info, Metanil. So in this case, what NLS_LANG do i need to set here?

So, do i need to set it ONCE only? Actually I'm still not quite sure how to set it...

Can help advise? Thank you.
0
 
lbinsoonCommented:
Just query from the v$parameter views, you will be able to see the values.

select name, value from v$parameter where name like 'nls%';

Had tested in my development database. Its ok.

SQL> desc testtab;
 Name                                                              Null?    Type
 ----------------------------------------------------------------- --------  USERID                                                                     VARCHAR2(10)
 PWD                                                                        VARCHAR2(20)

Insert into Testtab (UserID, Pwd) Values ('admin','¡uºË¬pMþ');

SQL> select * from testtab;
 
USERID     PWD
---------- --------------------
admin      ¡uºË¬pMþ
 

0
 
trowaAuthor Commented:
I don't know what NLS_LANG should i prefer here, i just want the values saved as what it it originally.
0
 
lbinsoonCommented:
may i know what is your output for the below query?

select name, value from v$parameter where name like 'nls%';
0
 
MetanilCommented:
alter session set NLS_LANG = 'AMERICAN_AMERICA.WE8ISO8859P1';

Metanil
0
 
MetanilCommented:
oh sorry i think that would not work.. actually its a OS enviroment variable. So set it as

$ export NLS_LANG = 'AMERICAN_AMERICA.WE8ISO8859P1'

Metanil
0
 
trowaAuthor Commented:
Hi there,

Currently found that i can get the value exactly the same (¡uºË¬pMþ) in sqlplus (DOS), but when i compare it in my ASP/VB script, it converted automatically to as ­u§EªpM_

Any idea on this? : (
0
 
trowaAuthor Commented:
nls_language is AMERICAN
0
 
lbinsoonCommented:
May be is the way you output your variable or the variable data type problem.
0
 
Ryan ChongCommented:
When i copy the text to sqlplus (DOS), just realised it automatically converted to:

SQL> Insert into Testtab (UserID, Pwd) Values ('admin','¡uºE¬pM_');

but not:

Insert into Testtab (UserID, Pwd) Values ('admin','¡uºË¬pMþ');

Any idea??
0
 
lbinsoonCommented:
Click on the top left corner and choose properties, font tab and select T Lucida Console.
It will solve the copy issue..
0
 
lbinsoonCommented:
i mean the command prompt..
0
 
lbinsoonCommented:
Its will convert to the Raster Font representation. As for T Lucida console, it will take exactally what is being copied to the console.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now