Problem with sdo_relate returning unexpected results

I am having a problem with an oracle spatial query not returning what I feel is an appropriate result.
I have a bounding box that has 6 points from a table that should be inside it. There are several hundred points total in this table. I perform the following query and oracle returns only 4 points, well 5 but we will get to that later, within the area of the search.
SQL> Select feature_id
From city_points A
where (MDSYS.SDO_RELATE(A.GEOM, mdsys.sdo_geometry(2003, 8307, NULL, mdsys.sdo_elem_info_array(1,1003,1), mdsys.sdo_ordinate_array(-101.8417,-52.8083,-23.8417,-52.8083,-23.8417,-13.8083,-101.8417,-13.8083,101.8417,-52.8083)), 'mask=ANYINTERACT querytype=join') = 'TRUE');
I used a different application to perform the same type of query. The difference is that the application does the spatial query, not oracle. Further the application gets all of the points and performs this query on the client. What the application returns is correct both visually and spatially.
Two of the points not returned in the oracle spatial query are 300km inside the bounding box. This far exceeds the .5 m tolerance used in our decimal degrees data set (SRID 8307).
I have experienced this problem on 9.2.0.1. I then patched that instance to 9.2.0.7 and duplicated the problem. I then exported the data and imported into a 10g release 1 database and again duplicated the problem. I have tried to re-index the data to no avail.
I have also tried different querytypes also yielding less than expected results.
The data looks like this:
243
SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-58.45, -34.6, NULL),NULL, NULL)
254
SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-56.18333, -34.883334, NULL), NULL, NULL)
377
SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-70.666671, -33.449999, NULL), NULL, NULL)
385
SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-68.149999, -16.5, NULL), NULL, NULL)
388
SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-47.916667, -15.783333, NULL), NULL, NULL)
427
SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-57.640066, -25.270295, NULL), NULL, NULL)
The number is the id field, the rest is the geometry.
The oracle spatial query above only returns id #s 359, 377,243,254,427
There are five returned records. The extra value is outside the bounding area. So it should not have been returned at all. It is all too strange.
I have seen this with different geometry types (points lines and area) as well.
If anyone has suggestions, I would appreciate your comments.
Thanks,
John

John,,
What you are seeing is the behavior you should expect in the geodetic space.
When you have a very long line connecting from longitude -101 to -23, that line
does not follow the same latitude value.
Since these points are in southern hemisphere, the line connecting them
will curve downward (this is the great circle line).
If you really want a line connecting with constant latitude, you should
use the MBR type for the window geometry which densifies the
lines along constant latitude before passing it into relate.
SDO_GEOMETRY(2003, 8307, NULL,
sdo_elem_info_array(1,1003,3),
sdo_ordinate_array(-101.8417,-52.8083, 23.8417,-13.8083))
siva

