Oracle &VB Record
Oracle &VB Record
2018 – 2021
REG.NO:
___________________ __________________
Staff Incharge Head of the Department
________________ ___________________
Internal Examiner External Examiner
VISUAL BASIC
1 Number Conversion
3 Calculator
6 Student Database
EXNO: 1
DATE:
NUMBER CONVERSION
AIM:
To create a visual basic program to convert number into
A) Binary B) Octal C) Hexadecimal.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Create the form with the following objects
LABEL: It is used to display text
TEXTBOX: It is used to get input
COMMAND BUTTON: Used for click
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EX NO : 2
DATE:
AIM:
To write a simple visual basic program to add item to the list box with users input
and move the selected item to combo box one by one.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Create the form with the following objects
LABEL: It is used to display text
TEXTBOX: It is used to get input
LISTBOX: It provides a collection of text item.
COMBO BOX: It combines the capacity of text box and list box
COMMAND BUTTON: It is used to change and move to list
and combo box
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EXNO: 3
DATE: CALCULATOR
AIM:
Create a simple VB program to develop calculator with basic operations.
ALGORITHM:
STEP 1: Start the process
STEP 2: Design a form with text box to accept number array of command button
for number and operator.
STEP 3: If an operator „+‟ is clicked add text value to previously entered values.
STEP 4: If an operator „-‟ is clicked add text value to previously entered values.
STEP 5: If an operator „*‟ is clicked add text value to previously entered values.
STEP 6: If an operator „/‟ is clicked add text value to previously entered values.
STEP 7: Apply the same process for sin, cos, tan, sqrt, cube and pi and if it is
clicked the text value to previously entered values.
STEP 8: Display the result in a text box.
STEP 9: Stop the process.
CALCULATOR
OUTPUT:
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EXNO: 4
AIM:
To write a VB program using common dialog box to display the open. Save, font
dialog box without using the action control properties.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Design the form with four command buttons and one image box.
STEP 3: Change the properties and captions for all buttons and image box.
STEP 4: Double click on the open command button and write the event procedure
for opening the file.
STEP 5: Double click on the save command button and on the event procedure for
saving the opened file.
STEP 6: Double click on the font command and write the event procedure for
changing the style of the label.
STEP 7: Write the event procedure for each menu items.
STEP 8: Stop the process.
COMMON DIALOGUE BOX
OUTPUT:
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EXNO: 5
DATE: MENU DRIVEN PROGRAM
AIM:
To write a VB program to develop a menu driven program and MDI form window
in the form and arrange them in the cascading, vertical, horizontal style using
menus.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Create a MDI form and make other form in the project to be child of MDI.
STEP 3: Create a menu with form name available window style, color, if the form
name is selected then loads the specified form.
STEP 4: If the style is vertical, arrange the MDI child windows in vertical style.
STEP 5: If the style is horizontal, arrange the MDI child windows in horizontal
style.
STEP 6: If the style is cascading, arrange the MDI child windows in cascading
style.
STEP 7: If the color menu is selected to form, then apply the color as black color to
active form.
STEP 8: Stop the process.
MENU DRIVEN PROGRAM
Thus the above program has been executed successfully and output has been
verified.
EX.NO: 6
DATE:
STUDENT DATABASE
AIM:
To design a vb program to perform questionnaire using option.
ALGORITHM:
1
Table Creation
2
Retrieving fields from
multiple tables
3
Table updation using PL\SQL
4
Splitting tables using cursors
5
Triggers
6
Exception handling
EX.NO .1
DATE :
TABLE CREATION
AIM:
To write an oracle program to create a table to Employee Details with the
necessary records and manipulate the Operators.
ALGORITHM:
STEP1: Start the process.
STEP2: Create a table EMP2 with a following fields empno, name, gender,
age , salary , designation and date of joining.
STEP3: Set the primary key constraint to the empno field.
STEP4: Describe the table using DESC EMP2 query.
STEP5: Insert ten records into EMP2 table.
STEP6: View the table using SELECT * FROM EMP2 query.
STEP7: Retrieve the fields from the EMP2 table using comparison, logical, set,
sorting and grouping operator.
STEP8: Stop the process.
CREATE A TABLE:
Table created.
DESC EMP2;
1 row(s) inserted
SELECT*FROM EMP2;
NAME
AFREEN
AASHI
MANJU
VARSHU
ANU
PRABA
NIVA
DHARANI
KRISH
SHANU
USING LOGICAL OPERATOR:
SELECT NAME,SALARY FROM EMP2 WHERE SALARY BETWEEN '10000' AND '34000';
NAME SALARY
AFREEN 30000
MANJU 25000
PRABA 31000
EMPNO
111
112
AGE COUNT(*)
22 1
25 1
21 1
20 1
26 1
24 2
23 2
27 1
EMPNO NAME
111 AFREEN
113 MANJU
114 VARSHU
116 PRABA
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EX.NO .: 2
DATE :
AIM:
ALGORITHM:
Table created
DESC MASTABLE;
Table Column Data Lengt Precisi Scal Prima Nullab Defau Comme
Type h on e ry Key le lt nt
MASTAB BOOKN Numbe - 5 0 1 - - -
LE O r
TITLE Varcha 20 - - - - -
r2
AUTHO Varcha 20 - - - - -
R r2
RATE Numbe - 5 0 - - -
r
1-4
1 row(s)inserted
Table created.
DESC TRANSTABLE;
INSERTING RECORDS:
SELECT*FROM TRANSTABLE;
BOOKNO USERID ISSUEDATE RETURNDATE
111 AAOO1 07-JUN-17 18-JUL-17
112 AA561 27-JUL-17 05-AUG-17
113 AB7891 21-MAR-17 09-APR-17
114 AN091 12-APR-17 29-APR-17
115 AT401 25-MAY-17 12-JUN-17
SELECT
TRANSTABLE.BookNo,TRANSTABLE.ISSUEDATE,TRANSTABLE.RETURNDATE,MAST
ABLE.TITLE FROM TRANSTABLE,MASTABLE WHERE
TRANSTABLE.BookNo=MASTABLE.BookNo;
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EX.NO : 3
DATE:
AIM:
To write a oracle program to update the table using PL/SQL.
ALGORITHM:
STEP 1: Start the process.
STEP 2: Create the table named inventory with the following fields prono, proname
and rate.
STEP 3: Insert few records into the table.
STEP 4: Update the rate field by 20% using update query.
STEP 5: Alter the table by adding new field using alter query.
STEP 6: View the table using select query to check whether new column is
updated.
STEP 7: Stop the process.
CREATE A TABLE:
Table created.
DESC INVENTORY3
1 row(s) inserted.
UPDATING A TABLE:
DECLARE
RATE NUMBER(5);
BEGIN
UPDATE INVENTORY3 SET RATE=RATE+RATE*20/100;
COMMIT;
END;
Statement processed.
ALTERING A TABLE:
RESULT
Thus the above program has been executed successfully and output has been
verified.
EX.NO. : 4
DATE :
SPLITTING TABLE USING CURSOR
AIM:
To write a oracle program to split the table into two tables and handle the
records using cursors.
ALGORITHM:
Table Created
DESC STUDENTSPLIT
INSERTING ROWS:
INSERT INTO STUDENTSPLIT VALUES('1421','ASHMI','BCA',80,72,95,247,'PASS');
INSERT INTO STUDENTSPLIT VALUES('1422','BANU','BCA',85,22,65,172,'FAIL');
Rows inserted.
VIEWING TABLE:
SELECT *FROM STUDENTSPLIT
DECLARE
CURSOR CUR_STUDET IS SELECT *FROM STUDENTSPLIT
WHERE RESULT = 'PASS' OR RESULT ='FAIL';
STUDET_REC CUR_STUDET%ROWTYPE;
BEGIN
DBMS_OUTPUT.PUT_LINE('FAIL MARK');
FOR STUDET_REC IN CUR_STUDET LOOP
IF STUDET_REC.RESULT='FAIL' THEN
DBMS_OUTPUT.PUT_LINE(STUDET_REC.REGNO || ' ' || STUDET_REC.NAME || '
'||STUDET_REC.DEGREE|| ' '||STUDET_REC.TOTAL||' '||STUDET_REC.RESULT );
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('PASS MARK');
FOR STUDET_REC IN CUR_STUDET LOOP
IF STUDET_REC.RESULT='PASS' THEN
DBMS_OUTPUT.PUT_LINE(STUDET_REC.REGNO || ' ' || STUDET_REC.NAME || '
'||STUDET_REC.DEGREE|| ' '||STUDET_REC.TOTAL||' '||STUDET_REC.RESULT );
END IF;
END LOOP;
END;
RESULT:
Thus the above program has been executed successfully and output has been
verified.
EX.NO .:5
DATE :
TRIGGER
AIM:
To write a oracle program to create a database trigger to implement on master
and transaction table.
ALGORITHM:
Table Created
DESC MASTER1
Rows inserted
VIEWING MASTER TABLE:
SELECT*FROM MASTER1
Rows inserted
Trigger Created
Trigger Created
RESULT
Thus the above program has been executed successfully and output has been
verified.
EX.NO .:6
DATE :
EXCEPTION HANDLING
AIM:
To write a oracle program to raise exception in bank account management table
on deposit amount is zero.
ALGORITHM:
Table Created
DESC BANK3
INSERTING ROWS:
INSERT INTO BANK3 VALUES(1021,'ASHMI','8/86 KANGAYAM-
TRI','9876543210','CANARA','50000','60000');
INSERT INTO BANK3 VALUES(1022,'HARSHA','12/22 RANTHAPURI-
CBE','9789712357','SBI','65000','0');
INSERT INTO BANK3 VALUES(1023,'KAIYA','1/22 KARAMATAI-
CBE','8508707239','INDIAN BANK','9000','1000');
INSERT INTO BANK3 VALUES(1024,'KARTHIC','11/122 SRM STR-
TRI','9786543210','SBI','59000','6000');
INSERT INTO BANK3 VALUES(1025,'SHIVA','7/16 KOTHAGRI-
OOTY','8508995230','TRAVANCORE','70000','');
INSERT INTO BANK3 VALUES(1026,'REVATHI','98/16 IRUGUR-
CBE','9875643210','CANARA','25000','0');
INSERT INTO BANK3 VALUES(1027,'ISHANAN','97/8 RSV STR-
SULUR','8508995230','INDIAN BANK','7000','3000');
VIEWING TABLE:
SELECT*FROM BANK3
DECLARE
INVALID_DEPOSIT EXCEPTION;
NO_DEPOSIT EXCEPTION;
V_DEPO BANK3.DEPOSIT%TYPE;
BEGIN
SELECT DEPOSIT INTO V_DEPO FROM BANK3 WHERE ACCNO=1025;
IF V_DEPO=0 THEN
RAISE INVALID_DEPOSIT;
ELSIF V_DEPO IS NULL THEN
RAISE NO_DEPOSIT;
ELSE
DBMS_OUTPUT.PUT_LINE(TO_CHAR(V_DEPO));
END IF;
EXCEPTION
WHEN INVALID_DEPOSIT THEN
DBMS_OUTPUT.PUT_LINE('DEPOSIT EQUAL TO 0');
WHEN NO_DEPOSIT THEN
DBMS_OUTPUT.PUT_LINE('NO DEPOSIT AMOUNT');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(TO_CHAR(V_DEPO));
END;
11000
Statement Processed
DEPOSIT EQUAL TO 0
Statement Processed
Statement Processed
RESULT:
Thus the above program has been executed successfully and output has been
verified.