Create or replace procedure Sp_addprojectqj (
RET out number,
Flowid in number--process ID
)
As
Cursor C_design is
SELECT * from lc_vr_detail where lc_crm_visitreport_id = Flowid and Dd_status! = 2;
C_row C_design%rowtype;
V_ID number;
Begin
For C_row in C_design loop
Pnextid (' T_xmsjqj ', v_id);
--Items related to device (ID, project name, device) values--design Schedule (v_id, project name, device name)
Insert into T_XMSJQJ (ID,F2,SJ,FQJ,F3,CJ,FSL,FBZ,FQZJE,FLDKNX,FLDJZ,FCYYY,FDOCNUM,FGDYY,F6,BZ)
VALUES (V_id,c_row.dd_project,c_row. Dd_newtime,c_row.dd_name,c_row.dd_model,c_row.dd_brand,
C_row.dd_num,c_row.dd_currency,c_row.dd_hidecash,c_row. Dd_surechance,c_row. Dd_sureevolve,
C_row. Dd_difference,c_row.dd_docnum,c_row.dd_whyclose,c_row.dd_designinstatus,c_row.dd_remarks);
Commit
End Loop;
Ret:=1;
EXCEPTION
When OTHERS Then
Ret:=-1;
End
Examples of Oracle cursor loops