Link to home
Start Free TrialLog in
Avatar of ck969
ck969

asked on

Can't create a field of type ordsys.ordimage ?

I was trying to store images in Oracle database, so I create simple table :

create table pictures
(id number,
 image ordsys.ordimage);

and i got this error for 'ordsys.ordimage':
ORA-00902: invalid datatype

I can see the ORDSYS schema in the database, so I presumed the object exists, what else I have to check ?
Avatar of rramineni
rramineni

How did you check?. Also did you check if you had proper privileges inorder to access the ordsys objects. May be you need to grant privileges to your current schema in order to reference these objects.
Avatar of Mark Geerlings
Normally in a "create table..." statement the data type for each column is explicitly specified, like this:

create table pictures
(id number,
image blob);

In PL\SQL it is possible to create variables that get their datatype from an existing table in the database, using syntax similar to what you tried (ordsys.ordimage%type), but I haven't ever seen that syntax used in a "create table..." statement.

It is possible to create tables that use user-defined data types instaed of the standard data types that Oracle supports.  If "ordimage" is a datatype then it may be possible to use that in a "create table..." statement, but the type may need to be in the same schema as the table.  If "ordimage" is just a column in a table, then no, you cannot create a table with that syntax.
ASKER CERTIFIED SOLUTION
Avatar of Datamonkey
Datamonkey

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, Datamonkey.  I haven't used or seen Oracle Intermedia so I didn't recognize that datatype.  Oracle is getting so broad these days that no one can be a master of all aspects of Oracle.