Attributes XML makes my query returns no rows

Hi all

I have a strange problem.

I ask an XML, but the attributes in one of the tags my query will return no rows. If I delete the attributes, the query works as expected.

The XML code is below; This is the Report tag attributes that cause problems:
<result errorCode="0">
     <return>
          <Report
               xsi:schemaLocation="Items_x0020_status_x0020_information http://******-****/ReportServer?%2FReports%2FContent%20Producer%20Reports%2FItems%20status%20information&amp;rs%3AFormat=xml&amp;rc%3ASchema=True"
               Name="Items status information" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns="Items_x0020_status_x0020_information">
               <Tablix1>
                    <Details_Collection>
                         <Details ItemId="914P7" Username="test" user_role="IT"
                              first_name="Barry" last_name="Donovan" organisation=""
                              content_format="On_Screen" modified_date="26/05/2011 13:16:49"
                              item_status="Draft" status_date="" component_name="" demand="" />
                    </Details_Collection>
               </Tablix1>
          </Report>
     </return>
</result>
My query is:
     select
            a.item_id
           ,a.username
           ,a.user_role
           ,a.first_name
           ,a.last_name
           ,a.supplier_id
           ,a.format
           ,a.modified_date
           ,a.item_status
           ,a.completion_date
           ,a.component_code

         from   dual
               ,xmltable
                ('/result/return/Report/Tablix1/Details_Collection/Details'
                   passing p_xml
                   columns
                      item_id         varchar2(1000) path '@ItemId'
                     ,username        varchar2(1000) path '@Username'
                     ,user_role       varchar2(1000) path '@user_role'
                     ,first_name      varchar2(1000) path '@first_name'
                     ,last_name       varchar2(1000) path '@last_name'
                     ,supplier_id     varchar2(1000) path '@organisation'
                     ,format          varchar2(1000) path '@content_format'
                     ,modified_date   varchar2(1000) path '@modified_date'
                     ,item_status     varchar2(1000) path '@item_status'
                     ,completion_date varchar2(1000) path '@status_date'
                     ,component_code  varchar2(1000) path '@demand'
                ) a;
I tried to strip the attributes to the tag, which works, but some XML I look back are large enough (number of records), so that cause problems in itself. I would rather deal with it and don't mess with the XML itself if possible.

Any help would be much appreciated!

Thank you much in advance.

Robin

Published by: User_resU on April 12, 2012 14:50

The element of report and its children belong to a default namespace.
You have stated that in the request too:

