Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Is this a bug?
Consider this:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Oracle Data
Mining options
JServer Release 9.2.0.6.0 - Production
SQL> create table test_fbi(a varchar2(4000));
Table created.
SQL> create index test_fbi_length on test_fbi(upper(a)) online compute
statistics;
create index test_fbi_length on test_fbi(upper(a)) online compute
statistics
*ERROR at line 1:
When I ran into this, I had an index created in my preprod environment, and Oracle was refusing to let me create it in my identical prod environment....I was stumped, how could it error on this here, but exist in preprod, which is identical in terms of version, O/S, block size, etc?
Now, I'm aware that any function that returns varchar2 implicitly returns varchar2(4000). Tom Kyte has a write up on this available here http://asktom.oracle.com/~tkyte/article1/index.html that explains it, and demonstrates how to work around it by wrapping the output in a SUBSTR() and then hiding that inside of a view. That's all fine and well and good. What I didn't understand is HOW I was ever allowed to create the index in preprod.....and then I discovered this:
SQL> create index test_fbi_length on test_fbi(upper(a)) online compute
statistics;
create index test_fbi_length on test_fbi(upper(a)) online compute
statistics
*ERROR at line 1:
SQL> c/online/
1* create index test_fbi_length on test_fbi(upper(a)) compute
statistics
SQL> /
Index created.
Why does it work when you drop the ONLINE keyword?? In fact, it doesn't even need to be an FBI to demonstrate this behavior. Observe:
SQL> create index test_ind_key_length on test_fbi(a) online compute
statistics;
create index test_ind_key_length on test_fbi(a) online compute
statistics
*
SQL> c/online/
1* create index test_ind_key_length on test_fbi(a) compute statistics
SQL> /
Index created.
Anyone else think this is a bit weird, not to mention inconsistent, behavior?
Any thoughts/ideas?
-Mark
--
Mark J. Bobak
Senior Oracle Architect
ProQuest Information & Learning
"Exception: Some dividends may be reported as qualified dividends but are not qualified dividends. These include:
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Feb 24 2006 - 11:09:13 CST
![]() |
![]() |