oracle

Saturday, 29 April 2017

PL/SQL: INSERT DATA AS MEMORY VARIABLES.

First of all , we create a table.

Table:
create table t1 (c1 number(3), c2 varchar2(30), c3 date);

Result:
table created.

Insert data into table t1 Using PL/SQL MEMORY_VARIABLE:

Code:
declare
a number:=2;
d date:=sysdate;
begin
insert into t1 values(1,'Talha','29-apr-2017');
insert into t1 values(a,'Zubair',d);
insert into t1 (c1,c3) values(3,d);
end;

Result:
3 ROWS inserted

Now check
select * from t1;

Result:
1 Talha 29-APR-17
2 Zubair 30-APR-17
3         30-APR-17

No comments:

Post a Comment