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;

Comments

Popular posts from this blog

Difference between volatile and synchronized

Converting Java Map to String

Masking Credit Card number in Java