PL SQL Variables

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

PL/SQL Variable Declarations

NOTE: “- - “indicates a commented line.

create table Student2(sid int, sname varchar2(20));

set serveroutput on
declare
--a Student2.sid%type :=&a;
--b Student2.sname%type:='&b';
mrec Student2%rowtype;
id Student2.sid%type:=&id;
begin
select sid,sname into mrec from Student2 where sid=id;
dbms_output.put_line(mrec.sid||' '||mrec.sname);
--insert into Student2 values(a,b);
end;
select * from Student2;

You might also like