简体   繁体   中英

sqlplus - command line select statement doesn't use login.sql settings

I have an sh script containing this:

sqlplus -S $JDBC_URL <<EOF
$1;
EOF

That works fine. However, it doesn't pick my formatting preferences from login.sql. Those settings work fine when I start SQL Plus in interactive mode.

Does anyone know how to make my script read login.sql? Is there some other file perhaps?

Depending on the version of sqlplus you are using and the operating system, you likely need to set and export the ORACLE_PATH (linux) or SQLPATH (windows) environment variable to include the directory that contains login.sql .

I just found that past version used to look in the present-working-directory but that was not happening on the linux server I was working on. Setting SQLPATH did not work either because it is used in windows; setting ORACLE_PATH did work.

Attribution for this information

您可以改用glogin.sql-请参阅SQL Plus上的OraFAQ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM