Unix Technical Forum

owa_pattern.pattern as a type

This is a discussion on owa_pattern.pattern as a type within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi, Why can't I use owa_pattern.pattern as a column type? SQL> create table temp( 2 names owa_pattern.pattern 3 ) ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 08:21 AM
Mike Reed
 
Posts: n/a
Default owa_pattern.pattern as a type

Hi,
Why can't I use owa_pattern.pattern as a column type?

SQL> create table temp(
2 names owa_pattern.pattern
3 ) nested table names store as temp_names;
names owa_pattern.pattern
*
ERROR at line 2:
ORA-00902: invalid datatype


SQL>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 08:21 AM
stephen O'D
 
Posts: n/a
Default Re: owa_pattern.pattern as a type


Mike Reed wrote:
> Hi,
> Why can't I use owa_pattern.pattern as a column type?
>
> SQL> create table temp(
> 2 names owa_pattern.pattern
> 3 ) nested table names store as temp_names;
> names owa_pattern.pattern
> *
> ERROR at line 2:
> ORA-00902: invalid datatype
>
>
> SQL>


I don't think you can create a table based on a PLSQL type. It has to
be an object type:-

create or replace type pattern as object ( p1 varchar2(4) );
/

create or replace type pattern_a as table of pattern;
/

create table test_pat ( names pattern_a ) nested table names store as
names;

That works!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 08:21 AM
Mike Reed
 
Posts: n/a
Default Re: owa_pattern.pattern as a type

On Tue, 20 Dec 2005 06:27:35 -0800, stephen O'D wrote:

>
> Mike Reed wrote:
>> Hi,
>> Why can't I use owa_pattern.pattern as a column type?
>>
>> SQL> create table temp(
>> 2 names owa_pattern.pattern
>> 3 ) nested table names store as temp_names;
>> names owa_pattern.pattern
>> *
>> ERROR at line 2:
>> ORA-00902: invalid datatype
>>
>>
>> SQL>

>
> I don't think you can create a table based on a PLSQL type. It has to
> be an object type:-
>
> create or replace type pattern as object ( p1 varchar2(4) );
> /
>
> create or replace type pattern_a as table of pattern;
> /
>
> create table test_pat ( names pattern_a ) nested table names store as
> names;
>
> That works!


It does work. Thanks. However, it doesn't solve my real problem. I have a
fixed set of regular expressions that I am matching. So for speed I
wanted to store the precompiled patterns in a table. i.e. I wanted to
store the out param from owa_pattern.getpat in a table so that I could do
something like:

select id from temp where owa_pattern.amatch('some text', 1, precomp) > 1;

and it would call the version of amatch that took a precompiled regular
expression. This requires the column precomp to be of type
owa_pattern.pattern. Oh well! It seemed like a good idea.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com