Jump to content

Recommended Posts

Posted (edited)

My team is tired of typing the same queries over and over again in SQL developer with slight variations in select clauses.  I see some posts regarding MS-SQL but I'm not sure if that will work with Oracle DBs. 

I'd like to start simple with a script that connects to a service name using hard-coded credentials and perform a simple query and consolewrite them.   Eventually, I'll put in a true GUI where service names are in a drop down, credentials are collected and a few parameters for the queries and the output is dumped to CSV or something.

Can someone point me in the right direction? 

Edited by jaja714
Posted

I'm getting COM errors probably because I'm not creating the connecting string right.  How do I get the connection string correct from, say, right-clicking on connection properties in SQL Developer?

I tried:

    .ConnectionString ="Provider={right-click-properties};Data Source=DVA;User Id={myUserName};Password={myPassWord};"
    .ConnectionString ="Server={right-click-properties};User Id={myUserName};Password={myPassWord};"

 

Posted

I don't see any AutoIT code there or examples.  As far as I'm concerned, any of those could work.  I'm just not in the mood to try them all with different flavors of case sensitivity and which quotes to use.  I tried this and it didn't work.

    .ConnectionString ="Data Source=myDB.com;User Id=myUsername;Password=myPassword;Integrated Security=no;"

 

Posted (edited)

First get one that works. Then learn how to construct the string programmatically 

i can’t be arsed to do it for you just because you don’t feel like doing development. You need to learn 

 

and nobody has your Oracle instance installed either

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted (edited)

That’s him begging nicely lol 

He was spoiled and once he even grabbed a sandwich out of my hands and ate the rest of it

He was loved very much

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Posted (edited)
  On 3/15/2021 at 5:43 PM, Earthshine said:

First get one that works.  i can’t be arsed to do it for you just because you don’t feel like doing development. You need to learn 

Expand  

That's what I'm asking for. 

I'm not an Oracle DBA.  I'm just a developer who needs to query some databases.  I don't know how the databases were constructed nor do I have access to the braintrust that created them.  

How do I translate SQL Developer Connection properties into valid connection strings?  I've been down the trial and error road all day yesterday and I'm ready to learn the right way ... from a teacher.

FYI: I tried many combinations, including:

$service = 'mydbname.domain.com'
    $user = 'myusername'
    $pass = 'mypassword'
    .ConnectionString = 'Provider=OraOLEDB.Oracle;Data Source=' & $service & ';User Id=' & $user & ';Password=' & $pass & ';'
    .ConnectionString = 'Provider=msdaora;Data Source=' & $service & ';User Id=' & $user & ';Password=' & $pass & ';'
    .ConnectionString = 'Driver={Microsoft ODBC Driver for Oracle};ConnectString=' & $service & ';Uid=' & $user & ';Pwd=' & $pass & ';'
    .ConnectionString = 'Driver={Microsoft ODBC for Oracle};Server=' & $service & ';Uid=' & $user & ';Pwd=' & $pass & ';'

I'm not sure why these are failing.  Is it syntax?
 

Edited by jaja714
Posted (edited)

You and your team need to head on over to the people who created the database and get the correct drivers and clients

 

There are no Microsoft SQL developer tools for Oracle that I am aware ofThere are no Microsoft SQL developer tools for Oracle that I am aware of

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...