I was wondering if there was a way I can execute a SQL Loader script from SQL Plus.
We are using Oracle 10g.
Best Answer
An alternative technique may be to use an external table. There is no need to take your CSV (or whatever) file and load it in a separate step. Simply declare your external table in the correct format (this is almost identical to a SQL*Loader parfile, but wrapped in a CREATE TABLE statement) and you can issue a SELECT directly against it, once the file is in the right place. It will create .BAD and .LOG files, just like SQL*Loader for any records that can't be cast to the datatypes in the table. You could expect better performance too. These days I would consider SQL*Loader to be for legacy apps only.
NLS_LANG can't be changed from inside a session, however other settings can.
You can't change the character set once a database connection has been established (ie: the 2nd part of NLS_LANG), but you can change the language with:
Best Answer
An alternative technique may be to use an external table. There is no need to take your CSV (or whatever) file and load it in a separate step. Simply declare your external table in the correct format (this is almost identical to a SQL*Loader parfile, but wrapped in a
CREATE TABLE
statement) and you can issue aSELECT
directly against it, once the file is in the right place. It will create.BAD
and.LOG
files, just like SQL*Loader for any records that can't be cast to the datatypes in the table. You could expect better performance too. These days I would consider SQL*Loader to be for legacy apps only.