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 last published in September 2006

Dig Deeper on Using Oracle PL-SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close