Using Shell Scripts for Database Operation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • creeds
    New Member
    • Feb 2008
    • 14

    Using Shell Scripts for Database Operation

    Hello ,
    I am thinking of performing databse operation using shell scripts , for example i am in need to delete sum number from database very often so if i just run a shell scripts and give that number and if it gets deleted, it will be a quiter easy. thinking that i am trying to do shuch scripts, i am looking in the net and now can perform sum query thru scripts,
    if any one has more idea regarding that, it will be a great help if any links or idea is given
    thanks in advance,
    creeds
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by creeds
    Hello ,
    I am thinking of performing databse operation using shell scripts , for example i am in need to delete sum number from database very often so if i just run a shell scripts and give that number and if it gets deleted, it will be a quiter easy. thinking that i am trying to do shuch scripts, i am looking in the net and now can perform sum query thru scripts,
    if any one has more idea regarding that, it will be a great help if any links or idea is given
    thanks in advance,
    creeds
    You can connect to a database from a shell script and execute the queries.
    Code changes depending on the type of DB
    general code for conecting to oracle DB will be like this

    Code:
    sqlplus -s <user>/<pass>@db << EOT
    select *
    ...
    EOT
    Raghuram

    Comment

    Working...