Stored Procedure question
From: sahcutie <sahcutie_at_yahoo.com>
Date: 12 Oct 2005 13:23:02 -0700
Message-ID: <1129148582.063376.237560_at_f14g2000cwb.googlegroups.com>
[Quoted] [Quoted] I am a newbie in oracle and I have written a stored procedure that should return multiple records. I have implemented cursors and I was wondering if anyone would point out what is wrong. I have pasted my stored procedure below:
Any help is appreciated. Also any links to help me along the path will also be really appreciated.
from PS_VENDOR a, PS_VENDOR_PAY b, PS_VENDOR_ADDR c where a.NAME1 like '%' || LASTNAME || '%'
Date: 12 Oct 2005 13:23:02 -0700
Message-ID: <1129148582.063376.237560_at_f14g2000cwb.googlegroups.com>
[Quoted] [Quoted] I am a newbie in oracle and I have written a stored procedure that should return multiple records. I have implemented cursors and I was wondering if anyone would point out what is wrong. I have pasted my stored procedure below:
Any help is appreciated. Also any links to help me along the path will also be really appreciated.
CREATE OR REPLACE PROCEDURE VINFO
(
"LASTNAME" IN VARCHAR2) IS
TYPE varVendorNumber is TABLE OF VARCHAR2(10); TYPE varVendorAddress1 is TABLE OF VARCHAR2(35); TYPE varVendorAddress2 is TABLE OF VARCHAR2(35); TYPE varVendorCity is TABLE OF VARCHAR2(30); TYPE varVendorState is TABLE OF VARCHAR2(6); TYPE varVendorPostal is TABLE OF VARCHAR2(12); TYPE varVendorCountry is TABLE OF VARCHAR2(3); VenNum varVendorNumber; VenAdd1 varVendorAddress1; VenAdd2 varVendorAddress2; VenCity varVendorCity; VenState varVendorState; VenPostal varVendorPostal; VenCountry varVendorCountry; CURSOR C_Vendor IS select a.VENDOR_ID, c.ADDRESS1, c.ADDRESS2,c.CITY, c.STATE, c.POSTAL, c.COUNTRY
from PS_VENDOR a, PS_VENDOR_PAY b, PS_VENDOR_ADDR c where a.NAME1 like '%' || LASTNAME || '%'
and a.VENDOR_ID = b.vendor_id and a.vendor_id = c.vendor_id and b.PYMNT_GROUP_CD = 'EM' and a.VENDOR_STATUS = 'A' and c.eff_status = 'A' and c.ADDRESS_SEQ_NUM = a.PRIM_ADDR_SEQ_NUM;
BEGIN -- executable part starts here
OPEN C_Vendor;
FETCH C_Vendor BULK COLLECT INTO VenNum, VenAdd1, VenAdd2,VenCity,
VenState, VenPostal,VenCountry;
CLOSE C_Vendor;
END "VINFO"; Received on Wed Oct 12 2005 - 22:23:02 CEST