Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    41

    Unanswered: Creating a Package

    Hello!

    I need help with creating a package. I need declare type inside the package but this type should be object. Delclaration you can see below returns error "Object does not supported...".
    Can anybody help how do it, how it should be right?

    Thank you...
    Ondrej


    create or replace package PACKAGE_TEST is

    TYPE tPozadavek IS OBJECT (
    CdmId NUMBER,
    OrderId VARCHAR2(20),
    PrDb VARCHAR2(3),
    PrEvCis VARCHAR2(255),
    PrRok VARCHAR2(4),
    PocSluzeb VARCHAR2(4),
    PrTypSluzby VARCHAR2(10),
    T_zadosti DATE,
    PrKodZsj VARCHAR2(5),
    StavPoz VARCHAR2(10),
    Login VARCHAR2(10),
    T_zmeny DATE
    );

    PROCEDURE "CDMP_IA_STAV" (
    pInPolygonId IN NUMBER,
    pInInc IN NUMBER,
    pInStav IN VARCHAR2,
    pInIntCis IN VARCHAR2,
    pInProNazev IN VARCHAR2,
    pInSap IN VARCHAR2,
    pInLogin IN VARCHAR2,
    pOutErrKod OUT VARCHAR2,
    pOutErrText OUT VARCHAR2);

    end PACKAGE_TEST;

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Creating a Package

    You cannot declare object types in PL/SQL. Depending on what you are trying to achieve here, you have 2 choices:

    1) Change "OBJECT" to "RECORD":

    Code:
    create or replace package PACKAGE_TEST is
    
      TYPE tPozadavek IS RECORD (   
    ...
    2) Declare the type as a standalone type, not in the package:

    Code:
    CREATE OR REPLACE TYPE tPozadavek IS OBJECT (   
      	 CdmId 	NUMBER,
    	   OrderId 	VARCHAR2(20),
    	   PrDb 		VARCHAR2(3),
    	   PrEvCis 	VARCHAR2(255),
    	   PrRok 	VARCHAR2(4),
    	   PocSluzeb 	VARCHAR2(4),
    	   PrTypSluzby VARCHAR2(10),
    	   T_zadosti 	DATE,
    	   PrKodZsj 	VARCHAR2(5),
    	   StavPoz 	VARCHAR2(10),
    	   Login 	VARCHAR2(10),
    	   T_zmeny 	DATE
      );
    /
    
    create or replace package PACKAGE_TEST is
    
      PROCEDURE "CDMP_IA_STAV" (
       pInPolygonId IN NUMBER,
       pInInc IN NUMBER,
       pInStav IN VARCHAR2,
       pInIntCis IN VARCHAR2,
       pInProNazev IN VARCHAR2,
       pInSap IN VARCHAR2,
       pInLogin IN VARCHAR2,	
       pOutErrKod OUT VARCHAR2,
       pOutErrText OUT VARCHAR2);
       
    end PACKAGE_TEST;
    /

  3. #3
    Join Date
    Jan 2003
    Posts
    41

    Re: Creating a Package

    Yes I found out I cannot declare object type inside a package so I did it like you say in point 2.

    Thanks


    Originally posted by andrewst
    You cannot declare object types in PL/SQL. Depending on what you are trying to achieve here, you have 2 choices:

    1) Change "OBJECT" to "RECORD":

    Code:
    create or replace package PACKAGE_TEST is
    
      TYPE tPozadavek IS RECORD (   
    ...
    2) Declare the type as a standalone type, not in the package:

    Code:
    CREATE OR REPLACE TYPE tPozadavek IS OBJECT (   
      	 CdmId 	NUMBER,
    	   OrderId 	VARCHAR2(20),
    	   PrDb 		VARCHAR2(3),
    	   PrEvCis 	VARCHAR2(255),
    	   PrRok 	VARCHAR2(4),
    	   PocSluzeb 	VARCHAR2(4),
    	   PrTypSluzby VARCHAR2(10),
    	   T_zadosti 	DATE,
    	   PrKodZsj 	VARCHAR2(5),
    	   StavPoz 	VARCHAR2(10),
    	   Login 	VARCHAR2(10),
    	   T_zmeny 	DATE
      );
    /
    
    create or replace package PACKAGE_TEST is
    
      PROCEDURE "CDMP_IA_STAV" (
       pInPolygonId IN NUMBER,
       pInInc IN NUMBER,
       pInStav IN VARCHAR2,
       pInIntCis IN VARCHAR2,
       pInProNazev IN VARCHAR2,
       pInSap IN VARCHAR2,
       pInLogin IN VARCHAR2,	
       pOutErrKod OUT VARCHAR2,
       pOutErrText OUT VARCHAR2);
       
    end PACKAGE_TEST;
    /

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •