Write a PL/SQL block to display the Information of given student on following table Stud (sno, sname, address, city)., PL/SQL Program to display the Information of given student on following table Stud (sno, sname, address, city)
Table Creation…
create table stud(
sno number primary key,
sname char(15),
addr varchar(30),
city char(15));
insert into stud values(1,'hiral','2,krishna society','Mehsana.');
insert into stud values(2,'pinky','4,Kalyaneshwer society','Mehsana.');
insert into stud values(3,'Dhruvi','24,Pushpavati society','Mehsana');
Program…
declare
no number;
n number;
name char(15);
add varchar(50);
c char(15);
begin
n:=&n;
select sno,sname,addr,city into no,name,add,c from stud where sno=n;
dbms_output.put_line('The Sno is ' || no);
dbms_output.put_line('The Sname is ' || name);
dbms_output.put_line('The address is ' || add);
dbms_output.put_line('The city is ' || c);
end;
No comments:
Post a Comment