Home » Developer & Programmer » Forms » insert by cursor
insert by cursor [message #577614] Tue, 19 February 2013 01:48 Go to next message
n.shahab
Messages: 3
Registered: February 2013
Junior Member
hi
i want insert in detail block by The following function and I want If the change P2_SLT_ID( id block master )
Clear block detail then Insert new values but Insert a row

Please Please Help
FUNCTION cat_elemnt_insert(P2_SLT_ID NUMBER, p_itca_cod VARCHAR2,P_ERR_LST IN OUT VARCHAR2)
RETURN BOOLEAN is

CURSOR CUR_ITCE IS
SELECT ITCE.ITCE_ITCA_COD ,ITCE.ITCE_FLG_REQUIRED,ITCE.ITCE_ICET_COD,ITCE.ITCE_MSUN_COD
FROM WAM_ITEM_CATALOG_ELEMENTS ITCE
WHERE ITCE.ITCE_ITCA_COD= p_itca_cod;


BEGIN

begin

FOR C IN CUR_ITCE LOOP
DELETE SAL_LAYOUT_SPECIFICATIONS S
WHERE S.SALS_SALT_ID=P2_SLT_ID ;

INSERT INTO SAL_LAYOUT_SPECIFICATIONS(
SALS_ID ,
SALS_SALT_ID ,
SALS_ITCE_ITCA_COD,
SALS_ITCE_ICET_COD ,
SALS_VALUE

) VALUES(
SALS_SEQ.NEXTVAL,
P2_SLT_ID ,
C.ITCE_ITCA_COD,
C.ITCE_ICET_COD ,
NULL);

END LOOP ;

exception
when others then
p_err_lst := p_err_lst||','||substr(sqlerrm,1,9)||',$sal-10037';
RETURN FALSE ;
end;
return TRUE;
END cat_elemnt_insert;
Re: insert by cursor [message #577615 is a reply to message #577614] Tue, 19 February 2013 02:05 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals.

2/
Remove WHEN OTHERS it is a bug.

Regards
Michel
Previous Topic: ERROR 103 (cant see what was wrong)
Next Topic: Associative Array in Oracle Forms 6i
Goto Forum:
  


Current Time: Thu Apr 25 00:49:11 CDT 2024