Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

db2 + shell script

Status
Not open for further replies.

adev111

Programmer
Jul 8, 2004
44
CA
Hi there all,
i am a beginnner in sql using db2 and scripts and was working on a banking database where i have to manage account transactions like withdraw and deposit.

say i have a table chequing(account#,balance)
another table savings(account#,savbalance)
now say i wana transfer amount from chequing to savings
echo "Please enter the account number"
read accNum
echo "Enter the amount you wish to transfer"
read amount
db2 "update chequing set balance = (balance - $amount) where account# = $accNum"
db2 "update savings set savBalance = (savBalance + $amount) where account# = $accNum"

is this do able?
can someone please help me out please!
Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top