xmltable
(
xmlnamespaces('Items_x0020_status_x0020_information' as "ns0"),
'/result/return/ns0:Report/ns0:Tablix1/ns0:Details_Collection/ns0:Details'
   passing

Tags: Database

Similar Questions

  • Oracle Text multi column index based query returns no rows

    Hello

    I have a MAH_KERESES_MV table with 3 columns OBJEKTUM_NEV, KERESES_SZOVEG_1, KERESES_SZOVEG_2. I create the following Oracle multi column text index:

    ctx_ddl.create_preference exec ('MAH_SEARCH', 'MULTI_COLUMN_DATASTORE');
    ctx_ddl.set_attribute exec ('MAH_SEARCH', 'COLUMNS', 'OBJEKTUM_NEV, KERESES_SZOVEG_1, KERESES_SZOVEG_2');

    create index MAX_KERES_CTX on MAH_KERESES_MV (OBJEKTUM_NEV)
    indexType is ctxsys.context
    parameters ("DATASTORE MAH_SEARCH");
    But the query returns no rows, although if I make the query with the 'like' operator, and then I get the results as expected:

    SELECT id, OBJEKTUM_NEV
    OF MAH_KERESES_MV
    WHERE CONTAINS (OBJEKTUM_NEV, "C") > 0;

    Can some body please help? TIA,

    Tamas

    You can do it in Oracle Text, well it is not necessarily desirable.

    You can search the

    WHERE CONTAINS(OBJEKTUM_NEV, '%C%')>0;
    

    And it will probably work in a simple test. However, using a leader like this wildcard prevents them the index on the table "list of words" used, so such a request can be very slow on a large system.
    You can improve this by using SUBSTRING_INDEX, but making your much bigger index. And you could always hit the 'expansions too' problem if %C % expansion is more than about 15,000 words (depending on version and different settings).

    Also be aware of differences in case - %C % will match 'fact' or 'FACT', as part of a CONTAINS, but not part of a TYPE.

  • If a view object query returns no rows, can the vacuum to be tested at all?

    All those who know or have also experienced:

    I guess that the answer should be Yes, but I tried anyway, I still didn't worked. Here is the code (it's a method behind a command button, a bean of support (I use JDeveloper 10.1.3.4).) In the code, LoggedInStudent is the name of a view object; ZBLCModule is the name of the application module):
        public String commandButton1_action() {
            FacesContext fc = FacesContext.getCurrentInstance();
            ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
            BindingContext bc = (BindingContext)vb.getValue(fc);
            DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl");
            ApplicationModule am = (ApplicationModule)dc.getDataProvider();
            ZBLCModuleImpl zblcam = (ZBLCModuleImpl)am;
            LoggedInStudentImpl studentsFound = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
            
            String navCase = null;
            
            // Test (1): if the view cache is empty; always bombs up the application if it IS empty:
            if(studentsFound.getAllRowsInRange().length == 0) {
                navCase = "userNotFound";
            // (2) The following three tests gets to run only when the cache is not empty; they work fine.
            } else if (((Number)studentsFound.first().getAttribute("HoursAttm")).floatValue() == 0.0) {
                navCase = "noHours";
            } else if (((Number)studentsFound.first().getAttribute("Balance")).floatValue() > 0.0) {
                navCase = "notZero";
            } else if (!(studentsFound.first().getAttribute("Validated").equals(" "))) {
                navCase = "validated";
            } else {
                navCase = "zeroBal";
            }
            return navCase;
        }
    When the view object query returns a line, the whole of the application works without error. When the query returns no rows, test (1) always bombs toward the top of the application, prompting a Houston-30003 error.

    (1) test, I tried the following:
      if (studentsFound.getAllRowsInRange().length == 0)
      if (studentsFound.first() == null)
      if (studentsFound.getEstimatedRowCount() == 0)
      if (studentsFound.isDead()) //I do not know what isDead() does; just tried desperately.
      if (studentsFound.equals(null))
      if (studentsFound.getCurrentRow() == null)
    With each of these events, I got an error of Houston-30003. It does not matter what looks like the conditional test; It is important only when the objects from view cache is empty. If the view cache is not empty, everything, including the test (1), works very well. And when the cache is empty is not because of the failure of the connection to the database, but because the student is not in the data table and line are for the student.

    It is a requirement of the company to do something when the view object query returns no rows. Can it be tested at all? How?

    Or is there something wrong in the first lines in the method before the {color: green} String navCase = null; {color} line?

    Thank you very much for your help!


    Newman

    Hello

    What you have done, is to get a handle to the object that CAN execute queries to the database.
    However, you do not query the database.

    Just add:

      LoggedInStudentImpl studentsFound = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
      //New line
      studentsFound.executeQuery();
    

    The code that Shay has given you is when you do not have a request for all module, but since you are talking about a command etc button I guess that the module of the application is already active.
    The line I gave you should be enough to make it work.

    I'd be careful with the

    studentsFound.hasNext();
    

    I suggest to use estimatedRowCount();

    -Anton

  • How to know what sub query returns multiple rows

    Hi all

    Someone can give me hints, how to know what sub query returns many rows in the following query.
    /* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
    SELECT a.*, ROWNUM AS rnm
      FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
                            prxm.mbr_idntfr AS "Beneficiary ID",
                               md.last_name
                            || ', '
                            || md.first_name AS "Beneficiary Name",
                            pci.idntfr AS "Tracking No.",
                            TO_CHAR (TRUNC (req.pa_rqst_date),
                                     'MM/dd/yyyy'
                                    ) AS "Request Date",
                            sts.status_name AS "Status",
                            req.pa_rqst_sid AS "Request #",
                            prxm.mbr_sid AS "Mbr_sid",
                            TO_CHAR
                                  (TRUNC (req.pa_revision_date),
                                   'MM/dd/yyyy'
                                  ) AS "Last Updated",
                            TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
                            prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
                            pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
                            DECODE
                               ((SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                0, (SELECT prxplo.prvdr_lctn_idntfr
                                      FROM pa_request_x_provider_location prxplo
                                     WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                       AND prxplo.oprtnl_flag = 'A'
                                       AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT prxplo.prvdr_lctn_idntfr
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "NPI/ID",
                            DECODE
                               ((SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT    pd.last_name
                                              || ', '
                                              || pd.first_name
                                              || ' '
                                              || pd.middle_name
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "Prvdr Name",
                            TO_CHAR (psd.from_date,
                                     'MM/dd/yyyy'
                                    ) AS "Srvc From Date",
                            TO_CHAR (req.validity_start_date,
                                     'MM/DD/YYYY'
                                    ) AS "Due Date",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>Left",
                            req.pa_mode_type_lkpcd AS "Source",
                            TO_CHAR (TRUNC (wmdtl.rtng_date),
                                     'MM/dd/yyyy'
                                    ) AS "Assigned On",
                            NVL (wmdtl.assigned_to_user_name,
                                 'Not Assigned'
                                ) AS "Assigned To",
                            req.org_unit_sid AS "OrgUnitSid",
                            TO_CHAR
                                 (wmdtl.modified_date,
                                  'MM/dd/yyyy hh24:mi:ss'
                                 ) AS "WTRD_MODIFIED_DATE",
                            TO_CHAR (wmdtl.rtng_date,
                                     'MM/dd/yyyy'
                                    ) AS "WTRD_RTNG_DATE",
                            req.status_cid AS "PA_STATUS_CID",
                            TO_CHAR (req.modified_date,
                                     'MM/dd/yyyy'
                                    ) AS "PA_REQ_MODIFIED_DATE",
                            prs.state_pa_srvc_type_code
                                                     AS "STATE_PA_SRVC_TYPE_CODE",
                            wmdtl.wm_pa_task_rtng_dtl_sid
                                                        AS "WM_TASK_RTNG_DTL_SID",
                            wmdtl.assigned_to_user_acct_sid
                                              AS "WTRD_Assigned_to_user_acct_sid",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>LeftSort",
                            wmdtl.assigned_to_org_unit_sid
                                                  AS "WTRD_Assigned_to_OrgUntSid",
                            DECODE
                               ((SELECT COUNT (*)
                                   FROM pa_request_status prs
                                  WHERE prs.pa_rqst_sid = req.pa_rqst_sid
                                    AND prs.status_cid = 5
                                    AND prs.oprtnl_flag = 'I'),
                                0, 'N',
                                'Y'
                               ) AS "SHOW_UTILIZATION"
                       FROM   pa_request req,
                             pa_certification_identifier pci,
                             status sts,
                             pa_request_x_member prxm,
                             wm_pa_task_routing_detail wmdtl,
                             pa_service_date psd,
                             org_unit ou,
                             pa_request_service prs,
                             pa_request_x_provider_location prxpl,
                             provider_location pl,
                             provider_detail pd,
                             provider p,
                             mbr_dmgrphc md
                      WHERE req.oprtnl_flag = 'A'
                        AND req.status_cid NOT IN
                                     (20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
                        AND req.org_unit_sid IN
                               (3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
                                3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
                                3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
                                3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
                                3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
                                3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
                                3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
                                3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
                                3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
                                3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
                                3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
                                3101, 3186, 3102, 3187, 3103, 3003, 75000104,
                                75000108, 2006, 75000103, 75000102, 75000113,
                                75000111, 75000109, 2001, 2009, 75000105,
                                75000107, 2004, 2010, 2013, 2014, 2005, 2011,
                                75000112, 2002, 1001, 2012, 75000106, 2007,
                                75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
                                3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
                                3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
                                3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
                                3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
                                3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
                                3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
                                3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
                                3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
                                3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
                                3140, 3056, 3141)
                        AND req.pa_rqst_sid = prs.pa_rqst_sid
                        AND prs.oprtnl_flag = 'A'
                        AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
                        AND psd.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = pci.pa_rqst_sid
                        AND pci.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxm.pa_rqst_sid
                        AND prxm.oprtnl_flag = 'A'
                        AND md.oprtnl_flag = 'A'
                        AND md.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
                        AND prxm.mbr_sid = md.mbr_sid
                        AND ou.org_unit_sid = req.org_unit_sid
                        AND ou.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND pci.pa_rqst_sid = prxm.pa_rqst_sid
                        AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
                        AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxpl.pa_prvdr_type_lkpcd = 'RR'
                        AND prxpl.oprtnl_flag = 'A'
                        AND req.status_cid = sts.status_cid
                        AND sts.status_type_cid = 3
                        AND sts.oprtnl_flag = 'A'
                        AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
                        AND p.prvdr_sid = pd.prvdr_sid
                        AND p.prvdr_sid = pl.prvdr_sid
                        AND pd.oprtnl_flag = 'A'
                        AND pd.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
                        AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
                        AND wmdtl.subsystem_lkpcd = 'PA'
                        AND wmdtl.oprtnl_flag = 'A'
                        AND req.pa_rqst_date > (SYSDATE - 365)
                                       ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
                            "Beneficiary Name" ASC) a
     WHERE ROWNUM < 102;
    Kind regards
    Prakash P

    Published by: BluShadow on May 17, 2011 15:01
    addition of {noformat}
    {noformat} tags around the code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    3360 wrote:
    See point 9 of this section of the FAQ on how to format the code.

    SQL and PL/SQL FAQ

    I see that you did.

    No, I did. It's pretty easy to change if the code seems formatted anyway below. It's when I go to edit the message and find no sense because it is not formatted in all cases, I despair. {noformat} :) {noformat}

  • Stupid old backpacker (me) cannot understand why this query returns 1 row

    Hi all

    In reference to {: identifier of the thread = 2456973}, why do
    select sum(count(decode(job, 'CLERK', 1, null))) CLERKS
    , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS
    from emp group by job;
    only 1 rank and not 1 for each task? In fact, I had to test it myself to believe.

    It returns the data as if the query were
    select sum(CLERKS), sum(SALESMANS)
    from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS
             from emp group by job)
    Using only a single aggregate (count or sum) returns 1 row per job, as expected

    John Stegeman wrote:
    It returns the data as if the query were

    select sum(CLERKS), sum(SALESMANS)
    from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS
    from emp group by job)
    

    Exactly the point ;-)

    It seems that Oracle actually do, a group of 'double' in the same operation.
    Attend plans to explain in this example:

    SQL> select count(decode(job, 'CLERK', 1, null)) CLERKS
      2       , count(decode(job, 'SALESMAN', 1, null)) SALESMANS
      3  from scott.emp group by job;
    
        CLERKS  SALESMANS
    ---------- ----------
             0          0
             0          0
             0          0
             0          4
             4          0
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1697595674
    
    ---------------------------------------------------------------------------
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   1 |  HASH GROUP BY     |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------
    

    And compare it to the one with the double aggregates:

    SQL> select sum(count(decode(job, 'CLERK', 1, null))) CLERKS
      2       , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS
      3  from scott.emp group by job;
    
        CLERKS  SALESMANS
    ---------- ----------
             4          4
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 417468012
    
    ----------------------------------------------------------------------------
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   1 |  SORT AGGREGATE     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   2 |   HASH GROUP BY     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------
    

    There are GROUP BY hash and SORT GLOBAL times.

    It is really unnecessary to an aggregate on an aggregate - if two aggregates are used "in the same group level.
    Sum() aggregates are used on an already aggregated value, so it doesn't look like Oracle which actually cures like 'first do the internal aggregate using the group specified by and then do the external aggregation on the result with any group.'

    Look at this example where I combine aggregates "double" with "single" aggregates:

    SQL> select sum(count(decode(job, 'CLERK', 1, null))) CLERKS
      2       , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS
      3       , count(decode(job, 'SALESMAN', 1, null)) SALESMANS2
      4       , count(*) COUNTS
      5  from scott.emp group by job;
    
        CLERKS  SALESMANS SALESMANS2     COUNTS
    ---------- ---------- ---------- ----------
             4          4          1          5
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 417468012
    
    ----------------------------------------------------------------------------
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   1 |  SORT AGGREGATE     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   2 |   HASH GROUP BY     |      |     1 |     8 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------
    

    When you mix "doubles" and "single" aggregates, Oracle decides that unique aggregates belong to the 'outer' aggregation
    SALESMAN2 did a count on the aggregated work column which is the result of the 'internal' group by - so only 1.
    The count (*) is also the result of the aggregation of the 'internal '.

    I don't know if it's documented or if it is an 'effect' of internal code used for GROUPING SETS or the internal code used to enable the analytical functions like this:

    SQL> select count(decode(job, 'CLERK', 1, null)) CLERKS
      2       , count(decode(job, 'SALESMAN', 1, null)) SALESMANS
      3       , sum(count(decode(job, 'CLERK', 1, null))) over () CLERKS2
      4       , sum(count(decode(job, 'SALESMAN', 1, null))) over () SALESMANS2
      5  from scott.emp group by job;
    
        CLERKS  SALESMANS    CLERKS2 SALESMANS2
    ---------- ---------- ---------- ----------
             0          0          4          4
             4          0          4          4
             0          0          4          4
             0          0          4          4
             0          4          4          4
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 4115955660
    
    ----------------------------------------------------------------------------
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT    |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   1 |  WINDOW BUFFER      |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   2 |   SORT GROUP BY     |      |     5 |    40 |     4  (25)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| EMP  |    14 |   112 |     3   (0)| 00:00:01 |
    ----------------------------------------------------------------------------
    

    Personally, I think that I would have preferred if Oracle has raised an error on this "double aggregation" and therefore require me to write this way (if it's the result I wanted):

    select sum(CLERKS), sum(SALESMANS)
    from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS
             from emp group by job)
    

    I don't really see a good use case for aggregations of 'double'-, but rather that he could give you undetected bugs in your code, if you happen to do double aggregation without noticing.

    Interesting thing to know ;-)

  • SQL query returning no rows, please help!

    I have a table that contains the user checks for a specific procedures alongwith the date stamp. Now, I want the list of all procedures that are not accessible by users in the last 6 months. Or, all of the procedures that have not been used/accessible during the last 6 months.

    That's what I'm trying, but is does not return all rows:

    SELECT DISTINCT proc_name,
    TRUNC (entry_date)
    OF log_web
    WHERE NOT IN (SELECT proc_name proc_name
    OF log_web
    WHERE TRUNC (entry_date) > TRUNC (SYSDATE - 180))
    ORDER BY DESC 2

    Please notify.
    Thank you in advance.

    Hello

    NOT IN never returns TRUE if the subquery returns NULL values. If proc_name doesn't have a NOT NULL constraint, change the subquery to

    WHERE        proc_name     NOT IN ( SELECT  proc_name
                                FROM      log_web
                         WHERE      entry_date     > TRUNC (SYSDATE - 180)
                         AND      proc_name     IS NOT NULL
                          )
    

    I don't see any other suspect.
    Post a small example of data (CREATE TABLE and INSERT statements) where the query produces results worng.

  • single line sub query returns multiple rows

    Hi, please help me to solve this, working with oracle 11g.


    Update t1 set t1.twyindex = twypoly (select twyindex from twyinfo where t1.id = t2.id t2);

    the error message is:
    *
    ERROR on line 1:
    ORA-01427: einreihig subquery returns multiple rows

    Thank you

    don123 wrote:
    Hi paul, thanks...

    duplicate existing due to the business logic data.

    can I use the SQL mentioned above for all cases?

    is it mandatory to remove duplicates?

    Please provide your suggestions...

    If the company says duplicates are allowed, you have to ask the person who wants what, of the different twyindexes, that they want to use
    updating twyinfo table...

    I use the SQL proposed until they tell you that twyindex to use.

  • User_Scheduler_Jobs query returns no row in the version 2.1.0.63

    Using the 2.1.0.63 version, "select * from user_scheduler_jobs;" returns no rows. It works fine in version 1.5.5.

    Published by: User65423 on February 8, 2010 09:24

    Refer to this topic, when the cause seems to be due to SQL Developer manages not null interval data types.

    bug? F9 gives no output dba_scheduler_jobs, version: 2.1.0.63.73

    As mentioned in this thread, you can use to_char on the columns of the interval as a workaround...

    SELECT source,
    destination,
    comments,
    flags,
    job_name,
    job_creator,
    client_id,
    global_uid,
    program_owner,
    program_name,
    job_type,
    job_action,
    number_of_arguments,
    schedule_owner,
    schedule_name,
    start_date,
    repeat_interval,
    end_date,
    job_class,
    enabled,
    auto_drop,
    restartable,
    state,
    job_priority,
    run_count,
    max_runs,
    failure_count,
    max_failures,
    retry_count,
    last_start_date,
    TO_CHAR(last_run_duration),
    next_run_date,
    TO_CHAR(schedule_limit),
    TO_CHAR(max_run_duration),
    logging_level,
    stop_on_window_close,
    instance_stickiness,
    system,
    job_weight,
    nls_env
    FROM user_scheduler_jobs a;
    
  • SQL query returns no row vs. multiple lines

    Hello

    I am trying to get the result of a simple sql query,
    If there is no row returned, he would have "No. ROWS" in the result set.
    Other wise all the rows containing data is necessary.

    Let me know how this could be achieved. Under query works for the latter and not first case as mentioned below

    OUTPUT

    + (box 1) when we use B_ID = 123456 +.

    IDS
    -----
    'NO LINE '.

    + (box 2) when we use B_ID = 12345 +.
    IDS
    -----
    1 11112345
    2 22212345
    create table TEMP_AAA
    (
      A_ID VARCHAR2(10),
      B_ID VARCHAR2(10)
    )
    
    INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('111','12345');
    INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('222','12345');
    INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('333','12000');
    INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('444','10000');
    WITH 
    MATCH_ROWS AS
    (
           SELECT A_ID||B_ID IDS FROM TEMP_AAA WHERE B_ID=12345
    ),
    
    MATCH_ROW_COUNT AS
    (
           SELECT COUNT(1) AS COUNTS FROM MATCH_ROWS
    ),
    
    PROCESSED_ROWS AS
    (
           SELECT
                 CASE WHEN COUNTS = 0
                      THEN 
                       (SELECT NVL((SELECT IDS FROM TEMP_AAA WHERE B_ID=12345),'NO ROWS') IDS FROM DUAL)
                      ELSE
                       MATCH_ROWS.IDS
                 END IDS     
            FROM MATCH_ROWS,MATCH_ROW_COUNT
    )
    
    SELECT * FROM PROCESSED_ROWS;

    Hello

    I think you want to put this on a report or something. I have what would be easier to do this logic there. But if you want that this is possible.
    Like this

    with
    temp_aaa as
    (select '111' a_id ,'12345' b_id from dual union all
    select '222'      ,'12345'  from dual union all
    select '333'      ,'12000'  from dual union all
    select '444'      ,'10000'  from dual
    )
    , wanted_rows as
    ( select  '123456' B_ID from dual)
    select
      temp_aaa.A_ID || temp_aaa.B_ID IDS 
    
    from
      temp_aaa
      ,wanted_rows
    where
      temp_aaa.b_id = wanted_rows.b_id
    union all
    select
      'NO ROWS'
    FROM
      DUAL
    WHERE
      (SELECT COUNT(*) FROM TEMP_AAA, wanted_rows WHERE TEMP_AAA.B_ID = wanted_rows.B_ID) = 0
    

    In addition, you mix var and number of always use the same type or convert explicitly (to_number or to_char)

    WITH
    MATCH_ROWS AS
    (
           SELECT A_ID||B_ID IDS FROM TEMP_AAA WHERE      B_ID           =12345
    --                                                    varchar2(10)   number
    ),
    ...
    

    And again in the

                      THEN
                       (SELECT NVL((SELECT IDS FROM TEMP_AAA WHERE B_ID           =12345),'NO ROWS') IDS FROM DUAL)
    --                                                             varchar2(10)   number
    

    Kind regards

    Peter

  • Export query returns no rows

    Dear guy,

    I jam with this problem for 2 days and have you guy help me to check it out. Here's my parfile

    TABLES IS UMARKETADM. TRANS_DATA

    CONTENT = DATA_ONLY

    EXCLUDE = STATISTICS

    QUERY = UMARKETADM. TRANS_DATA: "WHERE transid in (select id from umarketadm.trans t where t.last_modified > to_date (5 January 2014 00:00:00 ',' DD/MM/YYYY hh24:mi:ss') and t.state in (2.6))" "

    DUMPFILE = SHARED_DIR:Demand.dmp

    Network_link = remote_db

    and the result is:

    . . exported "UMARKETADM." "" TRANS_DATA ".6,398 KB0 rows

    Main table 'SYSTEM '. "" SYS_EXPORT_TABLE_01 "properly load/unloaded

    But when I check in, select the table:

    Select count (*) in umarketadm.trans_data

    where transid in (select id from umarketadm.trans t where t.last_modified > to_date (5 January 2014 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') and t.state in (2.6));


    then it results in: 1271258 lines

    Yes, is there some things wrong with my parfile?

    So thank you and best regards

    Ch

    Hello

    I think that maybe it's a quirk of how works on network lnk datapump. I think the memory some of the rferences becomes 'local' rather than distance.

    You can try?

    TABLES IS UMARKETADM. TRANS_DATA

    CONTENT = DATA_ONLY

    EXCLUDE = STATISTICS

    QUERY = UMARKETADM. TRANS_DATA: "WHERE transid in (select id from umarketadm.trans@remote_db t where t.last_modified > to_date (5 January 2014 00:00:00 ',' DD/MM/YYYY hh24:mi:ss') and t.state in (2.6))" "

    DUMPFILE = SHARED_DIR:Demand.dmp

    Network_link = remote_db

    See you soon,.

    Rich

  • Large type query returning no rows

    Hello

    Posted in right forum hope eth, I also posted this in SQl & PL/SQL which is not the right forum, I think.

    I'm running a kind of large select query, counties of table is as shown below.

    The lines are not returned which is quite impossible.

    What could be the reason. Tablespace TEMP has run out or optimizer does not?

    My Oracle version: 10 G R/2
    I tried to update the statistics for each table, I am unable to check the TEMP tblspace as am not the ADMINISTRATOR.


    COUNT (*) TABLE IS


    --------------------------------------------------------------------------------

    13047187

    COUNT (*) TABLE B
    --------------------------------------------------------------------------------

    618194

    COUNT (*) TABLE C
    --------------------------------------------------------------------------------

    18058

    COUNT (*) TABLE D
    --------------------------------------------------------------------------------

    9

    COUNT (*) TABLE E
    --------------------------------------------------------------------------------

    11813966

    COUNT (*) TABLE F
    --------------------------------------------------------------------------------

    18093

    COUNT (*) TABLE G
    --------------------------------------------------------------------------------

    13099

    COUNT (*) TABLE:
    --------------------------------------------------------------------------------

    12000000

    COUNT (*) TABLE I
    --------------------------------------------------------------------------------

    5285
    Anyy help is appreciated

    Seems to me that if the pid is different.
    Select * from where a pid = "ACT714";<-- no="">
    Select * from b where pid = "ACT714";<-- trailing="">

    Try
    Select count (*) of a, b
    where trim (a.pid) = trim (b.pid);

    If it works, you might want to consider how you store data, if they are supposed to be equal.

    Check also if you compare with the data type varchar2, char data type.
    I generally avoid the reasons char data type.

  • query by returning no rows

    Hi all
    This query returns all rows, but ideally it should.below I enclose the query
    select * FROM SERIAL_NO WHERE  serialno not in (SELECT SERIALNO FROM COB_T_SERIAL_NO
                                                                                union select serialno from genealogy
                                                                                union select lastarchivedby from genealogy
                                                                                union select serialno from asset
                                                                                union select serialno from code_serial_number
                                                                                union select serialno from cost
                                                                                union select serialno from cost_detail
                                                                                union select serialno from disposition
                                                                                union select serialno from disposition_content
                                                                                union select serialno from disposition_line
                                                                                union select serialno from disposition_test_reason
                                                                                union select serialno from inventory_count_serial_no
                                                                                union select serialno from inventory_serial_no
                                                                                union select serialno from inventory_serial_transit
                                                                                union select serialno from material_order_serial_no
                                                                                union select serialno from material_content_serial_no
                                                                                union select serialno from resource_content
                                                                                union select serialno from receipt_container_serial_no
                                                                                union select serialno from resource_serial_no
                                                                                union select serialno from sequence_queue_item
                                                                                union select serialno from serial_no_hold
                                                                                 union select serialno from wip_order_content_serial
                                                                                 union select serialno from wip_serial_no
                                                                                 union select serialno from wip_serial_no_content
                                                                                 union
                                                                                 select a.serialno from resource_labor_detail a  inner join resource_labor_detail_approval b on b.resourcelabordetailid=a.id
                                                                                  union
                                                                                  select c.serialno from labor_detail c inner join labor_detail_approval d on d.labordetailid = c.id
                                                                                   union 
                                                                                   select e.serialno from disposition_reading e  inner join disposition_resource f on f.dispositionreadingid = e.id                              
                                                                                   union select g.serialno from quality_defect g 
                                                                                    inner join   quality_defect_location h on h.qualitydefectid=g.id 
                                                                                    inner join quality_defect_loc_dimension i on i.qualitydefectlocationid=h.id )                          
                                                                                    
                                                                                                                 
                                                                                                                 

    Hello

    964145 wrote:
    right... I understand that it is difficult for you to help without data... it is syntactically correct?

    Yes, the syntax is very well. The fact that it runs (no matter how many rows it returns, if any) tells you that there is no syntax error.

    also, I want only distinct values, so I used the union rather than union all the

    Why do you want only the distinct values? The reulsts will be the same if there are duplicates or not.

    can I use like this? Please suggest

    with union_data as (SELECT SERIALNO FROM COB_T_SERIAL_NO
    union select serialno from genealogy
    ...
    inner join quality_defect_loc_dimension i on i.qualitydefectlocationid=h.id )           
    
    DELETE serial_no where serialno not in  (SELECT  serialno
    FROM    union_data
    WHERE   serialno    IS NOT NULL
    ) ;
    

    What happens when try you it?

    A query can start with the keyword WITH.
    A DELETE statement cannot.
    You can do soemthing like this:

    DELETE  serial_no
    WHERE     serialno   NOT IN  (
                                 WITH    union_data   AS
                          (
                              SELECT  serialno   FROM  cob_t_serial_no   UNION
                           SELECT  serialno   FROM  genealogy            UNION ...
                          )
                                 SELECT  serialno
                                  FROM    union_data
                                  WHERE   serialno    IS NOT NULL
                               ) ;
    

    Published by: Frank Kulash, November 12, 2012 16:22

  • XML query returns empty when tags no data

    Hi all

    I have a problem that I can't solve.

    I have the following query:
     select
                xmlelement
                (
                   "users",
                   xmlagg
                   (
                      xmlelement
                      (
                         "user",
                         xmlelement
                         (
                            "username",
                            e.pin
                         ),
                         xmlagg
                         (
                            xmlelement
                            (
                               "details",
                               xmlforest
                               (
                                  e.password as "password"
                                 ,e.first_name as "forename"
                                 ,e.surname as "surname"
                                 ,'0' as "retired"
                                 ,e.email_address as "email"
                                 ,e.telephone_number as "phone"
                                 ,'No External Ref' as "externalRef"
                                 ,add_months(sysdate,+60) as "expiryDate"
                               )
                            )
                         )
                      )
                   )
                ) xml_out
             from   aqaost_examiners e
             group by e.pin;
    The query returns the XML code in the desired structure.

    But the problem I have is that when there is no data found by the query, I always get a single row returned by the following: < user > < / users >

    I tried so many things to try to have the query return nothing if there is no data available, but I can't do without something else goes wrong (to mess up the XML structure, etc.).

    Please is - can anyone help or point me in the right direction?

    I thank very you much in advance!

    Robin

    Hello

    Peter,

    This is the GROUP that does this.

    Actually no, the GROUP BY refers to the deepest XMLAgg and is required if e.pin is not unique.

    Let it out, and you also seem to have of many XMLAGG (?)

    That's assuming that e.pin is unique within the table (which is probably a fair assumption in this case).

    In fact, the behavior comes from the XMLAgg in the foreground:

    SQL> select xmlelement("users",
      2           xmlagg(
      3             xmlelement("user",
      4               xmlelement("username", e.empno)
      5             , xmlelement("details",
      6                 xmlforest(
      7                   e.ename as "name"
      8                 , e.job as "job"
      9                 )
     10               )
     11             )
     12           )
     13         ) xml_out
     14  from scott.emp e
     15  where 1 = 0
     16  ;
    
    XML_OUT
    -------------------------------------
    
     
    

    As with other global functions (such as SUM or AVG) adding a GROUP OF 'something' solves the problem:

    SQL> select xmlelement("users",
      2           xmlagg(
      3             xmlelement("user",
      4               xmlelement("username", e.empno)
      5             , xmlelement("details",
      6                 xmlforest(
      7                   e.ename as "name"
      8                 , e.job as "job"
      9                 )
     10               )
     11             )
     12           )
     13         ) xml_out
     14  from scott.emp e
     15  where 1 = 0
     16  group by null
     17  ;
    
    no rows selected
    

    Robin,
    So the more intimate XMLAgg is really necessary, you can use a subquery:

    select xmlelement("users", v.users)
    from (
      select xmlagg(
               xmlelement("user",
                 xmlelement("username", e.empno)
               , xmlagg(
                   xmlelement("details",
                     xmlforest(
                       e.ename as "name"
                     , e.job as "job"
                     )
                   )
                 )
               )
             ) as users
      from scott.emp e
      group by e.empno
    ) v
    where v.users is not null
    ;
    
  • XML Query, returning null - matter of possible namespaces

    I have the following XML
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body>
          <CodesByTypeResponse xmlns="urn: WA.Ecy.ADS.CombinedCode.Services">
             <CodeList xmlns:a="http://schemas.datacontract.org/2004/07/WA.Ecy.ADS.CombinedCode.Service.DataAccess" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>116</a:CombinedCodeId>
                   <a:CombinedCodeValue>01</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>ADAMS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>117</a:CombinedCodeId>
                   <a:CombinedCodeValue>02</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>ASOTIN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>118</a:CombinedCodeId>
                   <a:CombinedCodeValue>03</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>BENTON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>119</a:CombinedCodeId>
                   <a:CombinedCodeValue>04</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>CHELAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>120</a:CombinedCodeId>
                   <a:CombinedCodeValue>05</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>CLALLAM</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>121</a:CombinedCodeId>
                   <a:CombinedCodeValue>06</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>CLARK</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>122</a:CombinedCodeId>
                   <a:CombinedCodeValue>07</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>COLUMBIA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>123</a:CombinedCodeId>
                   <a:CombinedCodeValue>08</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>COWLITZ</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>124</a:CombinedCodeId>
                   <a:CombinedCodeValue>09</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>DOUGLAS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>125</a:CombinedCodeId>
                   <a:CombinedCodeValue>10</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>FERRY</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>126</a:CombinedCodeId>
                   <a:CombinedCodeValue>11</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>FRANKLIN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>127</a:CombinedCodeId>
                   <a:CombinedCodeValue>12</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>GARFIELD</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>128</a:CombinedCodeId>
                   <a:CombinedCodeValue>13</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>GRANT</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>129</a:CombinedCodeId>
                   <a:CombinedCodeValue>14</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>GRAYS HARBOR</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>130</a:CombinedCodeId>
                   <a:CombinedCodeValue>15</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>ISLAND</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>131</a:CombinedCodeId>
                   <a:CombinedCodeValue>16</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>JEFFERSON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>132</a:CombinedCodeId>
                   <a:CombinedCodeValue>17</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KING</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>133</a:CombinedCodeId>
                   <a:CombinedCodeValue>18</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KITSAP</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>134</a:CombinedCodeId>
                   <a:CombinedCodeValue>19</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KITTITAS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>135</a:CombinedCodeId>
                   <a:CombinedCodeValue>20</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KLICKITAT</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>136</a:CombinedCodeId>
                   <a:CombinedCodeValue>21</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>LEWIS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>137</a:CombinedCodeId>
                   <a:CombinedCodeValue>22</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>LINCOLN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>138</a:CombinedCodeId>
                   <a:CombinedCodeValue>23</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>MASON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>139</a:CombinedCodeId>
                   <a:CombinedCodeValue>24</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>OKANOGAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>140</a:CombinedCodeId>
                   <a:CombinedCodeValue>25</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>PACIFIC</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>141</a:CombinedCodeId>
                   <a:CombinedCodeValue>26</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>PEND OREILLE</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>142</a:CombinedCodeId>
                   <a:CombinedCodeValue>27</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>PIERCE</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>143</a:CombinedCodeId>
                   <a:CombinedCodeValue>28</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SAN JUAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>144</a:CombinedCodeId>
                   <a:CombinedCodeValue>29</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SKAGIT</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>145</a:CombinedCodeId>
                   <a:CombinedCodeValue>30</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SKAMANIA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>146</a:CombinedCodeId>
                   <a:CombinedCodeValue>31</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SNOHOMISH</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>147</a:CombinedCodeId>
                   <a:CombinedCodeValue>32</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SPOKANE</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>148</a:CombinedCodeId>
                   <a:CombinedCodeValue>33</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>STEVENS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>149</a:CombinedCodeId>
                   <a:CombinedCodeValue>34</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>THURSTON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>150</a:CombinedCodeId>
                   <a:CombinedCodeValue>35</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WAHKIAKUM</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>151</a:CombinedCodeId>
                   <a:CombinedCodeValue>36</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WALLA WALLA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>152</a:CombinedCodeId>
                   <a:CombinedCodeValue>37</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WHATCOM</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>153</a:CombinedCodeId>
                   <a:CombinedCodeValue>38</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WHITMAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>154</a:CombinedCodeId>
                   <a:CombinedCodeValue>39</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>YAKIMA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
             </CodeList>
          </CodesByTypeResponse>
       </s:Body>
    </s:Envelope>
    I'm recovering the value of Code and Description.

    I am using the following query - where the get_combined_Code function returns the above XML code
    select x.*
    from (
    select facsite_pkg.get_combined_code('county') xml from dual) t, 
    xmltable(xmlnamespaces('a' as "a"),
    '//a:CombinedCodeEntity' passing t.xml.extract('//a:CombinedCodeEntity',
      'xmlns:a="http://schemas.datacontract.org/2004/07/WA.Ecy.ADS.CombinedCode.Service.DataAccess" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"')
    columns code_id varchar2(10) path 'a:CombinedCodeValue',
    code_description varchar2(100) path 'a:CombinedCodeDescription') x
    This query returns no records.

    I first tried this without the namespace clause, but this failed with the error: ORA-19228: XPST0008 - undeclared identifier: 'a' local-name of the prefix ' a: CombinedCodeEntity'

    I also tried to make the namespace clause
     xmlnamespaces('urn:WA.Ecy.ADS.CombinedCode.Services' as "a") 
    but the end result is the same.

    Any thoughts on where things have gone wrong?

    Thank you, Tony

    use:

    xmlnamespaces('http://schemas.xmlsoap.org/soap/envelope' as "s",
                           'http://schemas.datacontract.org/2004/07/WA.Ecy.ADS.CombinedCode.Service.DataAccess' as "a")
    

    Amiel

  • subquery returns no row in the main query, but hard returns the value of the master query

    Oracle 11g, Solaris SPARC 64-bit:

    This is the master query: its not to return all the lines

    Select count (*) in the sadmin.usr_mods where to_char (ts_id) in ((select to_char (rtrim (ltrim(TS_MODULES,','), ',')) in the sadmin.usr_rfc where TS_KINTANA_PACKAGE_NUMBER = '123' and ts_projectid = 3));

    COUNT (*)

    ----------

    0

    But wherever if I use subquery only returns he lines:

    SQL > select rtrim (ltrim(TS_MODULES,','), ',') from the sadmin.usr_rfc where TS_KINTANA_PACKAGE_NUMBER = '123' and ts_projectid = 3;

    RTRIM (LTRIM(TS_MODULES,','), ',')

    --------------------------------------------------------------------------------

    49,54

    If I use these values as hardcoded to a select master it will return 2 rows:

    SQL > select count (*) in the sadmin.usr_mods where to_char (ts_id) in ('49 ', ' 54');

    COUNT (*)

    ----------

    2

    TS_MODULES datatype is CLOB

    TS_ID datatype is set to number

    Help, please

    with

    usr_rfc as

    (select 3 ts_projectid, 123 ts_kintana_package_number, to_clob(',49,54,') ts_modules

    of the double

    ),

    usr_mods as

    (select ts_id 49 Union double all the)

    Select 50 in all double union

    Select double 54

    )

    Select count (*)

    of usr_mods

    where to_char (ts_id) in (select regexp_substr (to_char (rtrim (ltrim(TS_MODULES,','), ',')),'[^,] +', 1, level))

    of usr_rfc

    where TS_KINTANA_PACKAGE_NUMBER = '123'

    and ts_projectid = 3

    connect by level<= regexp_count(to_char(rtrim(ltrim(ts_modules,','),',')),',')="" +="">

    )

    COUNT (*)
    2

    Concerning

    Etbin

    Select count (*)

    of usr_mods

    where instr ((select ',' | to_char (rtrim (ltrim(TS_MODULES,','), ',')) |)) ','

    of usr_rfc

    where TS_KINTANA_PACKAGE_NUMBER = '123'

    and ts_projectid = 3

    ),

    ',' || TO_CHAR (TS_ID) | ','

    ) > 0

Maybe you are looking for