943,754 Members | Top Members by Rank

Ad:
  • Oracle Discussion Thread
  • Unsolved
  • Views: 1019
  • Oracle RSS
Oct 18th, 2008
0

pl/sql

Expand Post »
hi

i am creating stored procedure using cursors, i am using two cursors in my procedure, i takes the two fields in one table that fields are stored first cursor, and second table fields are stored in second cursor, and i check the condition for first table one field is equal to second table one field in if loop, the condition is matches the all field insert in one table other wise all field is insert into one table


the if condition cannot be executed?

help me



my procedure is:











create or replace
PROCEDURE PRODUCTSUMMA AS
TYPE RECORD IS REF CURSOR;
CURI RECORD;
CURP RECORD;
NAME VARCHAR(400):=NULL;
DESC1 VARCHAR(400):=NULL;
DESC2 VARCHAR(400):=NULL;
PRODUCTID NUMBER:=NULL;
itemid number:=null;
PRODUCTNAME VARCHAR(40):=NULL;
BEGIN

FOR CURI IN
(select shortdesc||' '||ean||' '||'('||UNSPC||')' as name, itemid from item where classid not like '20%' and orgin<>'Sale' and entityid='VAISHNAVI' AND ean is not null)
LOOP
DESC1:=CURI.NAME;
itemid:=curi.itemid;

FOR CURP IN
(SELECT M_PRODUCT_ID,NAME FROM M_PRODUCT WHERE PRODUCTTYPE='I' and ad_client_id=1000001)
LOOP
DESC2:=CURP.NAME;
productid:=curp.m_product_id;

IF(DESC1=DESC2)
THEN
INSERT INTO TEMP_PRODUCT(ITEMID,M_PRODUCT_ID,NAME) VALUES(CURI.ITEMID,CURP.M_PRODUCT_ID,CURP.NAME);
ELSE
INSERT INTO UNMATCHPRODUCT(ITEMID,M_PRODUCT_ID,NAME) VALUES(CURI.ITEMID,CURP.M_PRODUCT_ID,CURP.NAME);
END IF;


END LOOP;
END LOOP;

END ;
Reputation Points: 10
Solved Threads: 0
Newbie Poster
balakrishnan.kb is offline Offline
24 posts
since Aug 2008
Oct 18th, 2008
0

Re: pl/sql

what is the problem with IF ?
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Oct 20th, 2008
0

Re: pl/sql

my problem is the if condition cannot be executed


thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
balakrishnan.kb is offline Offline
24 posts
since Aug 2008
Oct 21st, 2008
0

Re: pl/sql

is that throwing any error ?
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Oct 23rd, 2008
0

Re: pl/sql

no error is occured, is my procedure is correct or not?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
balakrishnan.kb is offline Offline
24 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Oracle Forum Timeline: duplicate key
Next Thread in Oracle Forum Timeline: sql





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC