rowtype

Oracle: Insert rowtype data into another table

半城伤御伤魂 提交于 2019-11-27 06:07:43
问题 I have one table called event , and created another global temp table tmp_event with the same columns and definition with event. Is it possible to insert records in event to tmp_event using this ? DECLARE v_record event%rowtype; BEGIN Insert into tmp_event values v_record; END; There are too many columns in event table, I want to try this because I don't want to list all the columns. Forget to mention: I will use this in the trigger, can this v_record be the object :new after insert on EVENT

how to declare %ROWTYPE of a variable that is a weakly typed SYS_REFCURSOR?

心不动则不痛 提交于 2019-11-26 17:24:28
问题 W.r.t code below I can not declare the type of fetch-into-variable as the underlying table's %ROWTYPE because the SYS_REFCURSOR is on a select that joins two tables and also selects a few functions called on the attributes of the underlying two tables; i.e I can't declare as L_RECORD T%ROWTYPE --- DECLARE P_RS SYS_REFCURSOR; L_RECORD P_RS%ROWTYPE; BEGIN CAPITALEXTRACT( P_RS => P_RS ); OPEN P_RS; LOOP BEGIN FETCH P_RS INTO L_RECORD; EXIT WHEN P_RS%NOTFOUND; ... EXCEPTION WHEN OTHERS THEN ...