Comments (42)
ok, thanks.
If anyone wants to implement automatically, these are the two configurations to be given depending on whether you are using windows1252 or UTF8:
- windows1252
chcp 1252
set NLS_LANG = .WE8MSWIN1252
- UTF8
chcp 65001
set NLS_LANG = .UTF8
from oradew-vscode.
ok, thanks.
Whit this bat it works:
chcp 1252
set NLS_LANG=.WE8MSWIN1252
sqlplus %*
without NLS_LANG it doesn't work, even if I set the value inside "oradew.envVariables"
from oradew-vscode.
Hi, do you use sqlplus or sqlcl?
from oradew-vscode.
sqlplus
from oradew-vscode.
If you can I suggest you always force encoding on utf-8 with sqlplus.
It is the only one who works correctly.
from oradew-vscode.
Take a look at #28 (comment) and followed comments.
from oradew-vscode.
It doesn't solve my problem.
There is a bug with running the selection.
I created a file with this code:
GRANT EXECUTE ON CONF_SET_VAL_TIPI_CONN_SVI TO NETAINF;
GRANT EXECUTE ON CONF_SET_VAL_TIPI_CONN_SVI TO SIU;
If I run it with f5 (run as script) it works, with Run Selected Statement, no.
If I delete only one of the two lines, the execution is performed correctly, with both lines not.
from oradew-vscode.
It appears that it cannot execute the two selected lines. If I select only one, it works.
The error is as follows:
ORA-00933: SQL command not properly ended
Reported at the end of the first line
from oradew-vscode.
Correct. A command like "Run Selected Block as a Script" is missing or a proper parser to compile a multi-statement code.
from oradew-vscode.
Hi,
for the problem with utf8 encoding there is no solution (#42 (comment)).
My oracle DB doesn't use utf8 encoding, but sqlplus uses it instead.
I tried to enter this configuration but nothing changes:
"oradew.envVariables": {
"NLS_LANG": "ITALIAN_ITALY.WE8MSWIN1252",
}
from oradew-vscode.
Have you tried setting "source.encoding" to "win1252"? Import object again after that to correctly encode it. This is what I use.
from oradew-vscode.
the encoding of the file is correctly windows1252, like Oracle configuration.
when launched to DB from sqlplus (f5), UTF8 encoding is always applied and special characters such as this § are not encoded correctly.
are you sure that the parameterization "oradew.envVariables" is taken correctly?
from oradew-vscode.
Is there no way to tell sqlplus not to apply UTF8 encoding, but Windows1252?
from oradew-vscode.
I am not sure, I thought this was the case with setting nls_lang variable based on a user's comment, but I don't use it. I use win1250 encoded files to run to win1250 DB and it works, but I also have win1250 default lang on my OS system, which I think is the encoding that sqlplus applies. I guess in your case default OS encoding is UTF-8.
What about using UTF-8 encoded files? Is there a way you normally do to run a file with just sqlplus that works for you?
from oradew-vscode.
The system language is ITALIAN_ITALY.WE8MSWIN1252
The files are launched correctly on the DB, not by execution error. But if they are then opened, if there are special characters in some comments or strings, they are badly coded.
from oradew-vscode.
Hmm. Check also the vscode encoding in which the file is open - in the right bottom corner of status panel.
from oradew-vscode.
from oradew-vscode.
So you launch with sqlplus a file written with win1250 encoding, on an Oracle DB with NLS_CHARACTERSET = win1250 and the special characters like this "§" are not altered?
from oradew-vscode.
That's right, I use many ČŠŽ in comments and other "strange" chars. My Win OS codepage is also 1250. I use sqlcl now but it worked with sqlplus also. Have you tried running files encoded in UTF-8?
from oradew-vscode.
it seems the problem is in Oracle's charset, other than UTF8.
what is your Oracle DB NLS_CHARACTERSET?
from oradew-vscode.
That shouldn't be the case, my charset on DB is also .WE8MSWIN1250.
Take a look at: https://dba.stackexchange.com/questions/207537/problem-with-charset-on-sqlplus maybe you will got some idea.
from oradew-vscode.
It seems a problem related to machines that use Windows.
You should fix this by placing this code before the call to SQLPlus
C:\>chcp 1252
C:\>set NLS_LANG=.WE8MSWIN1252
i verified that by entering those two commands before running sqlplus, everything works fine
from oradew-vscode.
In my case just give:
chcp 1252
from oradew-vscode.
Can you create a parameter that makes me enter "chcp" before executing the sql code?
from oradew-vscode.
Take a look at this comment. You create a sql.bat file and then set setting "oradew.cliExecutable": "sql.bat" to execute with parameters through this bat script...
Please let me know if you can make it work. 🤞
from oradew-vscode.
I created a bat with this but it doesn't work. the plsql instruction appears to be executed in a different session.
bat file:
chcp 1252
set NLS_LANG = .WE8MSWIN1252
sqlplus UTE/PASS@DBNAME @"File.sql"
from oradew-vscode.
if I set this bat, Oradew ask me user and password for sqlplus:
chcp 1252
set NLS_LANG = .WE8MSWIN1252
sqlplus
from oradew-vscode.
Write
sqlplus %*
As in example so that parameters are passed through...
from oradew-vscode.
Thanks for your info. This is a workaround to pass variables to executable.
Maybe we can add this solution to documentation or Howto's for others to easly find it, so @Danieleeee if you feel like contributing, please go ahead!
If you are satisfied you can also consider just adding a star to this project. :)
from oradew-vscode.
because of you.
star added ;)
from oradew-vscode.
Note that this solution does not work in the "compile current file" command, only in "Run ad Script (f5)".
It would be helpful to fix it. It should occur on all Windows machines that have ANSI codepages.
from oradew-vscode.
Have you tried setting "source.encoding" to "win1252"? Import object again after that to correctly encode it. This is what I use.
Compile task uses different method. chcp doesn't have any means here as node-oracledb executes always in UTF-8 and doesn't bother about system codepages.
Setting "source.encoding" parameter is here so that oradew first decodes file content from file encoding to UTF-8 before compiling, and encodes it back after importing.
But it doesn't work for you?
from oradew-vscode.
the problem is that they are always executed in UTF8.
It gives problems with the code page of the machine, if we are on windows and the file (and Oracle DB) we are executing is not encoded in UTF8.
if you have a windows machine you can give it a try.
from oradew-vscode.
I use it all the time and it works as I explained in the comment above. Have you tried exporting existing object from db, then adding some comments and compile again?
from oradew-vscode.
No, I'm always working with the same file written in Windows1252.
If I compile it gives problems with the coding, if I run it as a script no because I use the bat with chcp 1252.
from oradew-vscode.
Can you send an example file so I can reproduce? And please describe what is that you do, f.ex. compile a specific char in comments and then not expected result on DB, etc...
from oradew-vscode.
I can't attach a file.sql so i write it here.
CREATE OR REPLACE PACKAGE TEST_PCK AS
v_test varchar2(100):= '§';
END TEST_PCK;
/
Put it in a file with windows1252 encoding.
Run the Oradew "Compile Current File" command.
If the DB has Windows1252 encoding, you will not correctly see the '§' character.
Processing is launched from a Windows 10 machine
from oradew-vscode.
Strange. NLS_LANG on my DB is .EE8MSWIN1250, I made a file encoded in Windows 1252 exactly as you suggested, compiled, checked on DB and it is '§'.
I have "source.encoding": "win1250",
in oradewrc.json
file, if I remove that, I get '?' instead of '§' on DB.
I don't have set any environment variables for NLS_LANG with "oradew.envVariables" or anywhere else...
from oradew-vscode.
yes, if i use oradewrc.json it works.
Thanks
from oradew-vscode.
Last thing, because when I import a package it writes: "CREATE OR REPLACE EDITIONABLE PACKAGE BODY".
how do i delete "EDITIONABLE"?
from oradew-vscode.
This has to do with your database configuration - editions. I am not very familiar with this topic.
You can customize object DDL that is imported with oradewrc setting: import.getDdlFunction
in a way that you write your own function to import objects...
from oradew-vscode.
@Danieleeee , I closed this issue, feel free to open a new one if you have more questions, bugs, etc.
from oradew-vscode.
Related Issues (20)
- Run as Script hangs for a few minutes HOT 3
- Compile error "ERROR ORA-06550: line 3, column 40:" HOT 8
- problems importing packages from the DB HOT 3
- Terminal output problem matcher HOT 26
- Generate: "output" doesn't work
- Extension causes high cpu load HOT 1
- Encoding error when importing the selected object HOT 8
- Displaying umlauts in terminal output
- Encoding problem in SQL-Statements HOT 3
- dbms_metadata.get_ddl does not work when used in UTL_GENERATE_ORADEW HOT 3
- Initialize Workspace not working HOT 8
- Oracle wallet authentication compatibility, userless & passwordless HOT 9
- Error while trying to retrieve text for error ORA-01804 HOT 5
- Drop support for sqlplus, sqlcl Liquibase ci/cd HOT 8
- Support latest version of node HOT 6
- Generating a source from a database HOT 5
- Create source from a non-DEV env
- Problem importing when object has "SQL" in the name HOT 1
- problems connecting to oracle database (proxy authentication) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oradew-vscode.