Q

Updating rows with %rowtype

Can we update rows with the help of %rowtype?

Can we update rows with the help of %rowtype?
Yes.

Example:

 
Declare
  
    ---- Define a varibable with a record type
employee employee%rowtype;
 
begin
 
    ---- initialize field values
employee.empno := 1;
employee.first_name := 'Greg';
employee.last_name := 'Williams';
employee.country := 'USA';
 
--insert into the table
 
insert into employee values 
( employee.empno,
   employee.first_name,
   employee.last_name,
   employee.country );
 
commit;
 
end;
/
This was first published in September 2006

Dig deeper on Using Oracle PL-SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close