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