Journal Chacham's Journal: Chronicle: Ramble: sqlplus, shortcuts, batch file, & env var
So, git (bash) uses the environment variable http_proxy. No problem, i set it as a system variable and it works great. But sqlplus is having issues with it, though i have no idea why it wants a proxy. No problem, set it back. Hmm... I have a bunch of sqlplus start menu shortcuts that SET NLS_LANG=.US8PC437 to allow history. Maybe i can just add http_proxy to the line.
No good, the line length is too large! Okay, batch file. Makes more sense anyway as i have 4 shortcuts (used to be 8) that do the same thing but with different connect strings. $ nope, it's % for windows batch command line variables. Add SET HTTP_PROXY=http://localhost but it doesn't work. Why not? Oh, because the local set sets local and the other variable is a system variable. Weird. It's out to get me. Change the system variable to a user variable so the local set overrides it. Boom, it works.
That took waaaay too long to figure out. Regardless, i now have a batch file:
SET NLS_LANG=.US8PC437
SET HTTP_PROXY=http://localhost
"C:\Program Files\Oracle\instantclient\sqlplus.exe" user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%1.example.com)(PORT=1521))(CONNECT_DATA=(SID=%2)))
executed by
C:\Windows\System32\cmd.exe
/q /c "C:\Program Files\Oracle\instantclient\connect.bat" sub.dom sid
As a side note, setting LOCAL (Windows version of TWO_TASK) didn't work. Though, i may have just been mixed up when i tried it.
Unfortunately, it echoes the SET statements when it opens the shortcuts. Oh,
Totally insecure but majorly convenient. Especially because when i'm forced to change my password, i now only need to update it in one place.
Chronicle: Ramble: sqlplus, shortcuts, batch file, & env var More Login
Chronicle: Ramble: sqlplus, shortcuts, batch file, & env var
Slashdot Top Deals