Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Package compilation Error 1

Status
Not open for further replies.

tezeey

Vendor
Oct 11, 2009
5
NA
please help me with this package... its compiling with warning and i cant figure them out. thank you in advance.

/* CREATES PACKAGE SPECIFICATION*/
CREATE OR REPLACE PACKAGE INVENTORY AS
CREATE PROCEDURE ENTER_USERS(
LAST_NAME VARCHAR2,
FIRST_NAME VARCHAR2,
EMAIL VARCHAR2,
USER_NAME VARCHAR2,
TYPE_OF_USER VARCHAR2,
PIN VARCHAR2);
CREATE PROCEDURE ENTER_ITERMS(EQUIPMENT_NAME VARCHAR2,USER_NAME VARCHAR2,
USER_TYPE VARCHAR2,
PIN VARCHAR2, DESCRIPTION VARCHAR2,ON_HAND NUMBER);
END INVENTORY;


ORA-02253 constraint specification not allowed here.
 
Tezeey,

Syntactically, you are not far the mark. I've "spruced up" you code to make it follow "good-form" coding appearance, but effectively, all I have changed from your original code is to remove the extraneous CREATE commands in front of your packaged procedure definitions:
Code:
CREATE OR REPLACE PACKAGE INVENTORY AS
PROCEDURE ENTER_USERS
    (LAST_NAME                      VARCHAR2
    ,FIRST_NAME                     VARCHAR2
    ,EMAIL                          VARCHAR2
    ,USER_NAME                      VARCHAR2
    ,TYPE_OF_USER                   VARCHAR2
    ,PIN                            VARCHAR2
    );
PROCEDURE ENTER_ITEMS
    (EQUIPMENT_NAME                 VARCHAR2
    ,USER_NAME                      VARCHAR2
    ,USER_TYPE                      VARCHAR2
    ,PIN                            VARCHAR2
    ,DESCRIPTION                    VARCHAR2
    ,ON_HAND                        NUMBER
    );
END INVENTORY;     
/

Package created.
Now, although your code, above, successfully compiles...It obviously doesn't actually DO anything. For that, you will need to finish the job by now building the package body. Once you compose that, if you have syntax trouble, we'll be glad to help you cross (or burn) that bridge when you get to it.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top