|
-
I have created the following simple test package, and it compiles successfully. But when I try to execute it, I get an error (see below code of package):
create or replace package dsw_pkg as
procedure oms_process;
end dsw_pkg;
/
create or replace package body dsw_pkg as
PROCEDURE DO_IT
(v_originating_number IN VARCHAR2,
v_account_number IN VARCHAR2,
v_existing_tickets IN NUMBER);
PROCEDURE OMS_PROCESS IS
v_existing_tickets NUMBER(7) := 0;
CURSOR oms_trouble_t_data
IS
SELECT *
FROM dsw_trouble
WHERE oms_process_flag = 'N';
BEGIN
FOR t_rec IN oms_trouble_t_data LOOP
EXIT WHEN oms_trouble_t_data%NOTFOUND;
SELECT COUNT(*)
INTO v_existing_tickets
FROM dsw_trouble_call
WHERE dsw_trouble_call.originating_number = t_rec.oms_originating_number;
IF v_existing_tickets > 0 THEN
do_it(t_rec.oms_originating_number, t_rec.oms_account_number,
v_existing_tickets);
END IF;
END LOOP;
END OMS_PROCESS;
PROCEDURE DO_IT
(v_originating_number IN VARCHAR2,
v_account_number IN VARCHAR2,
v_existing_tickets IN NUMBER)
IS
BEGIN
DBMS_OUTPUT.PUT_LINE(v_originating_number || ' ' || v_account_number
|| ' ' || v_existing_tickets);
END DO_IT;
END DSW_PKG;
/
SQL> exec dsw_pkg;
begin dsw_pkg; end;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00221: 'DSW_PKG' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Any ideas? Thanks much.
-
Try exec dsw_pkg.oms_process
A package by itself is not an executable block. The procedure within the package is what you want to execute.
- Chris
-
That was it! Thanks so much.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|