Re: Package-defined type as column type

From: NiTiN <k.nitin.r_at_gmail.com>
Date: Sun, 3 Feb 2008 04:50:44 -0800 (PST)
Message-ID: <615e7161-5b16-4476-a74f-aa35e794ccd7@v46g2000hsv.googlegroups.com>


Oops! I think I missed a warning - object types can't be declared in packages...

"Currently, you cannot define object types in a PL/SQL block, subprogram, or package. You can define them interactively in SQL*Plus using the SQL statement CREATE TYPE."

On Feb 3, 4:41 pm, NiTiN <k.niti..._at_gmail.com> wrote:
> Good day,
>
> I'm trying to use a package-defined type as the data type for a column
> in an Oracle table and am trying to figure out how to get it to work.
> I'm guessing package-defined types can't be used as column data types.
>
> Here's a sample:
> CREATE OR REPLACE PACKAGE pkg1_test
> IS
> TYPE usersource AS OBJECT (
> sourceinfo VARCHAR2(1024),
> sourcetype CHAR(1)
> );
> END pkg1_test;
>
> CREATE TABLE test1 (
> id INTEGER,
> val pkg1_test.usersource
> );
>
> -NiTiN
Received on Sun Feb 03 2008 - 06:50:44 CST

Original text of this message