Error 46 initializing SQL plus on windows 2012

Hi Experts,
could you help me with this error pls

Trying to execute oracle sql from windows batch file using sqlplus

I thought of trying manually first before integrating with windows batch file. I get below error

C:\Temp\scripts>SQLPLUS
Error 46 initializing SQL*Plus
HTTP proxy setting has incorrect value
SP2-1502: The HTTP proxy server specified by http_proxy is not accessible

Open in new window


However, I can connect ODBC connection pointing to the same db and able to test connect and perform other activities.

Thanks in advance
enthuguyAsked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
Check your windows environment for variables: http_proxy and no_proxy.  Unset them if you don't need them.


http://www.enhisecure.com/isecureblog/2017/04/14/solved-http-proxy-setting-has-incorrect-value/

Before you ask:  We don't know if you need them or not.  You would need to check with your DBA and/or System Administrator.
0
 
enthuguyAuthor Commented:
Thanks,
it was already unset, I mean to null
och_env_variable.jpg
0
 
enthuguyAuthor Commented:
I removed those variable and it worked

thanks very much
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
enthuguyAuthor Commented:
sorry, while executing the sql within batch file...I get same error :(
0
 
enthuguyAuthor Commented:
e.g
:update_workflow_not_in_use
      echo  "Executing SQL to update all applicable workflow to Not In Use..."
      echo "cd %script_dir%"
      cd "%script_dir%"
      powershell -noprofile -executionpolicy bypass -file "%l_och_build_powershell_util_filepath%"
      sqlplus oracle/welcome123@TESTDB @select.sql
      exit /b 0
      REM goto :EOF



Above "sqlplus oracle/welcome123@TESTDB @select.sql" fails with below
00:17:03 Error 46 initializing SQL*Plus
00:17:03 HTTP proxy setting has incorrect value
00:17:03 SP2-1502: The HTTP proxy server specified by http_proxy is not accessible
0
 
slightwv (䄆 Netminder) Commented:
If it is the exact same error then it is the exact same solution.  Make sure the Powershell environment doesn't have those parameters set.  I'm not a Powershell expert so I'm not sure where all it pulls environment settings when executed.
0
 
enthuguyAuthor Commented:
using batch file. updated file but still no luck.

:update_workflow_not_in_use
      SET http_proxy=""
      SET https_proxy=""
      echo  "Executing SQL to update all applicable workflow to Not In Use..."
      echo "cd %script_dir%"
      cd "%script_dir%"
      powershell -noprofile -executionpolicy bypass -file "%l_och_build_powershell_util_filepath%"
      sqlplus oracle/welcome123@TESTDB @select.sql
      exit /b 0
      REM goto :EOF
0
 
enthuguyAuthor Commented:
Thanks below worked

:update_workflow_not_in_use
     SET "http_proxy="
      SET "https_proxy="

      echo  "Executing SQL to update all applicable workflow to Not In Use..."
      echo "cd %script_dir%"
      cd "%script_dir%"
      powershell -noprofile -executionpolicy bypass -file "%l_och_build_powershell_util_filepath%"
      sqlplus oracle/welcome123@TESTDB @select.sql
      exit /b 0
      REM goto :EOF
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.