0

I want to try insert loghis of table into one column for saving spaces

before  Delete on SmtTable
for each row
declare
v_loghis SmtTable%rowtype;
v_tabVar varchar2(2000);
begin
v_loghis.empo :=  'old' || :old.empo;
v_loghis.name :=  'old' || :old.name
v_loghis.adress:= 'old  || :old.adress';

here what i can use for inserting v_loghis into one column

for r in v_loghis
loop
v_tabVar := ':' || r.vloghis ;
end loop
insert into TabHis(col1) values(v_tabVar);
end;

was error v_loghis not cursor..

1
  • I think the error message is obvious(not cursor). Btw, does SmtTable has vloghis column(we ain't know the content of the table) ? Commented Mar 28, 2022 at 6:08

1 Answer 1

1

for saving spaces

You must be kidding. You won't save any space, but create a nightmare for future revisions of data you store.

Because, your next question will be:

I have a long string that looks like this: "old.7369:old.SCOTT:old.Traffalgar Square 23/A, London". How do I join this "7369" EMPO column value to EMPLOYEES table?

Shortly: don't do that. If you're performing some kind of an audit, then store each column separately.

Don't forget the timestamp column (so that you'd know when something happened) and operation (insert/update/delete) that caused that row to be inserted into the audit table.

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.