I’m running into the issue where I’m testing an oracle sql call in powershell ISE, and it hangs. It says connected, and stops.
I was reading sqlplus hanging when run from powershell ise, and it seems to be a regular issue. I always test with powershell ise. Is there a way to workaround it? It happens when I run in powershell ISE from the prompt or from my script. It is a very lengthy script so I can’t just run the one command from the powershell prompt (not in ise). Can I move the sqlplus command to a separate powershell script and run that from powershell ise as a command to execute? I’m not sure what to do to get it to run and still use powershell ISE to write the rest of my code.
This is what the command looks like, but I don’t think that’s it.
sqlplus user/pw@RRRPRD.company.net:1521/RRRPRDC ‘@C:\Users\me\Documents\2021\temp endToEnd\short.sql’
It says this on the screen and all looks good:
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
but it hangs. It’s a short query so shouldn’t take forever.
Update: I’m using VSCode now, and fixed a missing \ before short.sql.
I added this:
$quote = ‘"’
$info = $("{0}/{1}@{2}:{3}/{4} `@{5}{6}{5}" -f $username, $password, $hostIp, $port, $service,
$quote, $sqlPath,$quote)
$result = ""
Write-Host "info: $info"
$result = sqlplus '$info'
Write-Host "result: $result"
But it’s not printing result: before the 2 it shows now, or the db connection info when I run in VSCode.
Terminal output when run at terminal:
…
Last Successful login time: Tue Jan 11 2022 09:05:19 -05:00Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production2
The query it’s running now is select * from tablename which runs fine in Oracle sql developer. This has a few columns and a few rows. It shouldn’t be printing a “2”.