I just wrote one of my first powershell script yesterday, it has a pretty nice syntax actually, and no need to download anything like cygwin or other unix-like shell to your PC.
PS> $stmt = "set hea off`n"
PS> $stmt += "select 'hello world' from dual;"
PS> $res = ($stmt | sqlplus -s scott/tiger)
PS> $res
hello world
Pretty cool 🙂
Excellence
One I like is
PS> $dbs = ‘db1 db2 db3 db4’.split()
PS> $dbs | foreach { ‘select count(*) from v$session;’ | sqlplus -s system/pw@$_ }
Neat 🙂
What is Windows?
Thanks Linus for your comment, and congrats for your NEC C&C Award 😉
Laurent & Paul. Thanks for sharing this. Will make my life easier on windows to control remote databases 😉
I learnt a lot in the last week… from changing the icon to manipulating the clipboard, and all test different functions, it is really cool and the resource on the web are immense !
Alternative to piping to sqlplus :
http://www.labo-oracle.com/Windows-PowerShell-Connecting-to
@Laurent Schneider
Wow !!! It really was Linus Torvalds ? You have a great fan following 😉
Cheers !
😉 A very interesting question from Linus indeed !