Insert with accents in Oracle

Asked

Viewed 10,354 times

12

When I make one INSERT for example:

INSERT INTO TESTE (NOME) VALUES ('INSCRIÇÃO ESTADUAL');

You’re saving it on the table this way:

REGISTER THE STATE

And on the screen displays "INSCRIÃÃO ESTADUAL".


I’m using the Oracle SQL Developer, when I enter the table and change in hand, then yes saved correctly:

REGISTER THE STATE

And on the screen displays correctly "INSCRIÇÃO ESTADUAL".


Configuration of the NLS

inserir a descrição da imagem aqui

Running SELECT PARAMETER, VALUE FROM NLS_DATABASE_PARAMETERS inserir a descrição da imagem aqui

I even looked at the configuration of my NLS and apparently it is ok, there is some way to change the encoding at the time of INSERT?

  • What is the output of "SELECT PARAMETER, VALUE FROM NLS_DATABASE_PARAMETERS"?

  • @In that case the charset is NLS_CHARACTERSET US7ASCII

  • @Bruno I changed the question with all values

  • The response under Paulo Roberto helped?

  • @No, keep inserting the incorrect way, until I gave a echo $NLS_LANG, shows that I changed only that I do not influence anything in my Oracle

  • You can confirm if I’ve noticed: In Oracle SQL Developer, when you run the INSERT statement the characters are not being saved correctly, but when you edit the table they are saved with accents?

  • Exactly @

  • What are you typing for? Is it a system? If it’s a page, can’t it be the encoding of it? In HTML?

Show 3 more comments

3 answers

2

  • Here it didn’t work, I use Ubuntu and even gave a export in variable, I set in "profile", closed the session and tested again... did not help :/

1

I had a similar problem, when I was going to use an oracle client via Docker, the inserted records that contained accents were all messy, I could only solve by exporting the variable NLS_LANG=AMERICAN_AMERICA.UTF8

1

Use NLS_LANG environment variables to configure correctly, as it must be entering as ASCII (7-bit), use export for Linux and set for Windows.

If input data is encoded in Windows environment:

export/set NLS_LANG='AMERICAN_AMERICA.WE8MSWIN1252'

In ISO-8859-P1 (Unix):

`export/set NLS_LANG='AMERICAN_AMERICA.WE8ISO8859P1'`

In UTF-8:

export/set NLS_LANG='AMERICAN_AMERICA.AL32UTF8'
  • Lucas I did it, it was the same thing that Paulo Roberto suggested, I even added in ~profile besides doing the export on time too and nothing. Inside Sql Developer does not take.

  • You can run a test on sql*plus, just to confirm if it’s a Developer problem, or if it’s a Linux environment variable problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.