Exact String match when calling a recordset

I have a CategoryID column, and a Cats column.
The main catefory for that products is on CategortID, but the in the Cats column is a string of other categories that the item is listed in.
The problem is that if the search is for category id 94, and the Cats column includes 194 the item gets shown.
How so I create a recordset that only returns items that match exactly out of the sting.
I am currently using
WHERE (Categoryid = colname or (INSTR(Cats, colname) >= 1))
Here is an example
Item CategoryID = 139
Cats = 187, 136, 194
But searching for category id displays this item!
Any help appreciated

Instead of INSTR(), try using FIND_IN_SET()
WHERE (Categoryid = colname or (FIND_IN_SET(Cats, colname) >= 1))
FIND_IN_SET() is meant to be for strings, so it might not work. But it does look for a complete match in a comma-separated list. Make sure there is no space between the comma and number when stored.

Similar Messages

  • How can I search for an exact string match in my emails?

    I was looking for an old email that I had about Re-Animator The Musical. So, in the search bar in the upper right corner of the Thunderbird window, I typed "re-animator". I got 59 hits, and the message that actually contained the string "re-animator" was 27th, when sorted by relevance. All of the other hits were emails which contained the word "animal" or "animals", which to me has nothing to do with "re-animator". I'm surprised that those were considered hits at all, much less that they were considered more relevant than the one message which actually contained the desired string.
    I actually tried three different searches:
    reanimator
    re-animator
    "re-animator"
    (i. e. the first two were without quotes and the third was with quotes). All three of these variations had the same problem, though, that messages containing "animal" were ranked before the message containing "re-animator".
    The desired message contained the word "Re-Animator" (with that capitalization and hyphenation), and also contained "reanimatorthemusical" as part of a URL that was mentioned in the message. So, I would have expected both the search with the hyphen and the search without the hyphen to have been good hits for this message.
    My question is: How can I tell Thunderbird to search for messages that literally contain the string I ask for, and not get "creative" with the matches, as it seems to be doing for some reason?
    (I'm using Thunderbird 31.3.0 on Mac OS X 10.9.5.)

    No, searching for:
    "Animator" musical
    still has the exact same problem: it still wants to find "animal" instead of "animator". Why?
    Yes, I had already read the support article you linked to, but I hadn't found anything in it about why Thunderbird would prefer "animal" over "animator", or how to disable this misfeature. Is there no better documentation for the search bar than that?
    (And the search for "Animator The Musical" didn't find my message, simply because my message didn't contain that exact string. It contained "I am on a waiting list for some musical tickets for Sunday, but I haven't heard back yet. It is a preview of The Re-Animator. ( http://www.reanimatorthemusical.com/ )." The search for "Animator The Musical" only had a single hit, your message in which you suggest searching for that.)

  • Forcing an exact string match in searches

    Is there a way of using the Case Exact String and Case Ignore String plugins so I can ensure that the iPlanet directory server only returns exact matches to an LDAP client.
    e.g.the difference in
    ldapsearch "cn=Abc"
    ldapsearch "cn=ABC"
    I want to find only "ABC" and NOT Abc or abc or aBc and so on..

    You can accomplish this using extensible matching rules.
    By default, the cn attribute is not case-sensitive. You can search for a case-sensitive cn value with a search filter like:
    cn:2.5.3.15:=ABC
    This will use the 2.5.3.15 (Case Exact Match) matching rule on the cn attribute. Note that this search will not be indexed, however, and will take longer than a normal cn search for an exact value.
    You can find more information on extensible matching in RFC 2254 (http://www.ietf.org/rfc/rfc2254.txt).

  • Is there a way of making Search be for exact string match?

    When I generate a help system (RoboHelp 7), and search on,
    say, "contact type", the system returns a list of topic links of
    topics that contain the word "contact" or the word "type". What I'd
    like is for it to do as PDF search does and return only topics that
    contain the complete string "contact type".
    I can't find a setting for doing this among the RoboHelp HTML
    options. Is it possible to do just with a setting? Or would one
    have to do some customizing involving utility calls or something
    like that?

    I do not know how this works for WebHelp, but for HTMLHelp,
    searching for phrases is simple:
    Use single or double quotes or round brackets:
    'find this'
    "find this"
    (find this)

  • UTIL-PARAM STRING ERROR when calling a form from OAF Page

    Dear Experts,
    Can you please suggest, as we are getting the below error when we are calling a form from OAF page.
    "UTIL-PARAM STRING ERROR"
    We have created a button to call the same and the syntax used is as below.
    form:PA:OLNG_MOC_PROJECTS_ENGINEER:STANDARD:PA_PAXCARVW:PROJECT_NUMBER={@ProjectNumber}
    Thanks in advance,
    Satish

    Hi all,
    I have a Personalized Button, my button call a customized form (with a parameter named TAINV_PARAM). Function of customized Form is TAINV_FORM
    In OAF page, I have a text, it's values is 'TAINV', it's ID is VALUES_ATTRIBUTE (you can show source code in browser).
    In Destination URL of Personalized Button, fill code to call Customized Form:
    *javascript: var v_get_value=document.GetElementById(VALUES_ATTRIBUTE).innerHTML;openWindow(top, 'OA.jsp?OAFunc=TAINV_FORM&TAINV_PARAM'+v_get_value,null, {width:750, height:550},false, 'dialog', null);void(0);*
    Regards,
    TAINV

  • Exact string search

    i was wondering if there was a way to do an exact string search in a document.
    If i have a document that has punctuation i want to be able to find the document only if i query whith an exact string match, including stopwords and punctuations.
    if the query is
    select *
    from documents1
    where contains(OBJECT_VALUE,'{hello, world}') > 0
    I want only to return the documents that have exactly "hello, world" whith the comma included.
    If i add the comma to printjoins, it would work, But when i query for only "hello" it wont match "hello, world"
    basicaly im looking for something that does a normal search but then check if the exact string is in the match area.

    Try this
    select substr(&P, (INSTR(&P, CHR('32'), 1))+1, (INSTR(&P, CHR('32'), 1)))
    from dual
    &p is a variable
    I am sure this will help you in any of case
    chr(32) will return space, If you have any other thing except space then you just replace 32 with that ascii code. Such as for
    1(we)2 then query will be
    select substr(&P, (INSTR(&P, CHR('40'), 1))+1, (INSTR(&P, CHR('41'), 1)))
    from dual
    Try it and tell is it working fine

  • How to pass a xml CDATA in string element when OSB calling a webservice?

    How to pass a xml CDATA in string element when OSB calling a webservice?
    I have a business service (biz) that route to operation of a webservice.
    A example of request to this webservice legacy:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eg="example">
    <soapenv:Header/>
    <soapenv:Body>
    <ex:execute>
    <ex:arg><![CDATA[<searchCustomerByDocumentNumber>
    <documentNumber>12345678909</documentNumber>
    </searchCustomerByDocumentNumber>]]></ex:arg>
    </ex:execute>
    </soapenv:Body>
    </soapenv:Envelope>
    the type of ex:arg is a string.
    How to pass this CDATA structure to webservice in OSB?

    Steps to solve this problem:
    1. Create a XML Schema. E.g.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="unqualified">
         <xs:complexType name="searchCustomerByDocumentNumber">
              <xs:sequence>
                   <xs:element name="documentNumber" minOccurs="0">
                        <xs:annotation>
                             <xs:documentation>
                             </xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string" />
                        </xs:simpleType>
                   </xs:element>
         </xs:sequence>
         </xs:complexType>
         <xs:element name="searchCustomerByDocumentNumber" type="searchCustomerByDocumentNumber"></xs:element>
    </xs:schema>
    With this XSD, the XML can be generate:
    <?xml version="1.0" encoding="UTF-8"?>
    <searchCustomerByDocumentNumber xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="searchCustomerByDocumentNumber.xsd">
    <documentNumber>documentNumber</documentNumber>
    </searchCustomerByDocumentNumber>
    2. Create a XQuery to create a searchCustomerByDocumentNumber ComplexType. E.g.:
    (:: pragma bea:global-element-return element="searchCustomerByDocumentNumber" location="searchCustomerByDocumentNumber.xsd" ::)
    declare namespace xf = "http://tempuri.org/NovoSia/CreateSearchCustomerByDocumentNumber/";
    declare function xf:CreateSearchCustomerByDocumentNumber($documentNumber as xs:string)
    as element(searchCustomerByDocumentNumber) {
    <searchCustomerByDocumentNumber>
    <documentNumber>{ $documentNumber }</documentNumber>
    </searchCustomerByDocumentNumber>
    declare variable $documentNumber as xs:string external;
    xf:CreateSearchCustomerByDocumentNumber($documentNumber)
    3. In your stage in pipeline proxy add a assign calling the XQuery created passing the document number of your payload.
    Assign to a variable (e.g.: called searchCustomerByDocumentNumberRequest)
    4. Create another XQuery Transformation (XQ) to create a request to the webservice legacy. E.g.:
    <ex:arg>{fn-bea:serialize($searchCustomerByDocumentNumberRequest)}</ex:arg>
    For more information about xquery serialize function:
    41.2.6 fn-bea:serialize()
    You can use the fn-bea:serialize() function if you need to represent an XML document as a string instead of as an XML element. For example, you may want to exchange an XML document through an EJB interface and the EJB method takes String as argument. The function has the following signature:
    fn-bea:serialize($input as item()) as xs:string
    Source: http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/xquery.htm

  • How to receive a xml CDATA in string element when OSB calling a webservice?

    How to receive a xml CDATA in string element when OSB calling a webservice?
    I have a business service (biz) that route to operation of a webservice.
    A example of response to this webservice legacy:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eg="example">
    <soapenv:Header/>
    <soapenv:Body>
    <ex:executeResponse>
    <ex:arg><![CDATA[<searchCustomerByDocumentNumberResponse>
    <name>John John</name>
    </searchCustomerByDocumentNumberResponse>]]></ex:arg>
    </ex:executeResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    the type of ex:arg is a string.
    How to receive this CDATA structure to webservice in OSB?

    Similiar to the answer How to pass a xml CDATA in string element when OSB calling a webservice?
    Use the xquery function fn-bea:inlinedXML rather than fn-ben:serialize
    Steps to solve this problem:
    1. Create a XML Schema. E.g.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="unqualified">
    <xs:complexType name="searchCustomerByDocumentNumberResponse">
    <xs:sequence>
    <xs:element name="name" minOccurs="0">
    <xs:annotation>
    <xs:documentation>
    </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
    <xs:restriction base="xs:string" />
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="searchCustomerByDocumentNumberResponse" type="searchCustomerByDocumentNumberResponse"></xs:element>
    </xs:schema>
    2. Create a XQuery to create a searchCustomerByDocumentNumber ComplexType. E.g.:
    3. Create a XQuery Transformation (XQ) to get the CDATA response to the webservice legacy. E.g.:
    declare namespace ns0 = "novosiaws";
    declare function xf:getReponse($searchCustomerByDocumentNumberResponse as element(ns0:searchCustomerByDocumentNumberResponse))
    as element(searchCustomerByDocumentNumberResponse) {
    fn-bea:inlinedXML($searchCustomerByDocumentNumberResponse/ns0:arg)
    For more information about xquery function:
    fn-bea:inlinedXML
    The fn-bea:inlinedXML() function parses textual XML and returns an instance of the XQuery 1.0 Data Model.
    The function has the following signature:
    fn-bea:inlinedXML($text as xs:string) as node()*
    where $text is the textual XML to parse.
    Examples:
    fn-bea:inlinedXML(“<e>text</e>”) returns element “e”.
    fn-bea:inlinedXML(“<?xml version=”1.0”><e>text</e>”) returns a document with root element “e”.
    Source: http://docs.oracle.com/cd/E13162_01/odsi/docs10gr3/xquery/extensions.html

  • How to get exact match when working with Oracle Text?

    Hi,
    I'm running Oracle9i Database R2.
    I would like to know how do I get exact match when working with Oracle Text.
    DROP TABLE T_TEST_1;
    CREATE TABLE T_TEST_1 (text VARCHAR2(30));
    INSERT INTO T_TEST_1 VALUES('Management');
    INSERT INTO T_TEST_1 VALUES('Busines Management Practice');
    INSERT INTO T_TEST_1 VALUES('Human Resource Management');
    COMMIT;
    DROP INDEX T_TEST_1;
    CREATE INDEX T_TEST_1_IDX ON T_TEST_1(text) INDEXTYPE IS CTXSYS.CONTEXT;
    SELECT * FROM T_TEST_1 WHERE CONTAINS(text, 'Management')>0;
    The above query will return 3 rows. How do I make Oracle Text to return me only the first row - which is exact match because sometimes my users need to look for exact match term.
    Please advise.
    Regards,
    Jap.

    But I would like to utilize the Oracle Text index. Don't know your db version, but if you slightly redefine your index you can achieve this (at least on my 11g instance) :
    SQL> create table t_test_1 (text varchar2(30))
      2  /
    Table created.
    SQL> insert into t_test_1 values ('Management')
      2  /
    1 row created.
    SQL> insert into t_test_1 values ('Busines Management Practice')
      2  /
    1 row created.
    SQL> insert into t_test_1 values ('Human Resource Management')
      2  /
    1 row created.
    SQL>
    SQL> create index t_test_1_idx on t_test_1(text) indextype is ctxsys.context filter by text
      2  /
    Index created.
    SQL> set autotrace on explain
    SQL>
    SQL> select text, score (1)
      2    from t_test_1
      3   where contains (text, 'Management and sdata(text="Management")', 1) > 0
      4  /
    TEXT                             SCORE(1)
    Management                              3
    Execution Plan
    Plan hash value: 4163886076
    | Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |              |     1 |    29 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_TEST_1     |     1 |    29 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | T_TEST_1_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("TEXT",'Management and
                  sdata(text="Management")',1)>0)
    Note
       - dynamic sampling used for this statementJust read that you indeed mentioned your db version in your first post.
    Not sure though if above method is already available in 9i ...
    Message was edited by:
    michaels

  • Contains return all the records when the query string matches the columns

    I used the multi_column_datastore preference and created an index on three columns (item_name, description,owner_part_number). Now if I do a search:
    select * from items where contains(description, 'description') > 0;It returns all the rows in items table, but not all the rows have "description" as a word. I guess Oracle text assumes the query intends to get all the rows as the query string matches one of the column names. My question is whether Oracle Text has any preference settings to alter this behavior?
    execute ctx_ddl.create_preference('item_multi_preference', 'MULTI_COLUMN_DATASTORE');
    execute ctx_ddl.set_attribute('item_multi_preference', 'columns', 'item_name, description,owner_part_number');
    create index item_text_index on items(description) indextype is ctxsys.context filter by owner parameters('LEXER ENG_LEXER WORDLIST ENG_WORDLIST STOPLIST CTXSYS.EMPTY_STOPLIST datastore item_multi_preference MEMORY 1024M');Thanks.
    Jun Gao

    It looks like a basic_section_group fixes the problem as well, as demonstrated below and I believe a basic_section_group may be more efficient than auto_section_group.
    SCOTT@orcl_11gR2> -- recreation of problem:
    SCOTT@orcl_11gR2> drop table items
      2  /
    Table dropped.
    SCOTT@orcl_11gR2> create table items (
      2       "ITEM_NAME"             varchar2(100 byte),
      3        "ITEM_NUMBER"              varchar2(100 byte),
      4        "DESCRIPTION"              varchar2(4000 byte),
      5        "OWNER" number
      6  )
      7  /
    Table created.
    SCOTT@orcl_11gR2> begin
      2    FOR Lcntr IN 1..100
      3    loop
      4         insert into items (item_name, item_number, description, owner)
      5         values (dbms_random.string('A', 10),
      6              dbms_random.string('A', 10),
      7              dbms_random.string('L', 8) || ' '
      8              || dbms_random.string('A', 4)
      9              || dbms_random.string('A', 5)  || ' '
    10              || dbms_random.string('A', 10),
    11              dbms_random.value(1,10) );
    12    end loop;
    13  end;
    14  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    FOR Lcntr IN 1..100
      3    loop
      4         insert into items (item_name, item_number, description, owner)
      5         values (dbms_random.string('A', 10),
      6              dbms_random.string('A', 10),
      7              dbms_random.string('L', 8) || ' '
      8              || dbms_random.string('A', 4) || '111'
      9              || dbms_random.string('A', 5)  || ' '
    10              || dbms_random.string('A', 10), 1234 );
    11    end loop;
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> exec ctx_ddl.drop_preference('ENG_WORDLIST');
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference('ENG_WORDLIST', 'BASIC_WORDLIST');
      3    ctx_ddl.set_attribute('ENG_WORDLIST','PREFIX_INDEX','TRUE');
      4    ctx_ddl.set_attribute('ENG_WORDLIST','PREFIX_MIN_LENGTH',1);
      5    ctx_ddl.set_attribute('ENG_WORDLIST','PREFIX_MAX_LENGTH',10);
      6    ctx_ddl.set_attribute('ENG_WORDLIST','SUBSTRING_INDEX','TRUE');
      7    ctx_ddl.set_attribute('ENG_WORDLIST','WILDCARD_MAXTERMS', 0);
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> execute ctx_ddl.drop_preference('ENG_LEXER');
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    CTX_DDL.CREATE_PREFERENCE ('ENG_LEXER', 'BASIC_LEXER');
      3    CTX_DDL.SET_ATTRIBUTE ('ENG_LEXER', 'PRINTJOINS', '@-_');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> execute ctx_ddl.drop_preference('items_multi_preference');
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference('items_multi_preference', 'MULTI_COLUMN_DATASTORE');
      3    ctx_ddl.set_attribute('items_multi_preference', 'columns', 'item_name, description,item_number');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> create index items_text_index
      2  on items(description)
      3  indextype is ctxsys.context
      4  parameters
      5    ('LEXER         ENG_LEXER
      6        WORDLIST   ENG_WORDLIST
      7        STOPLIST   CTXSYS.EMPTY_STOPLIST
      8        datastore  items_multi_preference
      9        MEMORY     1024M')
    10  /
    Index created.
    SCOTT@orcl_11gR2> create index owner_idx on items (owner)
      2  /
    Index created.
    SCOTT@orcl_11gR2> exec dbms_stats.gather_table_stats (user, 'ITEMS')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> select count(*)
      2  from   items
      3  where  contains (description, 'description') > 0
      4  /
      COUNT(*)
           200
    1 row selected.
    SCOTT@orcl_11gR2> -- correction of problem:
    SCOTT@orcl_11gR2> exec ctx_ddl.drop_section_group ('items_sec')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_section_group ('items_sec', 'basic_section_group');
      3    ctx_ddl.add_field_section ('items_sec', 'item_name', 'item_name', true);
      4    ctx_ddl.add_field_section ('items_sec', 'description', 'description', true);
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> drop index items_text_index
      2  /
    Index dropped.
    SCOTT@orcl_11gR2> create index items_text_index
      2  on items(description)
      3  indextype is ctxsys.context
      4  parameters
      5    ('LEXER         ENG_LEXER
      6        WORDLIST   ENG_WORDLIST
      7        STOPLIST   CTXSYS.EMPTY_STOPLIST
      8        datastore  items_multi_preference
      9        MEMORY     1024M
    10        section group items_sec')
    11  /
    Index created.
    SCOTT@orcl_11gR2> select count(*)
      2  from   items
      3  where  contains (description, 'description') > 0
      4  /
      COUNT(*)
             0
    1 row selected.

  • Core Dump when calling DriverManager.getConnection

    I'm very confused and hope someone can help me out with this.
    I'm trying to make a connection to a MS SQL Server 7 and am getting a core dump when getConnection is called. No exception is thrown, just a core dump and locked session. If I run the class from it's main there is absolutly no problem, but when I do a new on the class and call it's member to establish the connection: core dump. The environment is the same in both cases. The calling class did does use a mySql connection, but I tried closing it and setting it to null with the same problem. I'm not sure if the getConnection is stepping on a socket or what it's trying to violate in memory causing the dump. This is running on a SCO Openserver 5.0.5 box (green threads). Why it runs stand-alone and not when called from another class has got me tangled... Thread problem? I've tried several SQL drivers, they all do the same thing.
    Anyway, here's a snippet from the java class:
    try
    {Class.forName(myForName);
    // core dump, next line
    Connection myConn = DriverManager.getConnection(myUrl, myUser, myPass);
    // never get's here
    Statement myStmt = myConn.createStatement();
    catch (Exception e) // modified for this post
    {system.out.println(e.toString());
    Here's the dump printed to the monitor (2>&1)
    SIGSEGV 11* segmentation violation
    si_signo [11]: SIGSEGV 11* segmentation violation
    si_errno [0]: Error 0
    si_code [1]: SEGV_MAPERR [addr: 0x8]
         stackpointer=81adc820
    Full thread dump Classic VM (SCO-JDK-1.2.2-001:2000-Feb-17-03:54, green threads):
    "Thread-0" (TID:0x8074f3c8, sys_thread_t:0x83ae258, state:R) prio=5
         at com.inet.tds.TdsDriver.run(Unknown Source)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "process reaper" (TID:0x807431d0, sys_thread_t:0x82cd980, state:CW) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.UNIXProcess.run(Native Method)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "Finalizer" (TID:0x8071f320, sys_thread_t:0x808e478, state:CW) prio=8
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
    "Reference Handler" (TID:0x8071f3b0, sys_thread_t:0x808a2d8, state:CW) prio=10
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
    "Signal dispatcher" (TID:0x8071f3e0, sys_thread_t:0x80845a8, state:CW) prio=5
    "main" (TID:0x8071f1e0, sys_thread_t:0x804c2d8, state:R) prio=5
         at java.lang.Thread.sleep(Native Method)
         at com.inet.tds.TdsDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at SLSCorpRpt.printSchedule(SLSCorpRpt.java, Compiled Code)
         at SLSSchedule.runSchedule(SLSSchedule.java, Compiled Code)
         at SLSTextMain.<init>(SLSTextMain.java, Compiled Code)
         at SLSTextMain.main(SLSTextMain.java, Compiled Code)
    Monitor Cache Dump:
    java.lang.Object@807431A8/807C6140: <unowned>
         Waiting to be notified:
         "process reaper" (0x82cd980)
    java.lang.Class@80736EF8/807970A8: owner "main" (0x804c2d8) 2 entries
    <unknown key> (0x80737c21): owner "Thread-0" (0x83ae258) 1 entry
    java.lang.ref.ReferenceQueue$Lock@8071F338/80754D60: <unowned>
         Waiting to be notified:
         "Finalizer" (0x808e478)
    java.lang.ref.Reference$Lock@8071F3C0/80754890: <unowned>
         Waiting to be notified:
         "Reference Handler" (0x808a2d8)
    Registered Monitor Dump:
    PCMap lock: <unowned>
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: owner "Thread-0" (0x83ae258) 1 entry
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor IO lock: <unowned>
    User signal monitor: <unowned>
         Waiting to be notified:
         "Signal dispatcher" (0x80845a8)
    Child death monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
         Waiting to be notified:
         <unknown thread> (0x804be18)
    Thread queue lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor registry: owner "Thread-0" (0x83ae258) 1 entry
    SIGABRT 6* abort (generated by abort(3) routine)
         stackpointer=81adc820
    Full thread dump Classic VM (SCO-JDK-1.2.2-001:2000-Feb-17-03:54, green threads):
    "Thread-0" (TID:0x8074f3c8, sys_thread_t:0x83ae258, state:R) prio=5
         at com.inet.tds.TdsDriver.run(Unknown Source)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "process reaper" (TID:0x807431d0, sys_thread_t:0x82cd980, state:CW) prio=5
         at java.lang.Object.wait(Native Method)
         at java.lang.UNIXProcess.run(Native Method)
         at java.lang.Thread.run(Thread.java, Compiled Code)
    "Finalizer" (TID:0x8071f320, sys_thread_t:0x808e478, state:CW) prio=8
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java, Compiled Code)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
    "Reference Handler" (TID:0x8071f3b0, sys_thread_t:0x808a2d8, state:CW) prio=10
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java, Compiled Code)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
    "Signal dispatcher" (TID:0x8071f3e0, sys_thread_t:0x80845a8, state:CW) prio=5
    "main" (TID:0x8071f1e0, sys_thread_t:0x804c2d8, state:R) prio=5
         at java.lang.Thread.sleep(Native Method)
         at com.inet.tds.TdsDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at java.sql.DriverManager.getConnection(DriverManager.java, Compiled Code)
         at SLSCorpRpt.printSchedule(SLSCorpRpt.java, Compiled Code)
         at SLSSchedule.runSchedule(SLSSchedule.java, Compiled Code)
         at SLSTextMain.<init>(SLSTextMain.java, Compiled Code)
         at SLSTextMain.main(SLSTextMain.java, Compiled Code)
    Monitor Cache Dump:
    java.lang.Object@807431A8/807C6140: <unowned>
         Waiting to be notified:
         "process reaper" (0x82cd980)
    java.lang.Class@80736EF8/807970A8: owner "main" (0x804c2d8) 2 entries
    <unknown key> (0x80737c21): owner "Thread-0" (0x83ae258) 1 entry
    java.lang.ref.ReferenceQueue$Lock@8071F338/80754D60: <unowned>
         Waiting to be notified:
         "Finalizer" (0x808e478)
    java.lang.ref.Reference$Lock@8071F3C0/80754890: <unowned>
         Waiting to be notified:
         "Reference Handler" (0x808a2d8)
    Registered Monitor Dump:
    PCMap lock: <unowned>
    utf8 hash table: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: owner "Thread-0" (0x83ae258) 1 entry
    Class linking lock: <unowned>
    System class loader lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Monitor cache lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor IO lock: <unowned>
    User signal monitor: <unowned>
         Waiting to be notified:
         "Signal dispatcher" (0x80845a8)
    Child death monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
         Waiting to be notified:
         <unknown thread> (0x804be18)
    Thread queue lock: owner "Thread-0" (0x83ae258) 1 entry
    Monitor registry: owner "Thread-0" (0x83ae258) 1 entry

    I have a similar problem with establishing a connection through JNI. Have you resolved your problem?
    Here's mine.
    In java, I have a class that provides an interface to a mysql database. The java programs that call this interface work fine.
    When I try to call the java interface from C++ through JNI, I get the following output -- some debug statements sprinkled through also. I am assuming that the JVM is missing something at runtime that is there in my JRE. The classpaths match , etc. Exception handling in java and in JNI code are not providing any more detail.. Thanks for comments!!
    Created jvm
    Got KBModel and String classes
    KBModel.java:stest()
    KBModel.java:init(String)
    KBModel.java:init(String) - got Properties file
    Got DBDRIVER class: org.gjt.mm.mysql.Driver
    Object = class org.gjt.mm.mysql.Driver
    init(): DBURLSTRING = jdbc:mysql://sturgeon.xxx.com:3306/<valid db name>
    init(): DBUSER = <valid user>
    init(): DBPASSWORD =<valid password>
    KBModel.java:init(Properties) - Attempting connection
    init(): Drivers available:
    com.mysql.jdbc.Driver
    Driver accepts this URL
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 11 occurred at PC=0x4053ea09
    Function name=(N/A)
    Library=/lib/i686/libc.so.6
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Dynamic libraries:
    08048000-0804a000 r-xp 00000000 03:02 279279 /home/kathy/cm/src/Onto/Tools/Annotator/src/test/invokeKB
    0804a000-0804b000 rw-p 00001000 03:02 279279 /home/kathy/cm/src/Onto/Tools/Annotator/src/test/invokeKB
    40000000-40016000 r-xp 00000000 03:02 2093075 /lib/ld-2.2.4.so
    40016000-40017000 rw-p 00015000 03:02 2093075 /lib/ld-2.2.4.so
    40017000-40020000 r-xp 00000000 03:02 1309343 /usr/java/jdk1.3.1_03/jre/lib/i386/native_threads/libhpi.so
    40020000-40021000 rw-p 00008000 03:02 1309343 /usr/java/jdk1.3.1_03/jre/lib/i386/native_threads/libhpi.so
    40031000-40032000 r--p 00000000 03:02 768548 /usr/lib/locale/en_US/LC_IDENTIFICATION
    40033000-40085000 r-xp 00000000 03:02 328384 /usr/lib/libodbc.so.1.0.0
    40085000-40088000 rw-p 00051000 03:02 328384 /usr/lib/libodbc.so.1.0.0
    40088000-400c1000 r-xp 00000000 03:02 327275 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so
    400c1000-400c8000 rw-p 00038000 03:02 327275 /usr/lib/libstdc++-3-libc6.2-2-2.10.0.so
    400ca000-400eb000 r-xp 00000000 03:02 246620 /usr/java/jdk1.3.1_03/jre/lib/i386/libjava.so
    400eb000-400ed000 rw-p 00020000 03:02 246620 /usr/java/jdk1.3.1_03/jre/lib/i386/libjava.so
    400ee000-400ff000 r-xp 00000000 03:02 246629 /usr/java/jdk1.3.1_03/jre/lib/i386/libverify.so
    400ff000-40101000 rw-p 00010000 03:02 246629 /usr/java/jdk1.3.1_03/jre/lib/i386/libverify.so
    40101000-402f1000 r-xp 00000000 03:02 1701922 /usr/java/jdk1.3.1_03/jre/lib/i386/client/libjvm.so
    402f1000-403f1000 rw-p 001ef000 03:02 1701922 /usr/java/jdk1.3.1_03/jre/lib/i386/client/libjvm.so
    40408000-4053c000 r-xp 00000000 03:02 2093084 /lib/libc-2.2.4.so
    4053c000-40542000 rw-p 00133000 03:02 2093084 /lib/libc-2.2.4.so
    40547000-4054a000 r-xp 00000000 03:02 2093088 /lib/libdl-2.2.4.so
    4054a000-4054b000 rw-p 00002000 03:02 2093088 /lib/libdl-2.2.4.so
    4054b000-40558000 r-xp 00000000 03:02 343415 /lib/i686/libpthread-0.9.so
    40558000-40560000 rw-p 0000c000 03:02 343415 /lib/i686/libpthread-0.9.so
    40560000-40582000 r-xp 00000000 03:02 343413 /lib/i686/libm-2.2.4.so
    40582000-40583000 rw-p 00021000 03:02 343413 /lib/i686/libm-2.2.4.so
    40583000-40596000 r-xp 00000000 03:02 2093093 /lib/libnsl-2.2.4.so
    40596000-40597000 rw-p 00012000 03:02 2093093 /lib/libnsl-2.2.4.so
    40599000-405cd000 r-xp 00000000 03:02 328243 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
    405cd000-405d9000 rw-p 00033000 03:02 328243 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
    405dc000-405f0000 r-xp 00000000 03:02 246630 /usr/java/jdk1.3.1_03/jre/lib/i386/libzip.so
    405f0000-405f3000 rw-p 00013000 03:02 246630 /usr/java/jdk1.3.1_03/jre/lib/i386/libzip.so
    405f3000-41327000 r--s 00000000 03:02 1717328 /usr/java/jdk1.3.1_03/jre/lib/rt.jar
    41354000-4164b000 r--s 00000000 03:02 1717321 /usr/java/jdk1.3.1_03/jre/lib/i18n.jar
    4164b000-41661000 r--s 00000000 03:02 1717329 /usr/java/jdk1.3.1_03/jre/lib/sunrsasign.jar
    43709000-4370a000 r--p 00000000 03:02 408823 /usr/lib/locale/en_US/LC_MEASUREMENT
    4370a000-4370b000 r--p 00000000 03:02 2158478 /usr/lib/locale/en_US/LC_TELEPHONE
    4370b000-4370c000 r--p 00000000 03:02 2158480 /usr/lib/locale/en_US/LC_ADDRESS
    4370c000-4370d000 r--p 00000000 03:02 2158479 /usr/lib/locale/en_US/LC_NAME
    4370d000-4370e000 r--p 00000000 03:02 1864168 /usr/lib/locale/en_US/LC_PAPER
    4370e000-4370f000 r--p 00000000 03:02 2174846 /usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES
    4370f000-43710000 r--p 00000000 03:02 408822 /usr/lib/locale/en_US/LC_MONETARY
    49d5f000-49d8a000 r--p 00000000 03:02 572342 /usr/lib/locale/en_US/LC_CTYPE
    49d8a000-49d90000 r--p 00000000 03:02 866674 /usr/lib/locale/en_US/LC_COLLATE
    49d90000-49d91000 r--p 00000000 03:02 768549 /usr/lib/locale/en_US/LC_TIME
    49d91000-49d92000 r--p 00000000 03:02 572338 /usr/lib/locale/en_US/LC_NUMERIC
    49d93000-49d9c000 r-xp 00000000 03:02 246627 /usr/java/jdk1.3.1_03/jre/lib/i386/libnet.so
    49d9c000-49d9d000 rw-p 00008000 03:02 246627 /usr/java/jdk1.3.1_03/jre/lib/i386/libnet.so
    49d9d000-49da7000 r-xp 00000000 03:02 2093117 /lib/libnss_nisplus-2.2.4.so
    49da7000-49da8000 rw-p 00009000 03:02 2093117 /lib/libnss_nisplus-2.2.4.so
    49da8000-49dab000 r-xp 00000000 03:02 2093106 /lib/libnss_dns-2.2.4.so
    49dab000-49dac000 rw-p 00002000 03:02 2093106 /lib/libnss_dns-2.2.4.so
    49dad000-49db7000 r-xp 00000000 03:02 2093109 /lib/libnss_files-2.2.4.so
    49db7000-49db8000 rw-p 00009000 03:02 2093109 /lib/libnss_files-2.2.4.so
    4a624000-4a67a000 r--s 00000000 03:02 540401 /usr/java/jdk1.3.1_03/jre/lib/ext/log4j-1.2.6.jar
    4a695000-4a6a3000 r-xp 00000000 03:02 2093122 /lib/libresolv-2.2.4.so
    4a6a3000-4a6a5000 rw-p 0000d000 03:02 2093122 /lib/libresolv-2.2.4.so
    Local Time = Thu Feb 13 13:35:05 2003
    Elapsed Time = 1
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.3.1_03-b03 mixed mode)
    # An error report file has been saved as hs_err_pid9210.log.
    # Please refer to the file for further information.
    #

  • How can I get error message when calling pl/sql

    Hi,
    I call a pl/sql java wrapper generated by Rosetta.
    public static void startWf(
    OracleConnection _connection,
    BigDecimal p_goal_header_id,
    BigDecimal p_submiter_userid,
    String p_commit,
    String p_init_msg_list,
    String [] x_return_status,
    BigDecimal [] x_msg_count,
    String [] x_msg_data
    ) throws SQLException
    the pl/sql is written by the standard way of OAF backend,
    PROCEDURE start_wf ( p_goal_header_id in number
              ,p_submiter_userid     in number
    ,p_commit in varchar2 DEFAULT FND_API.G_TRUE
              ,p_init_msg_list in varchar2 DEFAULT FND_API.G_FALSE
    ,x_return_status out varchar2
    ,x_msg_count out number
    ,x_msg_data out varchar2);
    when running this procedure in TOAD, in case of error, following script can print error message:
    if l_return_status <> 'S' then
    dbms_output.put_line('Result');
    dbms_output.put_line('status: '||l_return_status);
    dbms_output.put_line('error count: '||l_msg_count);
    dbms_output.put_line('Loop Error');
    dbms_output.put_line('Err: '||fnd_msg_pub.get(-1,p_encoded=>'F'));
    for i in 2..l_msg_count loop
    dbms_output.put_line('Err: '||fnd_msg_pub.get(p_encoded=>'F'));
    end loop;
    end if;
    if l_return_status = 'S' then
    dbms_output.put_line('Success');
    end if;
    end;
    My question is when calling pl/sql java wrapper from Java, in case of Error, return_status="E", then in order to get exact error msg, is there any equivalent java method such as get error from pageContext or OADBTransaciton.. etc instead of calling again pl/sql fnd_msg_pub.get to get error msg?
    thanks
    Lei

    Lei,
    You can use
    checkErrors(OADBTransaction pTx,
    int pMessageCount,
    String pReturnStatus,
    String pMessageData)
    method in OAExceptionUtils Class.For details look at javadoc of OAExceptionUtils Class.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • MD5 PLS-00307: too many declarations of 'MD5' match this call

    Hi I wonder if any one can help, I am trying to write an equlivent of mysqls MD5 function.
    When I compile the following I get this error message:
    PLS-00307: too many declarations of 'MD5' match this call
    function MD5(str varchar2)
    RETURN VARCHAR2 IS
    md_str VARCHAR2(16);
    BEGIN
    md_str := dbms_obfuscation_toolkit.md5(str);
    return md_str;
    END;

    Looks to be like Oracle have bolloxed this one well and truly.
    A desc of the toolkit reveals this:
    PROCEDURE MD5
    Argument Name                  Type                    In/Out Default?
    INPUT                          RAW                     IN
    CHECKSUM                       RAW(16)                 OUT
    FUNCTION MD5 RETURNS RAW(16)
    Argument Name                  Type                    In/Out Default?
    INPUT                          RAW                     IN
    PROCEDURE MD5
    Argument Name                  Type                    In/Out Default?
    INPUT_STRING                   VARCHAR2                IN
    CHECKSUM_STRING                VARCHAR2                OUT
    FUNCTION MD5 RETURNS VARCHAR2(16)
    Argument Name                  Type                    In/Out Default?
    INPUT_STRING                   VARCHAR2                IN.
    i.e. two overloaded functions and two overloaded procedures with exactly the same signature. This is not supposed to handle, because the signature (number and type of parameters) is how the database deteremines which version of teh function to call. Identical signatures causes your PLS-307 error.
    If it's any consolation, they appear to have fixed it in Oracle 9i (there's a solitary MD5 procedure).
    Cheers, APC

  • PLS-00307: too many declarations of 'INSERTXML' match this call

    Dear All,
    I need help to create a procedure. I am describing the scenario below.
    I have a table which is
    xml_clob(
    doc_id number,
    doc clob
    The above table contain an xml file in doc column. What i need is read the doc column and parse and insert the xml data to a table. For this purpose I am using a built-in package in oracle database 10g name dbms_xmlsave. To full fill my purpose i am going to create a procedure which is getting error. I am giving the procedure code
    CREATE OR REPLACE PROCEDURE loadxml1 AS
    fil clob;
    buffer varchar2(1000);
    len INTEGER;
    insrow INTEGER;
    BEGIN
    SELECT doc INTO fil FROM xml_clob WHERE doc_id=1;
    len := DBMS_LOB.GETLENGTH(fil);
    DBMS_OUTPUT.PUT_LINE('length '||len);
    DBMS_LOB.READ(fil,len,1,buffer);
    --xmlgen.resetOptions;
    --insrow := xmlgen.insertXML('xml_doc',buffer);
    insrow := dbms_xmlsave.insertXML('xml_doc',buffer);
    --insrow := dbms_xmlsave.insertXML('xml_doc',fil);
    DBMS_OUTPUT.PUT_LINE('length ins '||insrow);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('In Exception');
    DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
    end;
    i am getting the error with the bold line
    insrow := dbms_xmlsave.insertXML('xml_doc',buffer);
    PLS-00307: too many declarations of 'INSERTXML' match this call
    I need help on this. Here the argument xml_doc is the table name where i want to insert data from xml.
    I am giving u the code of dbms_smlsave package which is at sys user.
    CREATE OR REPLACE PACKAGE DBMS_XMLSAVE AUTHID CURRENT_USER AS
    SUBTYPE ctxType IS NUMBER; /* context type */
    DEFAULT_ROWTAG CONSTANT VARCHAR2(3) := 'ROW'; /* rowtag */
    DEFAULT_DATE_FORMAT CONSTANT VARCHAR2(21):= 'YYYY-MM-DD HH24:MI:SS';
    MATCH_CASE CONSTANT NUMBER := 0; /* match case */
    IGNORE_CASE CONSTANT NUMBER := 1; /* ignore case */
    -------------------- constructor/destructor functions ---------------------
    FUNCTION newContext(targetTable IN VARCHAR2) RETURN ctxType;
    PROCEDURE closeContext(ctxHdl IN ctxType);
    -------------------- parameters to the save (XMLtoDB) engine ----------------
    PROCEDURE setXSLT(ctxHdl IN ctxType,uri IN VARCHAR2,ref IN VARCHAR2 := null);
    PROCEDURE setXSLT(ctxHdl IN ctxType, stylesheet IN CLOB, ref IN VARCHAR2 := null);
    PROCEDURE setXSLTParam(ctxHdl IN ctxType,name IN VARCHAR2,value IN VARCHAR2);
    PROCEDURE removeXSLTParam(ctxHdl IN ctxType, name IN VARCHAR2);
    PROCEDURE setRowTag(ctxHdl IN ctxType, tag IN VARCHAR2);
    PROCEDURE setSQLToXMLNameEscaping(ctxHdl IN ctxType, flag IN BOOLEAN := true);
    PROCEDURE setPreserveWhitespace(ctxHdl IN ctxType, flag IN BOOLEAN := true);
    PROCEDURE setIgnoreCase(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE setDateFormat(ctxHdl IN ctxType, mask IN VARCHAR2);
    PROCEDURE setBatchSize(ctxHdl IN ctxType, batchSize IN NUMBER);
    PROCEDURE setCommitBatch(ctxHdl IN ctxType, batchSize IN NUMBER);
    -- set the columns to update. Relevant for insert and update routines..
    PROCEDURE setUpdateColumn(ctxHdl IN ctxType, colName IN VARCHAR2);
    PROCEDURE clearUpdateColumnList(ctxHdl IN ctxType);
    -- set the key column name to be used for updates and deletes.
    PROCEDURE setKeyColumn(ctxHdl IN ctxType, colName IN VARCHAR2);
    PROCEDURE clearKeyColumnList(ctxHdl IN ctxType);
    ------------------- save ----------------------------------------------------
    -- insertXML
    FUNCTION  insertXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER;
    FUNCTION  insertXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER;
    -- updateXML
    FUNCTION updateXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER;
    FUNCTION updateXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER;
    -- deleteXML
    FUNCTION deleteXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER;
    FUNCTION deleteXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER;
    ------------------- misc ----------------------------------------------------
    PROCEDURE propagateOriginalException(ctxHdl IN ctxType, flag IN BOOLEAN);
    PROCEDURE getExceptionContent(ctxHdl IN ctxType, errNo OUT NUMBER, errMsg OUT VARCHAR2);
    PROCEDURE useDBDates(ctxHdl IN ctxType, flag IN BOOLEAN := true);
    -------private method declarations------------------------------------------
    -- we must do this as a bug workaround; otherwise we get ora-600 [kgmexchi11]
    PROCEDURE p_useDBDates(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE p_setXSLT(ctxHdl IN ctxType, uri IN VARCHAR2, ref IN VARCHAR2);
    PROCEDURE p_setXSLT(ctxHdl IN ctxType, stylesheet CLOB, ref IN VARCHAR2);
    PROCEDURE p_propagateOriginalException(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE p_setSQLToXMLNameEsc(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE p_setPreserveWhitespace(ctxHdl IN ctxType, flag IN NUMBER);
    END dbms_xmlsave;
    CREATE OR REPLACE PACKAGE BODY DBMS_XMLSAVE AS
    FUNCTION insertXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER
    as LANGUAGE JAVA NAME
    'oracle.xml.sql.dml.OracleXMLStaticSave.insertXML(int, java.lang.String) return int';
    FUNCTION insertXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER
    as LANGUAGE JAVA NAME
    'oracle.xml.sql.dml.OracleXMLStaticSave.insertXML(int, oracle.sql.CLOB) return int';
    END DBMS_XMLSAVE;
    /

    Hi,
    It's surprising (to me) that you're getting that particular error.
    It's not surprising that you're getting some error, since insertXML is expecting the first argument to be a ctxType, and you're passing a VARCHAR2 instead. Create a ctxType, and use it as the first argument. (Sorry, I'm not familiar with that package, so I can't give you any details.)

  • The XML document builds on itself when called twice. Help!!!

    When I run the Sample program for the Oracle classgen for Java
    the XML document node repeats itself when called the second
    time. This is what I mean:
    import oracle.xml.classgen.*;
    import oracle.xml.parser.*;
    public class TestWidl
    static WIDL w1 = new WIDL();
    public static void main (String args[])
    test();
    test();
    static void test ()
    try
    DTD dtd = w1.getDTDNode();
    w1.setNAME("WIDL1");
    w1.setVERSION(WIDL.VERSION_1_0);
    SERVICE s1 = new SERVICE("Service1", "Service_URL");
    s1.setINPUT("File");
    s1.setOUTPUT("File");
    BINDING b1 = new BINDING("Binding1");
    b1.setTYPE(BINDING.TYPE_INPUT);
    BINDING b2 = new BINDING("Binding2");
    b2.setTYPE(BINDING.TYPE_OUTPUT);
    VARIABLE v1 = new VARIABLE("Variable1",
    VARIABLE.NULLOK_FALSE);
    v1.setTYPE(VARIABLE.TYPE_STRING);
    v1.setUSAGE(VARIABLE.USAGE_INTERNAL);
    v1.setVALUE("value");
    VARIABLE v2 = new VARIABLE("Variable2",
    VARIABLE.NULLOK_TRUE);
    v2.setTYPE(VARIABLE.TYPE_STRING1);
    v2.setUSAGE(VARIABLE.USAGE_HEADER);
    VARIABLE v3 = new VARIABLE("Variable3",
    VARIABLE.NULLOK_FALSE);
    v3.setTYPE(VARIABLE.TYPE_STRING2);
    v3.setUSAGE(VARIABLE.USAGE_FUNCTION);
    v3.setMASK("mask");
    CONDITION c1 = new CONDITION("CRef1", "CMatch1");
    c1.setSERVICE("Service1");
    c1.setTYPE(CONDITION.TYPE_SUCCESS);
    CONDITION c2 = new CONDITION("CRef2", "CMatch2");
    c2.setTYPE(CONDITION.TYPE_RETRY);
    CONDITION c3 = new CONDITION("CRef3", "CMatch3");
    c3.setSERVICE("Service3");
    c3.setTYPE(CONDITION.TYPE_FAILURE);
    REGION r1 = new REGION("Region1", "Start", "End");
    b1.addNode(r1);
    b1.addNode(v1);
    b1.addNode(c1);
    b1.addNode(v2);
    b2.addNode(c2);
    b2.addNode(v3);
    w1.addNode(s1);
    w1.addNode(b1);
    w1.addNode(b2);
    w1.validateContent();
    w1.print(System.out);
    catch (Exception e)
    System.out.println(e.toString());
    e.printStackTrace();
    The XML output looks like this:
    First Call to test():
    <?xml version = '1.0' encoding = 'ASCII'?>
    <!DOCTYPE WIDL SYSTEM "file:/home/hmiranda/tmp/WIDL_dtd.txt">
    <WIDL NAME="WIDL1" VERSION="1.0">
    <SERVICE NAME="Service1" URL="Service_URL" INPUT="File"
    OUTPUT="File"/>
    <BINDING NAME="Binding1" TYPE="Input">
    <REGION NAME="Region1" START="Start" END="End"/>
    <VARIABLE NAME="Variable1" NULLOK="False" TYPE="String"
    USAGE="Internal" VALUE="value"/>
    <CONDITION REF="CRef1" MATCH="CMatch1" SERVICE="Service1"
    TYPE="Success"/>
    <VARIABLE NAME="Variable2" NULLOK="True" TYPE="String1"
    USAGE="Header"/>
    </BINDING>
    <BINDING NAME="Binding2" TYPE="Output">
    <CONDITION REF="CRef2" MATCH="CMatch2" TYPE="Retry"/>
    <VARIABLE NAME="Variable3" NULLOK="False" TYPE="String2"
    USAGE="Function" MASK="mask"/>
    </BINDING>
    </WIDL>
    Second Call to test:
    Please note how service1 repeats itself. I would expect that
    the XML string would look like the first output:
    How can I fix this??
    <?xml version = '1.0' encoding = 'ASCII'?>
    <!DOCTYPE WIDL SYSTEM "file:/home/hmiranda/tmp/WIDL_dtd.txt">
    <WIDL NAME="WIDL1" VERSION="1.0">
    <SERVICE NAME="Service1" URL="Service_URL" INPUT="File"
    OUTPUT="File"/>
    <BINDING NAME="Binding1" TYPE="Input">
    <REGION NAME="Region1" START="Start" END="End"/>
    <VARIABLE NAME="Variable1" NULLOK="False" TYPE="String"
    USAGE="Internal" VALUE="value"/>
    <CONDITION REF="CRef1" MATCH="CMatch1" SERVICE="Service1"
    TYPE="Success"/>
    <VARIABLE NAME="Variable2" NULLOK="True" TYPE="String1"
    USAGE="Header"/>
    </BINDING>
    <BINDING NAME="Binding2" TYPE="Output">
    <CONDITION REF="CRef2" MATCH="CMatch2" TYPE="Retry"/>
    <VARIABLE NAME="Variable3" NULLOK="False" TYPE="String2"
    USAGE="Function" MASK="mask"/>
    </BINDING>
    <SERVICE NAME="Service1" URL="Service_URL" INPUT="File"
    OUTPUT="File"/>
    <BINDING NAME="Binding1" TYPE="Input">
    <REGION NAME="Region1" START="Start" END="End"/>
    <VARIABLE NAME="Variable1" NULLOK="False" TYPE="String"
    USAGE="Internal" VALUE="value"/>
    <CONDITION REF="CRef1" MATCH="CMatch1" SERVICE="Service1"
    TYPE="Success"/>
    <VARIABLE NAME="Variable2" NULLOK="True" TYPE="String1"
    USAGE="Header"/>
    </BINDING>
    <BINDING NAME="Binding2" TYPE="Output">
    <CONDITION REF="CRef2" MATCH="CMatch2" TYPE="Retry"/>
    <VARIABLE NAME="Variable3" NULLOK="False" TYPE="String2"
    USAGE="Function" MASK="mask"/>
    </BINDING>
    </WIDL>
    Any Help is appreciated.
    Hector.
    null

    Hector Miranda (guest) wrote:
    : When I run the Sample program for the Oracle classgen for Java
    : the XML document node repeats itself when called the second
    : time. This is what I mean:
    : import oracle.xml.classgen.*;
    : import oracle.xml.parser.*;
    : public class TestWidl
    : static WIDL w1 = new WIDL();
    : public static void main (String args[])
    : test();
    : test();
    : static void test ()
    : try
    : DTD dtd = w1.getDTDNode();
    : w1.setNAME("WIDL1");
    : w1.setVERSION(WIDL.VERSION_1_0);
    : SERVICE s1 = new SERVICE("Service1", "Service_URL");
    : s1.setINPUT("File");
    : s1.setOUTPUT("File");
    : BINDING b1 = new BINDING("Binding1");
    : b1.setTYPE(BINDING.TYPE_INPUT);
    : BINDING b2 = new BINDING("Binding2");
    : b2.setTYPE(BINDING.TYPE_OUTPUT);
    : VARIABLE v1 = new VARIABLE("Variable1",
    : VARIABLE.NULLOK_FALSE);
    : v1.setTYPE(VARIABLE.TYPE_STRING);
    : v1.setUSAGE(VARIABLE.USAGE_INTERNAL);
    : v1.setVALUE("value");
    : VARIABLE v2 = new VARIABLE("Variable2",
    : VARIABLE.NULLOK_TRUE);
    : v2.setTYPE(VARIABLE.TYPE_STRING1);
    : v2.setUSAGE(VARIABLE.USAGE_HEADER);
    : VARIABLE v3 = new VARIABLE("Variable3",
    : VARIABLE.NULLOK_FALSE);
    : v3.setTYPE(VARIABLE.TYPE_STRING2);
    : v3.setUSAGE(VARIABLE.USAGE_FUNCTION);
    : v3.setMASK("mask");
    : CONDITION c1 = new CONDITION("CRef1", "CMatch1");
    : c1.setSERVICE("Service1");
    : c1.setTYPE(CONDITION.TYPE_SUCCESS);
    : CONDITION c2 = new CONDITION("CRef2", "CMatch2");
    : c2.setTYPE(CONDITION.TYPE_RETRY);
    : CONDITION c3 = new CONDITION("CRef3", "CMatch3");
    : c3.setSERVICE("Service3");
    : c3.setTYPE(CONDITION.TYPE_FAILURE);
    : REGION r1 = new REGION("Region1", "Start", "End");
    : b1.addNode(r1);
    : b1.addNode(v1);
    : b1.addNode(c1);
    : b1.addNode(v2);
    : b2.addNode(c2);
    : b2.addNode(v3);
    : w1.addNode(s1);
    : w1.addNode(b1);
    : w1.addNode(b2);
    : w1.validateContent();
    : w1.print(System.out);
    : catch (Exception e)
    : System.out.println(e.toString());
    : e.printStackTrace();
    : The XML output looks like this:
    : First Call to test():
    : <?xml version = '1.0' encoding = 'ASCII'?>
    : <!DOCTYPE WIDL SYSTEM "file:/home/hmiranda/tmp/WIDL_dtd.txt">
    : <WIDL NAME="WIDL1" VERSION="1.0">
    : <SERVICE NAME="Service1" URL="Service_URL" INPUT="File"
    : OUTPUT="File"/>
    : <BINDING NAME="Binding1" TYPE="Input">
    : <REGION NAME="Region1" START="Start" END="End"/>
    : <VARIABLE NAME="Variable1" NULLOK="False" TYPE="String"
    : USAGE="Internal" VALUE="value"/>
    : <CONDITION REF="CRef1" MATCH="CMatch1"
    SERVICE="Service1"
    : TYPE="Success"/>
    : <VARIABLE NAME="Variable2" NULLOK="True" TYPE="String1"
    : USAGE="Header"/>
    : </BINDING>
    : <BINDING NAME="Binding2" TYPE="Output">
    : <CONDITION REF="CRef2" MATCH="CMatch2" TYPE="Retry"/>
    : <VARIABLE NAME="Variable3" NULLOK="False" TYPE="String2"
    : USAGE="Function" MASK="mask"/>
    : </BINDING>
    : </WIDL>
    : Second Call to test:
    : Please note how service1 repeats itself. I would expect that
    : the XML string would look like the first output:
    : How can I fix this??
    : <?xml version = '1.0' encoding = 'ASCII'?>
    : <!DOCTYPE WIDL SYSTEM "file:/home/hmiranda/tmp/WIDL_dtd.txt">
    : <WIDL NAME="WIDL1" VERSION="1.0">
    : <SERVICE NAME="Service1" URL="Service_URL" INPUT="File"
    : OUTPUT="File"/>
    : <BINDING NAME="Binding1" TYPE="Input">
    : <REGION NAME="Region1" START="Start" END="End"/>
    : <VARIABLE NAME="Variable1" NULLOK="False" TYPE="String"
    : USAGE="Internal" VALUE="value"/>
    : <CONDITION REF="CRef1" MATCH="CMatch1"
    SERVICE="Service1"
    : TYPE="Success"/>
    : <VARIABLE NAME="Variable2" NULLOK="True" TYPE="String1"
    : USAGE="Header"/>
    : </BINDING>
    : <BINDING NAME="Binding2" TYPE="Output">
    : <CONDITION REF="CRef2" MATCH="CMatch2" TYPE="Retry"/>
    : <VARIABLE NAME="Variable3" NULLOK="False" TYPE="String2"
    : USAGE="Function" MASK="mask"/>
    : </BINDING>
    : <SERVICE NAME="Service1" URL="Service_URL" INPUT="File"
    : OUTPUT="File"/>
    : <BINDING NAME="Binding1" TYPE="Input">
    : <REGION NAME="Region1" START="Start" END="End"/>
    : <VARIABLE NAME="Variable1" NULLOK="False" TYPE="String"
    : USAGE="Internal" VALUE="value"/>
    : <CONDITION REF="CRef1" MATCH="CMatch1"
    SERVICE="Service1"
    : TYPE="Success"/>
    : <VARIABLE NAME="Variable2" NULLOK="True" TYPE="String1"
    : USAGE="Header"/>
    : </BINDING>
    : <BINDING NAME="Binding2" TYPE="Output">
    : <CONDITION REF="CRef2" MATCH="CMatch2" TYPE="Retry"/>
    : <VARIABLE NAME="Variable3" NULLOK="False" TYPE="String2"
    : USAGE="Function" MASK="mask"/>
    : </BINDING>
    : </WIDL>
    : Any Help is appreciated.
    : Hector.
    Move
    WIDL w1 = new WIDL();
    out of test() and modify it as
    public class TestWidl
    static WIDL w1 = new WIDL(); ...
    and this will work.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

Maybe you are looking for