Write a query that will accept an account no
#1

Write a query that will accept an account no. from the user and debit an amount of 2000 from the account. If account has a min. balance of 500 after the balance is debited. The process is to be fired on the account table
PROGRAM CODE:
DECLARE
acct_balance number(11,2);
acct_no VARCHAR2(6);
debit_amt NUMBER(5) := 2000;
min_bal CONSTANT number(5,2):=500.00;
BEGIN
acct_no := '&acct_no';
SELECT bal into acct_balance
FROM accounts
where account_id=acct_no;
acct_balance:=acct_balance-debit_amt;
IF acct_balance >= min_bal then
update accounts set bal= bal- debit_amt
where account_id=acct_no;
END IF;
END;
OUTPUT:
[attachment=14368]
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: how to write project requirements, cancelling webphone account, how to write a design, bal mujuri virodhi mohim, iquest recruitment system account**rategies of hyundai pdf, user account, bal kamagar samsya,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to create a query in Microsoft Access? smart paper boy 0 1,115 29-07-2011, 12:14 PM
Last Post: smart paper boy
  To write a program to print “Hello World” in CORBA. smart paper boy 0 1,991 21-07-2011, 09:52 AM
Last Post: smart paper boy
  To write a C# program to perform encryption and decryption of the given data. smart paper boy 0 1,791 21-07-2011, 09:50 AM
Last Post: smart paper boy
  To write a program in C# to perform conversion of dollars to rupees smart paper boy 0 1,767 21-07-2011, 09:48 AM
Last Post: smart paper boy
  Write a query for creating an Updateable view. smart paper boy 0 1,000 09-07-2011, 10:49 AM
Last Post: smart paper boy
  Write a C Program to declare an array for 2 0 floats. Accept the values from the user smart paper boy 0 1,401 20-06-2011, 11:41 AM
Last Post: smart paper boy

Forum Jump: