Saturday, February 15, 2014

SQL Store procedure Example


CREATE OR REPLACE

PROCEDURE SIDD_USER_CREDITCARDS
(
  CUSTID IN NUMBER DEFAULT 77086,
  CUSTCCNUM OUT VARCHAR2
)

AS

SELECT_SQL VARCHAR2(4000);
CUSTID_IN NUMBER;

CURSOR s_cursor(s_customer_id NUMBER) IS

SELECT CREDIT_CARD_ID AS ccnum
FROM
CREDIT_CARD_ENC
WHERE
customer_id in (s_customer_id);

BEGIN
  CUSTID_IN := CUSTID;
  CUSTCCNUM := 10;

       FOR cc_rec in s_cursor(CUSTID_IN)
          LOOP
            CUSTCCNUM :=cc_rec.ccnum;
          END LOOP;


END SIDD_USER_CREDITCARDS;

No comments :

Post a Comment