pl/sql

Reply

Join Date: Aug 2008
Posts: 24
Reputation: balakrishnan.kb is an unknown quantity at this point 
Solved Threads: 0
balakrishnan.kb balakrishnan.kb is offline Offline
Newbie Poster

pl/sql

 
0
  #1
Oct 18th, 2008
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 ;
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,096
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: pl/sql

 
0
  #2
Oct 18th, 2008
what is the problem with IF ?
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 24
Reputation: balakrishnan.kb is an unknown quantity at this point 
Solved Threads: 0
balakrishnan.kb balakrishnan.kb is offline Offline
Newbie Poster

Re: pl/sql

 
0
  #3
Oct 20th, 2008
my problem is the if condition cannot be executed


thanks
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,096
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: pl/sql

 
0
  #4
Oct 21st, 2008
is that throwing any error ?
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 24
Reputation: balakrishnan.kb is an unknown quantity at this point 
Solved Threads: 0
balakrishnan.kb balakrishnan.kb is offline Offline
Newbie Poster

Re: pl/sql

 
0
  #5
Oct 23rd, 2008
no error is occured, is my procedure is correct or not?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Oracle Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC