f



Function Based Index and java.lang.String

Hi.

I have a java stored procedure whose spec is as follows:

CREATE OR REPLACE FUNCTION DECODE_SEQUENCE(SEQUENCE VARCHAR2) RETURN
VARCHAR2
DETERMINISTIC
AS LANGUAGE JAVA
NAME 'kr.ac.dke.protein.compression.SequenceCompressor.decode(java.lang.String)
return java.lang.String';
/

AND I want to make an index like below:

CREATE INDEX K0_IDX ON K0(DECODE_SEQUENCE(TYPESTR),  TYPELEN)
NOLOGGING
COMPRESS 2
/

However, above statement raises an error, saying that 'Maximum size of
index field is excceded.' Hence, I've changed the index creation
statement.

CREATE INDEX K0_IDX ON K0(SUBSTR(DECODE_SEQUENCE(TYPESTR),1,1), 
TYPELEN)
NOLOGGING
COMPRESS 2
/

This works.

Here's the question. Can't I create an index on java.lang.String 
without using SUBSTR function?

Regards,
Minkoo Seo
0
pool0078
6/21/2004 3:40:29 PM
comp.databases.oracle 1791 articles. 0 followers. tgugger5 (31) is leader. Post Follow

1 Replies
591 Views

Similar Articles

[PageSpeed] 20

"Min-Koo Seo" <pool0078@hanmail.net> wrote in message
news:4c458db8.0406210740.561bf50c@posting.google.com...
> Hi.
>
> I have a java stored procedure whose spec is as follows:
>
> CREATE OR REPLACE FUNCTION DECODE_SEQUENCE(SEQUENCE VARCHAR2) RETURN
> VARCHAR2
> DETERMINISTIC
> AS LANGUAGE JAVA
> NAME
'kr.ac.dke.protein.compression.SequenceCompressor.decode(java.lang.String)
> return java.lang.String';
> /
>
> AND I want to make an index like below:
>
> CREATE INDEX K0_IDX ON K0(DECODE_SEQUENCE(TYPESTR),  TYPELEN)
> NOLOGGING
> COMPRESS 2
> /
>
> However, above statement raises an error, saying that 'Maximum size of
> index field is excceded.' Hence, I've changed the index creation
> statement.
>
> CREATE INDEX K0_IDX ON K0(SUBSTR(DECODE_SEQUENCE(TYPESTR),1,1),
> TYPELEN)
> NOLOGGING
> COMPRESS 2
> /
>
> This works.
>
> Here's the question. Can't I create an index on java.lang.String
> without using SUBSTR function?
>
> Regards,
> Minkoo Seo

It doesn't know how large a key is and a key cannot be larger than half a db
block.  But with substring the key cannot exceed half a database block.
Jim


0
Jim
6/22/2004 4:29:56 AM
Reply:

Similar Artilces:

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

Oracle ignoring function-based index
Hi all, The EXPLAIN PLAN for this: update hse.colour set chs_uid = (select librarycolor_id from chs.librarycolor where upper(librarycolor.colorcode) = upper(colour.colcode)); is this: Operation Object ------------------------------ ------------------------------ UPDATE STATEMENT () UPDATE () COLOUR TABLE ACCESS (FULL) COLOUR TABLE ACCESS (FULL) LIBRARYCOLOR A full table scan on hse.colour is fine - I need to update every row - but, having created what I thought were the necessary supporting function-based i...

Oracle database function using Java
Oracle 10g1, Redhat AS 3.0. I am trying to implement a set of Java methods as database procedures. I tried following class for try. public class ListExperiments { public static int getExperimentCount() { Connection connection = null; int experimentCount = 0; try { connection = new OracleDriver().defaultConnection(); Statement stmt = connection.createStatement(); ResultSet rs = stmt.executeQuery("SELECT count(*) from TT_Experiment"); if (rs.next()) experimentCount = rs...

[Oracle, java function] Problem with java function that uses 3rd party GPL library
Hi I need to create a function in java, that will run in oracle database as database function. So I've downloaded barbecue - GPL java library that allow me to create barcodes. I'm new at java so maybe my error is trivial, maybe not - I can't find it neither in oracle docs nor in java ones... Now that's the problem: I've loaded barbecue.jar to database using "loadjava" utility. Creation of java function went well: create or replace and compile java source named hsljavabarcodegenerator as import javax.swing.*; import net.sourceforge.barbecue.Barc...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

converting java.lang.String[] to oracle.sql.ARRAY
Hello, I need to know how I can convert java.lang.String[] to oracle.sql.ARRAY. I can only find the opposit in the usegroups and documentation String[] strArray = (String[])oraARRAY.getArray(); But how to oracle.sql.ARRAY oraArray = (magic_cast)strArray; ???? Hope for any help. Regards, -- ------------------------------------------------- Dipl.-Inf. (FH) Stephan Born Humans may reply by replacing the obviously faked part of my e-mail address with "brainforce". ------------------------------------------------- Hello again, Im sorry to see that nobody c...

java.lang.StringIndexOutOfBoundsException: String index out of range: 34
Dear Gurus I m reading XML file in the form of string. Below is the code. => XML string that pass to parseDocument(String receivedMessage) in Parser class as follows <?xml version="1.0" encoding="UTF-8"?> <IFX xmlns:pain001="urn:swift:xsd:$pain.001.001.01" xmlns:pain002="urn:swift:xsd:$pain.002.001.01" xmlns:pain004="urn:swift:xsd:$pain.004.001.01" xmlns:remit="http://www.ifxforum.org/RemitDetailInfo/ 2004/07" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

String index out of range: -1 only occurs when using java.lang.Thread
I have a JSP script I stripped down to just this one scriptlet: <% Thread t = new Thread(new Runnable() { public void run() { System.out.println("Hello World"); } }); t.start(); t.join(5000); %> <html> <head> <title>Hello</title> </head> <body>Hello World</body> </html> Whenever I try to run this I get the following output: Error 500: String index out of range: -1 It doesn't give line number or any other explanation, furthermore, the logs have no entry of anything for the time period...

java.io.File to java.lang.String
What's the best way to get the contents of a file represented by ajava.io.File object into a String? Benjamin wrote:> What's the best way to get the contents of a file represented by a> java.io.File object into a String?> You don't specify what you consider best so how about simple as best? Now for my curiosity, why would you want to do this?import java.io.*;public class test { public static void main(String[] args) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); File f = new File(args[0]); FileInputStream fis = new ...

Function appends same value to string based on number of function calls
Hi Guys, Is this default ruby behaviour or is this a bug? Based on the number of call to Testappend::get_some_value, the string "-New Value" is appended x number of times. If you first assign value = '' instead of value = @text, the behaviour is different and the "-New Value" string is appended only once. version of ruby: ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] Thanks. Philippe ----------------------------------------------------- module ATest def ATest.main t = TestAppend.new puts t.get_some_value ==> Start of string-New Value p...

warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated
Dear Java Programmers, When compiling my Java program I get the following warning: "warning: [deprecation] in java.util.Date(java.lang.String) has been deprecated" on for example this statement: new Date("09/23/2003") The code is used to generate the dates on a webpage. Depending on the language of the webpage the generated format is different. For example English (see "Date" and "Choose publication" on the page opened): http://home.scarlet.be/kenya-belgium/list_5_en/a_kenyan_birthday_party_and_a_belgian_birthday_party.html French: http://home.scarlet....

LONG: Java student getting String Exception/String Index errors
Hello, all, I'm back with more questions from my Java I class. I'm writing a simple text editor. According to the specs set out by my professor, we're to use the built-in methods 'substring(), indexOf(), and length()' to edit a single long string of text. The "edited" text will be built by taking the original text and finding the text that preceeds the change, the text of the change, and the text that follows the change and concatonating them in order. So, for example, a "delete" would be: original preceeding text + original following text while an &...

Oracle 10g OCI based application talking to an Oracle 9i database
Hi all, Got a question. I have an OCI C++ application that is written using the Oracle 10g OCI includes, etc ... This of course is running on a 10g client. The client OS is actually a Windows x64 system since 10g is the only native OCI client right now for 64 bit Windows systems. So this all works fine. Now, I am communicating with an Oracle 9i database server. Is there anything wrong or invalid about this configuration ? I didn't think that there was but I was asked to confirm this, that is having an Oracle 10g client communicating with an Oracle 9i database. Our application is ma...

Function based index!
I have several applications which executes SQL statements where the where clause sometimes is forced to use upper case. Select some_field from some_table where some_field='abc' Select some_field from some_table where upper(some_field)=upper('abc') (criteria may also be "where some_field like 'abc%'.....") Questions: 1. Since both queries above is execeuted pretty often (of course the search condition 'abc' is changed) should I create two indexes on the same column (some_field in this case) where one is an upper case index so Oracle always can ...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Cla...

Loading a large dataset from a database-- java.lang.OutOfMemoryError: Java heap space
Dear all, While trying to load a big table, I received the following error. Is there any way to circumvent this problem without doing additional programming? Thanks you help, Kirill Andreev ??? Java exception occurred: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.util.Arrays.copyOf(Unknown Source) at java.util.Vector.ensureCapacityHelper(Unknown Source) at java.util.Vector.addElement(Unknown Source) at com.mathworks.toolbox.database.fetchTheData.dataFetch(fetchTheData.java: 740) Error in ==> cursor....

Index based database?
I've seen this a few times since getting into Warehousing, but I need a sanity check. How often has anyone seen the total INDEX bytes exceed DATA bytes, meaning I have more data stored in standard indexes, not index organized tables, than regular heap tables. Anyone? In message <1166109023.164657.84250@l12g2000cwl.googlegroups.com>, EscVector <Junk@webthere.com> writes >I've seen this a few times since getting into Warehousing, but I need a >sanity check. > >How often has anyone seen the total INDEX bytes exceed DATA bytes, >meaning I have more data stor...

function based index
since i have no 8.1 here, only 8.0.5, is this possible:? create index idx on table(substr(field, 1, 1)); and then use the select: select * from table where substr(field, 1, 1) = 'X'; is this possible in 8.1?: create index idx on table(substr(field, 1, 1)); and then use the select: select * from table where substr(field, 1, 1) = 'X'; Sybrand Bakker wrote: > Provided you have the Enterprise Edition, yes: this is yet another and > novel way to get around lousy design. thanx and you are right, it is a non-optimal design, but it is how it is and i have to li...

java.lang.string
I need someones help with the following problem. When trying to compile:"can't find symbol,symbole:constructor sam(java.lang.string,java,lang,string) location :class Mine" appears please help me. <<import easyIO.*; class Mine { public static void main(String[] args) { Mine mn= new Mine(args); } Mine(String[] input) { String fill="data.txt"; String fil="cur.txt"; if (inputfil.length>0) fill=input[0]; if (input.length>1) fil=input[1]; Sam sam= new Sam(fill,fil); sam.menu(); } ......... >> ...

java.lang.String.
Can anyone tell me what is the difference between the two assignmentsString ref = "HAI";String obj = new String("HAI"); On Tue, 17 Jul 2007 06:24:43 -0000, "M.Ponmalar@gmail.com" <M.Ponmalar@gmail.com> wrote, quoted or indirectly quoted someone who said : >Can anyone tell me what is the difference between the two assignments >String ref = "HAI"; >String obj = new String("HAI"); The second creates a duplicate object, needlessly. The first just assigns a reference to an existing interned string literal object -- Roedy Green Can...

SN#12788 Java[TM] DataBase Connectivity API Features in Oracle 10g Database
SYSTEM NEWS FOR SUN USERS Vol 74 Issue 2 2004-04-12 Article 12788 from section "Developer's Section" Tutorial on Concepts and Usage The Oracle Technology Network provides a tutorial that outlines the features of Java[TM] DataBase Connectivity (JDBC[TM]) technology in relation to the new enhancements that they bring to the Oracle 10g database. The tutorial evaluates Web RowSets, Connection Cache, and Named Parameters, IEEE datatypes -- BINARY_DOUBLE and BINARY_FLOAT, and PL/SQL Index-by Tables. Each secti...

username and password on Oracle connection string (jdbc:oracle:thin:@host:Port:dataBase)
Hi, Can an Oracle JDBC connection string take a username and password? The plain version of an Oracle connection string is username and password on Oracle connection string jdbc:oracle:thin:@host:Port:dataBase If it's possible to add username/password to that string, what is the prorper syntax? Thanks for your help. Wolfgang. "Wolfgang" <Mott@nospam.UNM.edu> wrote in message news:3f8330a6.24586984@nntp.ucsb.edu... > Hi, > > Can an Oracle JDBC connection string take a username and password? > The plain version of an Oracle connect...

Java equivalent to VB 'string' function (create string with repeating characters)?
Hi, Is there an equivalent in Java to the VB 'string' function, which creates a string of 'x' repeating characters? For instance, something like: String s = vbEquivString("x", 6); // yields s = "xxxxxx" Thanks, Jim ohaya wrote: > Hi, > > Is there an equivalent in Java to the VB 'string' function, which > creates a string of 'x' repeating characters? > > For instance, something like: > > String s = vbEquivString("x", 6); // yields s = "xxxxxx" > > Thanks, > Jim char[]arr = nea char[...

Web resources about - Function Based Index and java.lang.String - comp.databases.oracle

Wave function - Wikipedia, the free encyclopedia
... (a ball attached to a spring ) in classical mechanics (A-B) and quantum mechanics (C-H). In quantum mechanics (C-H), the ball has a wave function ...

Resource sector may outsource finance functions to Asia
Outsourcing financial functions to Asia is one tactic struggling Australian energy and resources companies may use this year to survive the slump ...

Using Functions to Make Better Abstractions
... (code that is tightly coupled to its own implementation details). I was wrong. I was wrong because I had an incomplete understanding of functions. ...

Media devices sold to feds have hidden backdoor with sniffing functions
... AMX NX-1200 , a programmable device used to control AV and building systems. The researchers first became suspicious after encountering a function ...

A Non-Sokratic Dialogue on Social Welfare Functions: Hoisted from the Archives from 2003
**[A Non-Sokratic Dialogue on Social Welfare Functions: Hoisted from the Archives from 2003](http://www.j-bradford-delong.net/movable_type/2 ...

Drop Point Knives: Function, Fit, Timeless
Drop Point Knives: Function, Fit, Timeless

Here's how squads and iron sights will function in Rising Storm 2: Vietnam
... roles and create a squad, and the creator can name, lock, or invite others to their little group. The more an outfit fills up, the more functions ...

Yahoo Begins Grim Job of Closing Functions, Laying Off Staff
Yahoo Food is closing, and other digital magazines on tech, travel and beauty are also scheduled for closing or major cutbacks.

Don’t tase me, bro: Study shows being shocked by a Taser disrupts brain function
Researchers at Drexel shot a bunch of college students with 50,000 volts. The result? Short-term declines in cognitive function comparable with ...

How The U.S. Supreme Court Will Function Without Justice Scalia
... but in a fashion that could have frustrating ramifications for a number of major cases set to be decided. Here's how the court will function, ...

Resources last updated: 2/18/2016 4:39:58 PM