Jump to content

Oracle SQL db queries


Recommended Posts

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
Link to comment
Share on other sites

@jaja714
If you have any problem, don't be afraid to post a runnable script, so we can assist you more :)
Good luck!


EDIT: In fact, there are no examples with Oracle DB in the ADO Wiki section :D

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

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};"

 

Link to comment
Share on other sites

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;"

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

21 hours ago, 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 

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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