Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
User Journal

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, /q takes care of it, so C:\Windows\System32\cmd.exe /c /q... Nope. after /c its treated as a literal. Have to put /q before /c. Keyboard is awesome in Windows, but they still make it hard in the details.

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.

This discussion has been archived. No new comments can be posted.

Chronicle: Ramble: sqlplus, shortcuts, batch file, & env var

Comments Filter:

Get hold of portable property. -- Charles Dickens, "Great Expectations"

Working...