create SQL interface to insert data to table


SQL> select studentid, firstname, lastname from students;
Employee Salary statistics
STUDENTID FIRSTNAME LASTNAME
---------- ------------------------------ ----------------
1 michael Green
2 biLLy Hill
3 Jessica Harris
4 Jeff King
5 Jenny Allen
5 rows selected.
SQL>
CREATE PROGRAM TO MAKE INTERFACE TO ADD DATA TO TABLE:
SQL> edit newstu
prompt =========================================
prompt
prompt INSERT NEW STUDENT
prompt
prompt =========================================
prompt Please provide the following information:
accept stuid NUMBER prompt "ID :"
accept fname prompt "First Name:"
accept lname prompt "Last Name:"
INSERT INTO students(studentid, firstname, lastname)
VALUES ('&stuid', '&fname', '&lname');
SQL> start newstu
=========================================
INSERT NEW STUDENT
=========================================
Please provide the following information:
ID :6
First Name:joe
Last Name:eugine
old 2: VALUES ('&stuid', '&fname', '&lname')
new 2: VALUES (' 6', 'joe', 'eugine')
1 row created.
SQL> select studentid, firstname, lastname from students;
Employee Salary statistics
STUDENTID FIRSTNAME LASTNAME
---------- ------------------------------ -----------------
1 michael Green
2 biLLy Hill
3 Jessica Harris
4 Jeff King
5 Jenny Allen
6 joe eugine
6 rows selected.
SQL>
| Attachment | Size |
|---|---|
| newstu.sql_.txt | 399 bytes |
- sql_command's blog
- Login or register to post comments
- 722 reads
- Email this page












