2

I want to create a RECORD type based on a table which also contain an extra column. something like this:

type rec is record
(
  x urowid,
  test_exception%rowtype
);

inst_rec rec;

Thanks for any help

1
  • I'm afraid you're going to have to write all the fields of the test_exception table Commented Jun 8, 2016 at 8:56

1 Answer 1

4

You just need to name the rowtype part:

type rec is record
(
  x urowid,
  te_rec test_exception%rowtype
);

inst_rec rec;

For example, using the EMP table:

declare
   type t_emp_plus_rec is record
      ( emprec emp%rowtype
      , extra integer
      );
   emp_plus_rec t_emp_plus_rec;
begin
   emp_plus_rec.emprec.empno := 123;
   emp_plus_rec.emprec.ename := 'SMITH';
   emp_plus_rec.extra := 3;
end;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.