Similar Messages

  • Problem with SDO_relate when using polygons with holes.

    I'm having a problem with sdo_relate. I'm trying to extract all elements from a point table (bdtq_batim_p) that are inside a specific polygon from another table (SDA_MUNIC_SS). The spatial index for both table have been rebuilt and the data from both table is valid.
    When I do a count on the query, I know the answer should be 1422 elements (Counted in ArcGIS). However, sdo_relate gives a smaller number of elements in the result set.
    The query :
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and sdo_relate( t.SHAPE,s.SHAPE,'mask=anyinteract querytype=window') = 'TRUE'
    returns 282 elements. The query with mask=inside, SDO_Anyinteract() and SDO_inside() all give the same result.
    I did a test with the following query and the result is 1422 (which is the good result).
    SELECT count(distinct t.identifiant) FROM bdtq_batim_p t, SDA_MUNIC_SS s WHERE s.mus_co_geo = '48015' and SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE';
    It's important to note that the polygone (from SDA_MUNIC_SS) that is used for this query have holes in it. I have the same problem with all the polygons from the SDA_MUNIC_SS table that have holes in it. For the polygon without holes, the results are the same for the 2 queries.
    My question are :
    Why are the result from the two queries different? A query with a buffer of 0 should always return the same result as a query with Anyinteract.
    Is there a known problem with SDO_RELATE when using a polygon with holes in it?
    Do you have any idea how to solve my problem.

    Since i don't have much control on the version of Oracle and Patches that we use in the system, we used a workaround that detects the polygons with holes and uses the SDO_WITHIN_DISTANCE( t.SHAPE,s.SHAPE,'distance=0') = 'TRUE' operator in those case. We saw a slight decline in performance but it now returns the right results. When the system will be patched, we'll come back to the original version and see if the problem is solved.

  • Problem with subqueries returning TIMESTAMP's

    I've got problems with some subqueries returning TIMESTAMP values.
    I've build a case for easy reproduction, with this query:
    SELECT iil.iil_lot_num ,
         (SELECT max ( lot_data_validade )
         FROM lot
         WHERE lot.lot_mat_cod = iil.iil_mat_cod AND
               lot.lot_num = iil.iil_lot_num ) as validade
    FROM iil
    WHERE ( iil.iil_inv_serie = 109 ) and
          ( iil. iil_inv_num = 16 ) and
          ( iil.iil_mat_cod = 111 )
    When I run it, it gives the error:
    General error;-9999 POS(1) System error: invalid_indexorder
    knldiag also gives:
    2009-07-28 15:03:18  9943 ERR 51080 SYSERROR -9999 invalid_indexorder
    I'm running on 7.6.06.03.
    Previous versions were giving another message:
    SQLCODE:  -9999      System error: Otherwise unknown errorcode
    If I change max ( lot_data_validade ) to  max ( year (lot_data_validade) ), it works. The problem is specifically with fetching that timestamp value from the subquery.
    Backup for reproduction of the problem is on:
    http://www.tecnova.com.br/maxdb/backup_problem
    (i've isolated only the tables involved in the problem, so the backup is tiny -> 4.3MB)

    HI Elke,
    I had the same idea at first but was largely disappointed to find that this 'corrupt index' is indeed a temp. resultset:
    --> max() query
    OWNER         TABLENAME           COLUMN_OR_INDEX     STRATEGY                                  PAGECOUNT
    DBA           IIL                                     RANGE CONDITION FOR KEY                           61
                                      IIL_INV_SERIE            (USED KEY COLUMN)                             
                                      IIL_INV_NUM              (USED KEY COLUMN)                             
                                      IIL_MAT_COD              (USED KEY COLUMN)                             
    INTERNAL      TEMPORARY RESULT                        EQUAL CONDITION FOR KEY                            1
                                      IIL_INV_SERIE            (USED KEY COLUMN)                             
    DBA           LOT                                     NO STRATEGY NOW (ONLY AT EXECUTION TIME)           
    INTERNAL      TEMPORARY RESULT                        TABLE SCAN                                         1
                                                               RESULT IS COPIED   , COSTVALUE IS       > 2 E10
    The cost expectation is really awesome here...
    --> max(year()) query
    OWNER     TABLENAME         COLUMN_OR_INDEX  STRATEGY                                  PAGECOUNT
    DBA       IIL                                RANGE CONDITION FOR KEY                           61
                                IIL_INV_SERIE         (USED KEY COLUMN)                   
                                IIL_INV_NUM           (USED KEY COLUMN)                   
                                IIL_MAT_COD           (USED KEY COLUMN)                   
    INTERNAL  TEMPORARY RESULT                   EQUAL CONDITION FOR KEY                            1
                                IIL_INV_SERIE         (USED KEY COLUMN)                   
    DBA       LOT                                NO STRATEGY NOW (ONLY AT EXECUTION TIME) 
                                                      RESULT IS COPIED   , COSTVALUE IS   
    This time the optimizer ran out of words for the expected effort for this query execution...
    The problem really seems to be the subquery-select as we can strip down the example to
    select (select max(lot_data_validade) maxval
    from lot
    where lot.lot_mat_cod=111) as maxval
    from dual
    and still see the error...
    regards,
    Lars

  • Having problem with UDF, getting unwanted result Ljava.lang.String;@25c560

    Hi,
    This is atually a follow-up to other post in the same forum: <b>Sending XMl message as text (Mail body) by receiver mail adapter</b>
    We are having problem with UDF to get correct output.
    We are getting <b>result of UDF</b> as below:
    [[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>[Ljava.lang.String;@f37573 [Ljava.lang.String;@1a409ed [Ljava.lang.String;@87c011 [Ljava.lang.String;@52a077 [Ljava.lang.String;@a4e8e5<BR>]
    Does any body know what it mean?
    Following are the source ans target XSD's:
    Here is the <b>source xsd:</b>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://NameSpace" targetNamespace="NameSpace">
    <xsd:complexType name="row">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    5e090470385011db9654000e7f22e9d4
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="DeliveryNumber">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a0377b11db91dbf237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="10" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="DeliveryLineItem">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a1377b11db98aaf237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="6" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OrderNumber">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a2377b11dbc5c4f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="10" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OrderLineItem">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a3377b11db9d84f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="6" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="BillToID">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a4377b11dbb49bf237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="17" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="BillToName">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a5377b11dbb38ff237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="40" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ShipToID">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a6377b11db9370f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="17" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ShipToName">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a7377b11dbb66cf237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="40" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ProductCode">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a8377b11db8f94f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="18" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ProductDesc">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0a9377b11db929ff237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="40" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ScheduledLoadDate">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0aa377b11db8d1df237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="8" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="ScheduledLoadTime">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0ab377b11dba57ff237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="6" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="Carrier">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0ac377b11dbcc03f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="40" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="CustomerPO">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0ad377b11dbb5a2f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="35" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OutYard">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0ae377b11dbcc51f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="16" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OrderedQty">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0af377b11dbbe6cf237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="15" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="OrderUofM">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0b0377b11db9264f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="3" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="LabConc">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0b1377b11dbb0e7f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="50" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="GrossMT">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0b2377b11db99f1f237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="4" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="GrossST">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0b3377b11db9b6ff237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="4" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="BilledQty">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0b4377b11db8a9af237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="8" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="Status">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    9d3ac0b5377b11dba39cf237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:length value="10" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="resultset">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    5e044980385011dbb2d3000e7f22e9d4
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="row" type="row" maxOccurs="unbounded">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    c1cb8fd0377b11db912af237ac102206
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    <b>Target xsd:</b>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.com/xi/XI/Mail/30" targetNamespace="http://sap.com/xi/XI/Mail/30">
    <xsd:element name="Mail">
    <xsd:annotation>
    <xsd:documentation>
    Mail package for XI - Mail Adapter
    </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Subject" type="xsd:string" minOccurs="0" />
    <xsd:element name="From" type="xsd:string" minOccurs="0" />
    <xsd:element name="To" type="xsd:string" minOccurs="0" />
    <xsd:element name="Reply_To" type="xsd:string" minOccurs="0" />
    <xsd:element name="Content_Type" type="xsd:string" minOccurs="0" />
    <xsd:element name="Date" type="xsd:dateTime" minOccurs="0" />
    <xsd:element name="Message_ID" type="xsd:string" minOccurs="0" />
    <xsd:element name="X_Mailer" type="xsd:string" minOccurs="0" />
    <xsd:element name="Content" minOccurs="0" maxOccurs="unbounded">
    <xsd:annotation>
    <xsd:documentation>
    any type
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="encoding" type="xsd:string" />
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    And <b>following is the UDF we are using</b>:
      =========================================
    String mailBody = new String();
    int inta, intb, intc, intd, inte;
    inta = a.length;
    intb = b.length;
    intc = c.length;
    intd = d.length;
    inte = e.length;
    for(int i = 0;  i < a.length; i++)
      mailBody = mailBody + a + " " + b + " " + c + " " + d + " " + e + "<BR>";
    result.addValue(mailBody);
    ====================================
    <b>Any help to resolve this would be very helpful.</b>
    Thanx
    Sue

    Hi Bhavesh,
    We are getting following error if we use the UDF you given below:
    Check Result for Object test   Source code has syntax error:  D:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf2026120390a11db9d1f000e7f22e9d4/source/com/sap/xi/tf/_test_.java:75: a is already defined in testUDF$(java.lang.String[],java.lang.String[],java.lang.String[],java.lang.String[],java.lang.String[],com.sap.aii.mappingtool.tf3.rt.ResultList,com.sap.aii.mappingtool.tf3.rt.Container) int a = a.length(); ^ D:/usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf2026120390a11db9d1f000e7f22e9d4/source/com/sap/xi/tf/_test_.java:75: int cannot be dereferenced int a = a.length(); ^
    We have no knowledge of java at all.
    We did some modifications to it as below:
    String mailBody = new String();
    int a = a.length();
    int b = b.length();
    int c = c.length();
    int d = d.length();
    int e = e.length();
    for(int i = 0; i < a.length(); i++)
    mailBody = mailBody + a + " " + b + " " + c + " " + d + " " + e + "<BR>";
    result.addValue(mailBody);
    It it didn't work. Think we are missing something. Can please help us to figure it out.
    Thanx
    Sue

  • Problems with a return

    I ordered a phone and added a line for my son on Dec 20. I had problems with my order online, and chatted with an associate who helped me. At one point I had to log out, log back in and re-start my order.
    Three days later I received two phones and checked my account which said I had added two lines. I called Verizon and was told I needed to take the extra phone to the store, and that the extra line would not be charged as long as I was within 14 days.
    Because of Christmas and travel, I could not take the phone back until today. I went to the store, where I was told I could not return it there, and to go home and print a label from home.
    I logged in and tried to print the label, but my pop up blocker prevented it. I tried to reprint it, and could not get the blocker off, so I called Customer Service.
    Customer Service told me to go BACK to the Verizon store and have them print the label for me.
    I am extremely frustrated. I am concerned that the phone will not get back to Verizon and I will be charged. I only want ONE phone and ONE line for my son.
    Has anyone else dealt with this???

    Well that's odd.  If you call customer service, they can send you a label via mail but for something more immediate you may need to disable your pop-up blocker in your internet options.  If you google it and put it what browser you have, there may be a video turtorial.  Once your blocker is disabled go to http://www.verizonwireless.com/printlabel/, sign into your myverizon account and as long as you haven't printed 1 off you should be able to print it off. 

  • Query returning unexpected results.

    Hi,
    One of our query which use to run successfully is suddenly failing in one of the environment. Oracle Version: 11.2.0.2.0. Can someone please suggest me why the query is not behaving as expected and works fine when using hint?
    The below query doesn't return any rows.
    select ctran.* from f_transaction_released tran, F_CHARGE_CODE_RELEASED CTRAN where
    id_liability_cif in ('727873','141515') and  TRAN.ID_TRANSACTION_RELEASED = CTRAN.ID_TRANSACTION_RELEASED The same query with hint return rows.
    select /*+ optimizer_features_enable('9.2.0.8') */ ctran.* from f_transaction_released tran, F_CHARGE_CODE_RELEASED CTRAN where
    id_liability_cif in ('727873','141515') and  TRAN.ID_TRANSACTION_RELEASED = CTRAN.ID_TRANSACTION_RELEASED Explain plan of both the queries are:
    1st Query:
    Plan hash value: 196119809
    | Id  | Operation                                 | Name                       | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT                          |                            |   750 | 96000 |   551   (1)| 00:00:07 |       |       |        |      |            |
    |   1 |  PX COORDINATOR                           |                            |       |       |            |          |       |       |        |      |            |
    |   2 |   PX SEND QC (RANDOM)                     | :TQ10001                   |   750 | 96000 |   551   (1)| 00:00:07 |       |       |  Q1,01 | P->S | QC (RAND)  |
    |*  3 |    HASH JOIN                              |                            |   750 | 96000 |   551   (1)| 00:00:07 |       |       |  Q1,01 | PCWP |            |
    |   4 |     BUFFER SORT                           |                            |       |       |            |          |       |       |  Q1,01 | PCWC |            |
    |   5 |      PX RECEIVE                           |                            |   444 |  5328 |   330   (0)| 00:00:04 |       |       |  Q1,01 | PCWP |            |
    |   6 |       PX SEND BROADCAST                   | :TQ10000                   |   444 |  5328 |   330   (0)| 00:00:04 |       |       |        | S->P | BROADCAST  |
    |   7 |        PARTITION RANGE ALL                |                            |   444 |  5328 |   330   (0)| 00:00:04 |     1 |    96 |        |      |            |
    |   8 |         INLIST ITERATOR                   |                            |       |       |            |          |       |       |        |      |            |
    |   9 |          TABLE ACCESS BY LOCAL INDEX ROWID| F_TRANSACTION_RELEASED     |   444 |  5328 |   330   (0)| 00:00:04 |     1 |    96 |        |      |            |
    |  10 |           BITMAP CONVERSION TO ROWIDS     |                            |       |       |            |          |       |       |        |      |            |
    |* 11 |            BITMAP INDEX SINGLE VALUE      | F_TRANSACTION_RELEASE_BMX9 |       |       |            |          |     1 |    96 |        |      |            |
    |  12 |     PX BLOCK ITERATOR                     |                            |  7579K|   838M|   219   (1)| 00:00:03 |     1 |     3 |  Q1,01 | PCWC |            |
    |* 13 |      TABLE ACCESS FULL                    | F_CHARGE_CODE_RELEASED     |  7579K|   838M|   219   (1)| 00:00:03 |     1 |     3 |  Q1,01 | PCWP |            |
    Predicate Information (identified by operation id):
       3 - access("TRAN"."ID_TRANSACTION_RELEASED"="CTRAN"."ID_TRANSACTION_RELEASED")
      11 - access("ID_LIABILITY_CIF"=141515 OR "ID_LIABILITY_CIF"=727873)
      13 - filter(SYS_OP_BLOOM_FILTER(:BF0000,"CTRAN"."ID_TRANSACTION_RELEASED"))2nd query:
    Plan hash value: 4037684686
    | Id  | Operation                                 | Name                       | Rows  | Bytes | Cost  | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT                          |                            |     2 |   256 |   299 |       |       |        |      |            |
    |   1 |  PX COORDINATOR                           |                            |       |       |       |       |       |        |      |            |
    |   2 |   PX SEND QC (RANDOM)                     | :TQ10002                   |     2 |   256 |   299 |       |       |  Q1,02 | P->S | QC (RAND)  |
    |*  3 |    HASH JOIN BUFFERED                     |                            |     2 |   256 |   299 |       |       |  Q1,02 | PCWP |            |
    |   4 |     BUFFER SORT                           |                            |       |       |       |       |       |  Q1,02 | PCWC |            |
    |   5 |      PX RECEIVE                           |                            |     1 |    12 |   203 |       |       |  Q1,02 | PCWP |            |
    |   6 |       PX SEND HASH                        | :TQ10000                   |     1 |    12 |   203 |       |       |        | S->P | HASH       |
    |   7 |        PARTITION RANGE ALL                |                            |     1 |    12 |   203 |     1 |    96 |        |      |            |
    |   8 |         INLIST ITERATOR                   |                            |       |       |       |       |       |        |      |            |
    |   9 |          TABLE ACCESS BY LOCAL INDEX ROWID| F_TRANSACTION_RELEASED     |     1 |    12 |   203 |     1 |    96 |        |      |            |
    |  10 |           BITMAP CONVERSION TO ROWIDS     |                            |       |       |       |       |       |        |      |            |
    |* 11 |            BITMAP INDEX SINGLE VALUE      | F_TRANSACTION_RELEASE_BMX9 |       |       |       |     1 |    96 |        |      |            |
    |  12 |     PX RECEIVE                            |                            |  7579K|   838M|    96 |       |       |  Q1,02 | PCWP |            |
    |  13 |      PX SEND HASH                         | :TQ10001                   |  7579K|   838M|    96 |       |       |  Q1,01 | P->P | HASH       |
    |  14 |       PX BLOCK ITERATOR                   |                            |  7579K|   838M|    96 |     1 |     3 |  Q1,01 | PCWC |            |
    |  15 |        TABLE ACCESS FULL                  | F_CHARGE_CODE_RELEASED     |  7579K|   838M|    96 |     1 |     3 |  Q1,01 | PCWP |            |
    Predicate Information (identified by operation id):
       3 - access("TRAN"."ID_TRANSACTION_RELEASED"="CTRAN"."ID_TRANSACTION_RELEASED")
      11 - access("ID_LIABILITY_CIF"=141515 OR "ID_LIABILITY_CIF"=727873)
    Note
       - cpu costing is off (consider enabling it)

    Hence my questions, which you didn't address:
    1) It might very well be a bug, did you check MetaLink/MyOracleSupport already?
    I didn't check that yet'Suddenly failing' is often a synonym for 'something has changed'.
    2)Are you absolutely sure nothing has changed?
    Nothing has changed unless some stats or index got corrupted which we are assuming.3)What made you decide to use that hint anyway?
    We read somewhere there is a bug with Oracle 11G hash joins and trying with 9i does help. 4)And are the tables 'normal, ordinary tables' or does the F_ prefix indicate something special?
    It's fact tablesAnd to add another one:
    5) Did you or your DBA noticed strange errors or messages in the alert.log?
    Have to check on that.

  • SQL query with parameter returns empty result set, please help !!!

    Hi there,
    When I use the following query :
    <sql:query var="beroepsthemas" >
    select *
    from beroepsthemas
    where beroepsthemaid = ?
    <sql:param value="12"/>
    </sql:query>
    When I want to browse the result set with :
    <c:forEach items="${beroepsthemas.rows}" var="rij">
    it shows no records. But it must return at least one.
    All my jsp pages with sql queries and parameters have the same problem.
    This is all on my test environment. I'm using Ubuntu 5.10, Netbeans5.0, JDK 1.5_06, application runs in Bundeled Tomcat 5.5.9, MySQL 4.1.12, mysql-connector3.1.6
    When the same code is run on the live environment, it works just fine.
    The difference is :
    Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
    What can there be wrong !!

    When the same code is run on the live environment, it
    works just fine.
    The difference is :
    Mysql 4.1.10a, tomcat5.5.9, mysql-connector3.1.6
    I didn't catch this. I think you may need to update the database driver.

  • Problem with SQL Statement for Result Filtering

    Dear Visual Composer Experts,
    Here is another Question from me: I have a SQL Query that is working as the data service
    Select AB.AgingBandID, AB.AgingBand,
    Sum(Case when priority='Emergency' then '1' Else 0 End) as [Emergency],
    Sum(Case when priority='Ugent' then '1' Else 0 End) as Ugent,
    Sum(Case when priority='High' then '1' Else 0 End) as High,
    Sum(Case when priority='Medium' then '1' Else 0 End) as Medium,
    Sum(Case when priority='Low' then '1' Else 0 End) as Low
    from DimAgingBand AB left outer join
    (Select AgingBandID , priority , yeardesc
    from vNotifications where YearDesc = (select year(getdate())-1)) as vN
    on AB.AgingBandID=vN.AgingBandID
    where AB.AgingBandID<>'1'  
    Group by  AB.AgingBandID, AB.AgingBand
    Order by AB.AgingBandID
    That would return me a table as in the following:
         Agingband     E     U     H     M     L
         < 1week     0     0     0     0     1
         1 - 2 weeks     0     0     0     0     0
         2 - 4weeks     0     0     0     0     1
    > 1month     8     2     1     1     6
    Now that I would like to add some parameters to filter the result, so I modify the query and put it in the SQL Statement input port of the same data service. The query is like this:
         "Select AB.AgingBandID, AB.AgingBand,Sum(Case when priority='Emergency' then '1' Else 0 End) as [Emergency],Sum(Case when priority='Ugent' then '1' Else 0 End) as Ugent,Sum(Case when priority='High' then '1' Else 0 End) as High,Sum(Case when priority='Medium' then '1' Else 0 End) as Medium,Sum(Case when priority='Low' then '1' Else 0 End) as Low from DimAgingBand AB left outer join (Select AgingBandID , priority , yeardesc from vNotifications where YearDesc like '2009%' and Branch like '" & if(STORE@selectedBranch=='ALL', '%', STORE@selectedBranch) & "' and MainWorkCentre like '%') as vN on AB.AgingBandID=vN.AgingBandID where AB.AgingBandID<>'1' Group by AB.AgingBandID, AB.AgingBand Order by AB.AgingBandID"
    However this input port query keeps giving me error as NullPointerException. I have actually specified a condition where the query will run if only STORE@selectedBranch != u2018u2019.
    I have other filtering queries working but they are not as complicated query as this one. Could it be possible that query in the input port cannot handle left outer join?
    Could it be anything else?
    Help is very much appreciated.
    Thanks & Regard,
    Sarah

    Hi,
    Thank you very much for your replys. I've tested if the dynamic value of the condition is integer, it's OK
    But if the ClassID type is not integer, it's string, I write  a SQL Statement like:
    "Select DBADMIN.Class.ClassName from DBADMIN.Class where DBADMIN.Class.ClassID = '1' "
    or with dynamic condition:
    "Select DBADMIN.Class.ClassName from DBADMIN.Class where DBADMIN.Class.ClassID = '"&@ClassID&"'"
    or I write the SQL Statement for insert/update/delete data,
    I always have errors.
    I've tested if the dynamic value of the condition is integer, it's OK
    Do you know this problem ?
    Thank you very much & kindly regards,
    Tweety

  • Serious problem with PriorityQueue: remove unexpected elment in the queue

    I write a PriorityQueue with my own comparator. The queue is order on BDVertex.distance. When I try to remove an element in the queue, an unexpected is removed.
    public class BDVertex
    public String getLabel()
    return vertexLabel;
    public int getDistance()
    return distance;
    public class MyComparator implements Comparator
    public MyComparator()
    public int compare(Object a, Object b)
    if(a == null || b == null)
    throw new IllegalArgumentException("Null Argument");
    try
    BDVertex v1 = ((BDVertex) a) ;
    BDVertex v2 = ((BDVertex) b) ;
    return Integer.valueOf(v1.getDistance()).compareTo(Integer.valueOf(v2.getDistance()));
    catch(ClassCastException e)
    throw new IllegalArgumentException("Argument not an BDVertex");
    public class DijkstraShortestPath
    Q = new PriorityQueue<BDVertex>(10, new MyComparator());
    System.out.println("Q1: " +Q);
    System.out.println("t's label aaaa: "+t.getLabel());
    for(BDVertex a : Q)
    if(a.getLabel().equals(t.getLabel()))
    boolean ttt;
    ttt=Q.remove(a); // **********problem is here
    System.out.println("a's label " a.getLabel()"::"+ttt);
    System.out.println("Q2: " +Q);
    Q.add(t);
    System.out.println("Q3: " +Q);
    output is:
    Q1: [Vertex: e, Vertex: h, Vertex: i, Vertex: z]
    t's label aaaa: h
    a's label h::true
    Q2: [Vertex: h, Vertex: z, Vertex: i]
    Q3: [Vertex: h, Vertex: h, Vertex: i, Vertex: z]
    I want to remove vertex h, but it is still in the priorityqueue, and vertex e is remove unexpectedly.
    Can anyone tell me why?? tell me if you need more details. many many thanks

    Thank you for your reply.
    The method you mentioned is a part of a class that is going to implement the Dijkstra shortest path algorithm. A vertex represents a node in a graph. And the PriorityQueue is ordered by BDVertex.distance that is the distance to origin.
    I am not going to remove the first element in the priorityqueue. Because I use BDVertex.distance to order the PriorityQueue, the order of every element will not be changed when I update their distance. To get the priorityqueue re-ordered again, I have to remove the element that is to be updated and add it to the prioirtyqueue again. So I have to use PriorityQueue.remove(). In JDK1.5, the description of this method is Removes a single instance of the specified element from this queue, if it is present.
    Or any other methods to keep the priorityqueue ordered based on my case.
    Thanks a lot.
    Frank

  • Problem with "carriage Return" or "Line Feed" in a table

    Hello,
    I need help with the function Zeichen(), so called it in german, I'm not sure if it is char() in english.
    In Pages Version 4.0.1 (746) I've created a table in Pages with this function to make an "carriage Return" in a cell.
    Here an example: { ="Hello" & Zeichen(10) & "World" }, in the cell is now:
    | Hello |
    | World |
    But in Pages Version 4.0.3 (766) this function ZEICHEN() not allow the number 10 and other till 32 (I allready read the manual and understand this problem).
    Anybody an idea to make a "Carriage Return" or "Line feed" in a formular, in a cell, in a table, in Pages?
    Thanks
    Detlev Kormann

    kdetlev wrote:
    Your workaround will not be possible in my table, because there is no empty cell in the table, but I think it is also a good help too.
    *In fact I forgot that you are using a table in Pages.*
    Remaining on my first idea, In Numbers we may achieve the same goal using an auxiliary table with a single cell containing the needed line break.
    If this table is named "LineBreak",
    the formula will be:
    ="Hello"&LineBreak :: $A$1&"World"
    *In Pages, here is my workaround:*
    Enter the cell
    type a§b
    don't type the character § but ctrl + return.
    The cell will contain
    a
    b
    with the arrow, move before the a
    type =B2&"
    delete the original a
    move to the right
    delete the original b
    type "&C7
    Yvan KOENIG (VALLAURIS, France) mercredi 7 octobre 2009 17:20:04

  • Problem with image returned from getGeneratedMapImage method

    I'm a newbie as far as map viewer and Java 2D goes....
    My problem is the java.awt.Image returned from the getGeneratedMapImage method of the MapViewer API. The image format is set to FORMAT_RAW_COMPRESSED. The image returned is of poor quality with colors not being correct and lines missing. I'm painting the Image returned from this method onto my own custom JComponent by overriding the paint() method...
    public void paint( Graphics g )
    Image image = map.getGeneratedMapImage();
    if ( image != null )
    g.drawImage( image, getLocation().x, getLocation().y, Color.white, this );
    If I take the xml request sent to the application server and paste it into a "sample map request" on the map admin website (along with changing format to PNG_STREAM) my image renders exactly how I expect it to.
    Anyone have any idea what I need to do to get the java.awt.Image with format set to FORMAT_RAW_COMPRESSED to render correctly. I was hoping to get back a BufferedImage or a RenderedImage from the getGeneratedMapImage call but I'm getting back a "sun.awt.motif.X11Image".
    Will downloading the JAI (java advanced imaging) from sun help me at all?

    Joao,
    Turns out it is related to colors. I'm dynamically adding themes, linear features and line styles. I ran a test where I changed the color being specified in the line style from magenta (ff00ff) to black. When I changed the color the linear feature would show up. It was being rendered as white on a white background when I was specifying it to be magenta. I'm specifying another linear feature to be green and it is showing up in the java image as yellow. This doesn't happen when I take the generated XML from the request and display it as a PNG_STREAM.
    Any clue what is going on there?
    Jen

  • Problem with Object returning previously set values, not current vlaues

    Please help if you can. I can send the full code directly to people if they wish.
    My problem is I enter title details for a book via an AWT GUI. When the user clicks the OK button it should display a new screen with the values just entered by the user. I added debug lines and found that the newInstance method has the values I set and the setObject created an object that was not null.
    However the first time you submit the details when it tries to get the object to display them back to the user it is null. However when you try and enter the details for a second time it will display the details entered on your first entry. Likewise if you went to enter a third title and put blank details in it would display the second set of details back to the user when they click OK.
    I'm very confused as to how it when I fetch an object I've just set it is out of step and points to previous values or null when used for the first time.
    Right onto the code.
    ----Shop.class - contains
    public static Object
    getObject()
    if ( save_ == null)
    System.out.println("Return save_ but it is null");
    return save_;
    public static void
    setObject( Object save )
    save_ = save;
    if ( save == null)
    System.out.println("Just taken save but it is null");
    if ( save_ == null)
    System.out.println("Just set save_ but it is null");
    ----AddTitlePanel.class contains
    private void okButtonActionPerformed(ActionEvent evt)
    ConfirmAddTitlePanel confirmAddTitlePanel =
    new ConfirmAddTitlePanel();
    // Gets the textField values here
    model.Title mss = model.Title.newInstance( fullISBN,
    ISBN,
    title,
    author,
    copiesInStock,
    price );
    model.Shop.setObject( mss );
    // Fetch reference to Graphical so buttons can use it to
    // display panels
    graph = model.Shop.getGraphical();
    graph.display( confirmAddTitlePanel );
    This creates a newInstance of Title and creates a copy using setObject when the user clicks on "OK" button. It also calls the ConfirmAddTitlePanel.class to display the details back to the user.
    ----ConfirmAddTitlePanel.class contains:
    private void
    setValues() throws NullPointerException
    model.Title mss = (model.Title) model.Shop.getObject();
    if ( mss != null )
    model.Field[] titleDetails = mss.getFullDetails();
    //model.Field[] titleDetails = model.Title.getFullDetails();
    fullISBNTextField.setText( titleDetails[0].asString() );
    //ISBNTextField.setText( titleDetails[1].asString() );
    titleTextField.setText( titleDetails[2].asString() );
    authorTextField.setText( titleDetails[3].asString() );
    copiesInStockTextField.setText( titleDetails[4].asString() );
    priceTextField.setText( titleDetails[5].asString() );
    else
    System.out.println( "\nMSS = null" );
    This is getting the Object back that we just set and fetching its details to display to the user by populating the TextFields.
    As I say first time you enter the details and click OK it displays the above panel and outputs "MSS = null" and cannot populate the fields. When you enter the next set of title details and click "OK" getObject is no longer setting mss to null but the values fetched to set the TextFields is the data entered for the first title and not the details just entered.
    ----Title.class contains:
    public static Title
    newInstance( String fullISBN,
    String ISBN,
    String title,
    String author,
    int copiesInStock,
    int price )
    Title atitle = new Title( fullISBN,
    ISBN,
    title,
    author,
    copiesInStock,
    price );
    System.out.println("Created new object instance Title\n");
    System.out.println( "FullISBN = " + getFullISBN() );
    System.out.println( "ISBN = " + getISBN() );
    System.out.println( "Title = " + getTitle() );
    System.out.println( "Author = " + getAuthor() );
    System.out.println( "Copies = " + getCopiesInStock() );
    System.out.println( "Price = " + getPrice() );
    return atitle;
    I'm really stuck and if I solve this I should hopefully be able to make progress again. I've spent a day and a half on it and I really need some help. Thanks in advance.
    Mark.

    Hi Mark:
    Have a look of the method okButtonActionPerformed:
            private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
             // if you create the confirmAddTitlePanel here, the value of
             // Shop.save_ is null at this moment (first time), becaouse you
             // call the methode setValues() in the constructor, bevore you've
             // called the method Shop.setObject(..), which has to initialize
             // the variable Shop.save_!!!
             // I think, you have to create confirmAddTitlePanel after call of
             // method Shop.setObject(...)!
             // ConfirmAddTitlePanel confirmAddTitlePanel = new ConfirmAddTitlePanel();
            ConfirmAddTitlePanel confirmAddTitlePanel = null;
            String fullISBN            = fullISBNTextField.getText();
            String ISBN                = "Test String";
            String title               = titleTextField.getText();
            String author              = authorTextField.getText();
            String copiesInStockString = copiesInStockTextField.getText();
            String priceString         = priceTextField.getText();
            int copiesInStock          = 0;
            int price                  = 0;
            try
                copiesInStock = Integer.parseInt( copiesInStockString );
            catch ( NumberFormatException e )
                // replace with error output, place in status bar or pop-up dialog
                // move focus to copies field
            try
               price = Integer.parseInt( priceString );
            catch ( NumberFormatException e )
                // replace with error output, place in status bar or pop-up dialog
                // move focus to price field
            model.Title mss = model.Title.newInstance( fullISBN,
                                     ISBN,
                                     title,
                                     author,
                                     copiesInStock,
                                     price );
            model.Shop.setObject( mss );
            // ---------- now, the Shop.save_ has the value != null ----------        
            confirmAddTitlePanel = new ConfirmAddTitlePanel();     
            // Fetch reference to Graphical so buttons can use it to
            // display panels
            graph = model.Shop.getGraphical();
            graph.display( confirmAddTitlePanel );
        }//GEN-LAST:event_okButtonActionPerformedI hope, I have understund your program-logic corectly and it will help you.
    Best Regards.

  • Problem with Function returned without value  -

    all i am having a problem w/ jdev passing the values. when hardcoded it works. when i remove to pass the 2 vals for doc_type and doc_num the params are being passed to the impl but the String sql = " BEGIN :5 := scotts_test_proc.get_log(:1, :2, :3, :4 ); END; "; is not sending the values to the pkg. to verify i am getting data i created a table to store the data being passed/retrieved by function. i am getting the log_pieces posted when hard coded so i know that works. but when i try to pass the doc_type and doc_num it errors w/ function returend without value . am i passing the params correctly from co to impl to func to get the return l0g_piece. thats for the help
    calling package
    spec
    function Get_Log( -- rmode IN NUMBER , rmode IN STRING, doc_type IN VARCHAR2 DEFAULT 'TEL',
    doc_id IN VARCHAR2 DEFAULT NULL , doc_num IN VARCHAR2 DEFAULT NULL
    -- , p_out out varchar2
    ) -- IS --proc
    RETURN varchar2 IS --function
    body
    l_doc_type := 'TEL';- remove this hardcoded
    l_doc_type := doc_type ; --to pass the param
    IF l_doc_type = 'TEL' THEN
    -- l_log_pieces := Get_TEL(TRIM(3524204)); --change 3524204 to doc_num                hardcoded presently
    l_log_pieces := Get_TEL(TRIM(doc_num)); --to pass the param  
    -- (doc_num);
    l_log_piece := l_log_pieces(1);
    -- p_out := l_log_piece ;
    insert into isitthere (doc_type, doc_num, isitthere) VALUES (doc_type, doc_num, l_log_piece); commit;
    return l_log_piece; -- function -- return p_out; -- function p_out :=  l_log_piece ;  proc
    END IF; --if doc type is TEL
    FROM CO
    System.out.println("CO Passing paramDOC_TYPE for -------> " +docAbbr.getValue(pageContext)      );    --   passing TEL
    System.out.println("CO Passing paramDOC_NUM for -------> " + paramDOC_NUM ); -- passing 88
    String getDocAbbrForHTML = docAbbr.getText(pageContext);
    System.out.println("Passing CO getDocAbbrForHTML for -------> " + getDocAbbrForHTML ); -- passing TEL
    Serializable paramDocLocatorParamList [] = {paramRMODE, getDocAbbrForHTML , paramDOC_ID, paramDOC_NUM , p_out };
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction dbtrans;
    OAViewObject docLocator = (OAViewObject)am.findViewObject("DocLocatorVO1");
    Serializable paramABC = "TELNET";
    paramABC = am.invokeMethod("getHTMLString", paramDocLocatorParamList);
    rtxt0.setValue(pageContext, "here it is 12354" + paramABC.toString() );
    // docLocator.executeQuery();
    // --------------- End getHTMLString ----------------- //
    FROM AM IMPL
    public String getHTMLString ( String paramRMODE, String getDocAbbrForHTML , String paramDOC_ID, String paramDOC_NUM, String p_out )
    System.out.println("Entering The AM Impl");
    System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +getDocAbbrForHTML     );   -- got TEL in param
    System.out.println("Passing paramDOC_NUM in IMPL -------> " + paramDOC_NUM ); -- got 88 in param
    CallableStatement st = null;
    OADBTransaction txn = (OADBTransaction)getDBTransaction();
    Connection conn = txn.getJdbcConnection();
    String sql = " BEGIN :5 := scotts_test_proc.get_log(:1, :2, :3, :4 ); END; ";
    CallableStatement cs = txn.createCallableStatement(sql,1);
    String ErrorExist = "";
    String getHTML = "";
    try
    cs.setString(1, paramRMODE); // cs.setInt(1, paramRMODE.intValue()); // cs.setInt(1,Integer.parseInt(paramRMODE));
    cs.setString(2, getDocAbbrForHTML); //paramDOC_TYPE);
    cs.setString(3, paramDOC_ID);
    cs.setString(4, paramDOC_NUM);
    // cs.setString(5,p_out); // --param   
    /* cs.registerOutParameter(1,Types.CHAR);
    cs.registerOutParameter(2,Types.CHAR);
    cs.registerOutParameter(3,Types.CHAR);
    cs.registerOutParameter(4,Types.CHAR);*/
    cs.registerOutParameter(5,Types.VARCHAR);
    cs.execute();
    getHTML = cs.getString(5 ) ;
    p_out = getHTML;
    //this string is to see my results. only......
    String x ="abc 123";/*"<BR><font face=Verdana ><b>TEL Document Action History <BR><font color=#336699>(3524204    Nosulina, Yelena N     COMPLETE)</b></font></font><br><br><table border=1 width=100% cellspacing=0 cellpadding=2 bordercolor=#EEEEDC> <tr bgcolor=#F7F7E7>"
    + " <td width=11% valign=top align=left><font face=Verdana size=2 color=#336699><b>Action</b></font></td> <td width=17% valign=top align=left ><font face=Verdana size=2 color=#336699><b>Approver UserName</b></font></td> <td width=14% valign=top align=left ><font face=Verdana size=2 color=#336699><b>Date/Time </b></font></td> <td width=56% valign=top align=left ><font face=Verdana size=2 color=#336699><b>Notes</b></font></td> "
    +" </tr> <!-- loop thru this set of rows ---> <tr bgcolor=#FFFFFF> <td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2> </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-20-2011 03:01:23 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>DOCUMENT CREATED </font></td> </tr> <!-- end loop--> "
    + " <tr bgcolor=#FFFFFF> <td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>McCombs, Tracey L </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:10 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Requestor </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +" <td width=11% valign=top align=left ><font face=Verdana size=2 >WF STARTED </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Workflow </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:21 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Workflow Started </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +"<td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>McCombs, Tracey L </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:21 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>SUBMIT </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +"<td width=11% valign=top align=left ><font face=Verdana size=2 >NOTIFICATION SENT </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Workflow </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Dec-30-2011 01:12:21 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Notification sent to User Approvals Level 1, Org ID: 455 311402400 Med - Infectious Diseases </font></td> "
    +" </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> <td width=11% valign=top align=left ><font face=Verdana size=2 >  </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Brownlow, Lana Jill </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 08:49:48 AM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Approved :  </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +" <td width=11% valign=top align=left ><font face=Verdana size=2 >USER APPROVED </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2>Workflow </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 08:49:48 AM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Completed all User Approvals </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    + " <td width=11% valign=top align=left ><font face=Verdana size=2 >CENTRAL APPROVED </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2> </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 08:49:48 AM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>Completed Central Approval Process  </font></td> </tr> <!-- end loop--> <tr bgcolor=#FFFFFF> "
    +" <td width=11% valign=top align=left ><font face=Verdana size=2 > </font></td> <td width=17% valign=top align=left ><font face=Verdana size=2> </font></td> <td width=14% valign=top align=left ><font face=Verdana size=2>Jan-03-2012 02:17:07 PM </font></td> <td width=56% valign=top align=left ><font face=Verdana size=2>DOCUMENT REASON CHANGED TO COMPLETE. DATA LOADED IN BASE TABLES. </font></td> </tr> <!-- end loop--></table>";
    getHTML = x;
    System.out.println("getHTML 1234 is " + getHTML ); -- testing output to get returned
    cs.close();
    catch (SQLException sqle)
    try { cs.close(); }
    catch (Exception e) {}
    throw OAException.wrapperException(sqle);
    return getHTML;

    when return is encountered your function terminates.

  • Very strange bug with compareTo: returning incorrect results

    Hello everyone! I have used the method compareTo many times to maintain my database project's entries. However recently I have discovered a bug, in which:
    a and b both being Storage type objects:
    private static class Storage {
    object data
    int nextData //an array stores the Storage objects
    int previousData //this uses an integer to locate previous in array
    Problem:
    ((Comparable)(a.data)).compareTo((Comparable)(b.data)) returns a 3, when a.data is clearly 5, and b.data is clearly 20.
    This is very strange, as the compareTo should return a -1 instead of a positive number. Is this a known bug with the compareTo method? I have been using it reliably for many programs but this is the first time it ever occurs to me.

    Problem:
    ((Comparable)(a.data)).compareTo((Comparable)(b.data))
    returns a 3, when a.data is clearly 5, and b.data is
    clearly 20.
    This is very strange, as the compareTo should return a
    -1 instead of a positive number. Is this a known bug
    with the compareTo method? I have been using it
    reliably for many programs but this is the first time
    it ever occurs to me.Not really... comparing Strings "5" to "20"
    is really the same as comparing "5" to "2"
    being the first character of the string, difference
    being, surprise, surprise = 3.
    If you want the Strings to be comparable that way you should left-fill them with spaces or zeros.
    Or, better still, override compareTo and make your Storage implement Comparable instead of all that casting of the data objects.

  • Webservice : problem with Base64 returned value

    Hello all,
    We are calling a webservice from a Flex2 application.
    When the returned value does not contain accentuated letters,
    we receive the value "as-is", everything is OK.
    When there is at least one accent, the result is
    automatically Base64 encoded by the server, and the
    xsi:type="n2:base64 is specified in the XML answer.
    The problem is that Flex2 does not Base64 decode the returned
    string, ans we cannot get the right value.
    We do not think that the problem is on the server, because we
    tryied to use 2 other webservice clients, and they worked well.
    We wonder if Flex2 can handle Base64 encoding on Webservice
    results or not.
    We thought abut using the Base64 decoder class, but it won't
    work because the result if not *always* Base64 encoded (depending
    if it contains some chars or not).
    Is there any solution to this issue ? If it can help, I paste
    the XML returned by the server at the end of this message.
    Thank you for your help.
    MiF
    <?xml version="1.0" encoding="UTF-8" ?>
    <env:Envelope xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:env="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">
    <env:Body>
    <n1:GetArticleResponse xmlns:n1="urn:ActionWebService"
    env:encodingStyle="
    http://schemas.xmlsoap.org/soap/encoding/">
    <return xmlns:n2="
    http://schemas.xmlsoap.org/soap/encoding/"
    xsi:type="n2:base64">PD94bWwgdmVyc2lvbj0iMS4xIiBlbmNvZGluZz0iSVNPLTg4NTktMSI/Pgo8
    YXJ0aWNsZXM+CiAgPGFydGljbGU+CiAgICA8aWQ+MTwvaWQ+CiAgICA8Y29k
    ZT5NaXRjaDwvY29kZT4KICA8L2FydGljbGU+CiAgPGFydGljbGU+CiAgICA8
    aWQ+MjwvaWQ+CiAgICA8Y29kZT5Qb2xvPC9jb2RlPgogIDwvYXJ0aWNsZT4K
    ICA8YXJ0aWNsZT4KICAgIDxpZD4zPC9pZD4KICAgIDxjb2RlPkvpa+k8L2Nv
    ZGU+CiAgPC9hcnRpY2xlPgo8L2FydGljbGVzPgo=</return>
    </n1:GetArticleResponse>
    </env:Body>
    </env:Envelope>

    You should use cast_to_varchar2 regardless what is source of base64_encode.
    Because base64-value consists of single byte ASCII-characters.

Maybe you are looking for

  • Imac corrupted, how to restore

    iMac has become corrupt and display is unreadable, rebooted and it has remained the same. Any advice?

  • HT204389 How do I get Siri to work after updating to iOS 7.1?

    After updating my iPhone 4s to iOS 7.1, SIRI is no longer working. Siri worked perfectly prior to software update and the phone is in mint condition.

  • How to convert decimal notation to comma notation

    Hi Folks, I have an issue in converting decimal notation to comma notation for France. I have changed the decimal notation in SU01 from 123.4 to 123,4 but when i run some custom program written by me it is extracting output as 123.4 than 123,4. So i

  • Error in Leave Request

    Hi, We are using the standard Leave application -- HRESS_A_PTARQ_LEAVREQ_APPL and the application is working fine except for one employee. Seems like Basis issue but it must be for all the employees. PERNR is mapped and all the master data is correct

  • Extracting the total in dollars from a form

    Hi, I have a order form with fields for 5 products, each product can be ordered in single qty or a case with a sub total field plus a grand total and I'm trying to figure out how to extract the total & grand total amounts (in dollars) into the php fo