| | |
pl/sql
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 24
Reputation:
Solved Threads: 0
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 ;
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 ;
![]() |
Similar Threads
- Freelance .NET / MS SQL developer (Web Development Job Offers)
- Software Engineer (.NET , SQL) (Software Development Job Offers)
- UPS is Hiring!! PL/SQL & UNIX Technical Specialist (Software Development Job Offers)
- SQL Server DBA - " Hot " (Software Development Job Offers)
- PHP / My SQL Web developer (Web Development Job Offers)
- Sql Dba (Software Development Job Offers)
- SQL Server DBA (Software Development Job Offers)
- SQL Server vs MYSQL vs MSQL (i'm stopping now) (MS SQL)
Other Threads in the Oracle Forum
- Previous Thread: duplicate key
- Next Thread: sql
| Thread Tools | Search this Thread |
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






