Tuesday, February 7, 2017

Data types




declare--%plsql type
type Siddharth is record(P_name XXX_test.name%type,
                         Q_id   XXX_test.id%type);                      
reddy Siddharth;
begin
Select name,id  into reddy from XXX_test where Id=&id;
dbms_output.put_line(reddy.P_name||','||reddy.Q_id);
end;


declare
Siddharth  XXX_test%rowtype;--%rowtype
begin
Select * into Siddharth from XXX_test where ID=&ID;
dbms_output.put_line(Siddharth.name);
end;


declare
Siddharth  XXX_test.name%type;--%type
begin
Select name into Siddharth from XXX_test where ID=&ID;
dbms_output.put_line(Siddharth);
end;

No comments:

Post a Comment