CREATE OR REPLACE FUNCTION getinv (p1 IN NUMBER, p2 NUMBER)
RETURN VARCHAR
AS
v_invno VARCHAR2 (50);
BEGIN
SELECT invoice_num
INTO v_invno
FROM ap_invoices_all a
WHERE a.invoice_id = p1 AND a.org_id = p2;
RETURN v_invno;
END;
/
CREATE OR REPLACE FUNCTION getinvamt (p1 IN NUMBER)
RETURN NUMBER
AS
v_amt ap_invoices_all.invoice_
amount%TYPE;
BEGIN
SELECT invoice_amount
INTO v_amt
FROM ap_invoices_all a
WHERE a.invoice_id = p1;
RETURN v_amt;
END;
/
CREATE OR REPLACE FUNCTION getinvtype (p1 IN NUMBER)
RETURN VARCHAR
AS
v_invno VARCHAR2 (50);
BEGIN
SELECT invoice_type_lookup_code
INTO v_invno
FROM ap_invoices_all a
WHERE a.invoice_id = p1;
RETURN v_invno;
END;
/
RETURN VARCHAR
AS
v_invno VARCHAR2 (50);
BEGIN
SELECT invoice_num
INTO v_invno
FROM ap_invoices_all a
WHERE a.invoice_id = p1 AND a.org_id = p2;
RETURN v_invno;
END;
/
CREATE OR REPLACE FUNCTION getinvamt (p1 IN NUMBER)
RETURN NUMBER
AS
v_amt ap_invoices_all.invoice_
BEGIN
SELECT invoice_amount
INTO v_amt
FROM ap_invoices_all a
WHERE a.invoice_id = p1;
RETURN v_amt;
END;
/
CREATE OR REPLACE FUNCTION getinvtype (p1 IN NUMBER)
RETURN VARCHAR
AS
v_invno VARCHAR2 (50);
BEGIN
SELECT invoice_type_lookup_code
INTO v_invno
FROM ap_invoices_all a
WHERE a.invoice_id = p1;
RETURN v_invno;
END;
/
No comments:
Post a Comment