Your question, your audience. Choose who sees your identity—and your question—with question security.
cls
$connectionString= "Data Source=ora1/orcl;User Id='sys/abc@orcl as sysdba';Password=abc;"
[System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient")
$connection = New-Object System.Data.OracleClient.OracleConnection($connectionString)
$queryString = "SELECT COUNT(LAST_NAME) FROM EMPLOYEES"
$command = new-Object System.Data.OracleClient.OracleCommand($queryString, $connection)
$connection.Open()
$employeesNames = $command.ExecuteScalar()
echo "Number of employees: "$employeesNames
$connection.Close()
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.
From novice to tech pro — start learning today.
Is it perl script? Or jython script or python script? (I am not much into it, so cant figure it from sample code)
For JDBC, we have following option...
* user String The user name for logging into the
* database.
* password String The password for logging into the
* database.
* database String The connect string for the database.
* internal_logon String A role, such as SYSDBA or SYSOPER,
* that allows you to log on as SYS.
But this is with JDBC, it will be different for string, but the property should remain same for all the DBC.
so try exploring more on internal_logon syntex for your scripting language...