Nov 21 2011 4:10PM GMT
I have a small project that I am working on and it requires that I pull data from Oracle from within a Powershell script. This is not something that is fun but it can be done and it is not really that difficult to get the data out of Oracle, it is dealing with the data once you have the data out.
$query = “select * from table;”
$query | sqlplus username/password@SID
that will push the data back for you but it is ugly and you are going to have to parse that data somehow to get it into a format that is useful to you. It all depends on what the query is and how you need the data. For me I ended up having to break my query down into two queries in order to deal with the data and get the output that I was after. The problem is that it returns as a giant string and the sting is not really formatted in any useful way. So you may have to be creative in order to get what you need but it can be done.