BnJ
BnJ

Reputation: 1044

SQL*Plus SPOOL on the windows command line

I have a problem with the command SPOOL of SQL*Plus executed on an UNIX system...

Before connecting to the database with SQL*Plus, I do an :

export NLS_LANG=french_FRANCE.UTF8

Then :

spool EXCEPTION.csv
select MY_COLUMN||';'||EXCEPTION_MESSAGE from TABLE_EXCEPTION;
spool off

When I open EXCEPTION.csv with Notepad++ on Windows :

ORA-01403: aucune donnée trouvée

It's what I expected, but with Microsoft Excel :

ORA-01403: aucune donnée trouvée

So, is it possible to SPOOL to the command line with SQL*Plus, without having to make an unix2dos EXCEPTION.csv ?

Upvotes: 0

Views: 618

Answers (2)

tvCa
tvCa

Reputation: 816

Encoding is also done via FTP. So, in addition to the above (edit: below), behold the option to copy as ASCII/TEXT or BINARY. These 2 methods should end up with different files. Optionally, your FTP tool can also use additional text conversion options, which are done when using ASCII/TEXT method.

Upvotes: 0

Atilla Ozgur
Atilla Ozgur

Reputation: 14701

You have an encoding problem.

First you can try to set encoding in spool part. See this question.

Second you can try to choose correct encoding in Text Import wizard. That is instead of double clicking file name.

  1. Open blank excel sheet
  2. Choose Data Tab
  3. Choose Import txt file.
  4. Choose correct encoding

Import Text Text Import Wizard

Upvotes: 1

Related Questions