Select problem from view.

Hi everyone,
<br><br>
I have constructed the following view,
<br><br>
SELECT b.eml_id
     , a.email "FROM"    
     , to_address.name
     , to_address.role
     , to_address.email "TO"
     , to_address.subject
     , to_address.header
     , to_address.footer   
  FROM mySchema.sct_parties a    
     , mySchema.sct_email_notify b
     , mySchema.sct_assign_email_notify c
     , (SELECT e.eml_id
             , c.name "ROLE"
             , initcap(a.first || ' ' || a.last) "NAME"            
             , a.email
             , e.subject
             , e.header
             , e.footer
          FROM mySchema.sct_parties a
             , mySchema.sct_assign_roles b
             , mySchema.sct_roles c
             , mySchema.sct_assign_email_notify d
             , mySchema.sct_email_notify e
         WHERE a.par_id = b.par_id
           AND b.rle_id = c.rle_id
           AND c.rle_id = d.rle_id
           AND d.eml_id = e.eml_id
           AND d.rle_id = 6
           AND e.status = 'CURRENT') to_address
WHERE a.par_id = b.par_id
   AND to_address.eml_id = b.eml_id
   AND b.eml_id = 1
   AND b.status = 'CURRENT'When I do a
<br><br>
select * from viewName
<br><br>
no worries I get the record returned as expected, but when I
<br><br>
select a.to from viewName a I get the following error
<br><br>
Error starting at line 1 in command:
SELECT a.to
  FROM mySchema.viewName a
Error at Command Line:1 Column:9
Error report:
SQL Error: ORA-01747: invalid user.table.column, table.column, or column specification
01747. 00000 -  "invalid user.table.column, table.column, or column specification"
*Cause:   
*Action:<br><br>
Could someone tell me what the problem is.
<br><br>
Ben

Double quotes may be confusing if the case is not consistent. Also, Oracle will use upper case in the data dictionary, by default, unless you use double quotes.
SQL> create table t("col1" number, col2 number)
Table created.
SQL> insert into t(col1) values (1)
ORA-00904: "COL1": invalid identifier
SQL> insert into t(col2) values (2)
1 row created.
SQL> select col1 from t
ORA-00904: "COL1": invalid identifier
SQL> select col2 from t
      COL2
         2
1 row selected.
SQL> select column_name from user_tab_columns
where table_name = 'T'
and column_name like 'COL%'
COLUMN_NAME                  
COL2                         
1 row selected.

Similar Messages

  • Select data from  view ( V_T856 ).

    Hi All,
    i need to download transaction type and text from V_T856 ,  but the data is not selected from V_T856 view.
    how to select data from a view, is there any special conditions.
    i declared V_T856 in tables statement, even though select statement not exicuted.
    pls suggest me with relevant information..
    thank you
    Regards
    Ramesh.

    hi ramesh,
    using Select statement you cannot retrieve the data from view.
    use the FM - VIEW_GET_DATA.
    call function 'VIEW_GET_DATA'      " func. mod to get data from maintenance view.
        exporting
          view_name = view
        tables
          data      = gt_data.
    Regards,
    Sakthi.

  • Select time from view

    i have a doubt as will a select based on a view will take more time than a select on 2 tables with a union.
    View will be:-
    create view1 as
    select column1 from table1
    union
    select column1 from table2
    so, will a
    select * from view1
    take more time than a
    select column1 from table1
    union
    select column1 from table2
    Please help in solving the doubt as it is urgent.
    regards.

    If it's that urgent why didn't you just rustle up a test case for yourself? You could have done that in the time it took you to post, let alone wait for my slow fingers to type one up and compose this reply. We are all volunteers here and there's no SLA.
    Here is a test case. Obviously the stats are different, that's because of the data in the buffer cache, but the EXPLAIN PLAN is identical (except for the VIEW bit), so the two queries should execute in a similar timeframe.
    Cheers, APC
    SQL> SET autotrace TRACEONLY
    SQL> SELECT col1 FROM t_10K
      2  UNION
      3  SELECT col1 FROM t_5k1
      4  /
    10000 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=43 Card=15000 Bytes=
              60000)
       1    0   SORT (UNIQUE) (Cost=43 Card=15000 Bytes=60000)
       2    1     UNION-ALL
       3    2       INDEX (FAST FULL SCAN) OF 'T10K_PK' (UNIQUE) (Cost=3 C
              ard=10000 Bytes=40000)
       4    2       TABLE ACCESS (FULL) OF 'T_5K1' (Cost=3 Card=5000 Bytes
              =20000)
    Statistics
            750  recursive calls
              0  db block gets
            213  consistent gets
             71  physical reads
              0  redo size
         132870  bytes sent via SQL*Net to client
           7825  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
             16  sorts (memory)
              0  sorts (disk)
          10000  rows processed
    SQL> CREATE VIEW v1 AS
      2  SELECT col1 FROM t_10K
      3  UNION
      4  SELECT col1 FROM t_5k1
      5  /
    View created.
    SQL> SELECT * FROM v1
      2  /
    10000 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=43 Card=15000 Bytes=
              195000)
       1    0   VIEW OF 'V1' (Cost=43 Card=15000 Bytes=195000)
       2    1     SORT (UNIQUE) (Cost=43 Card=15000 Bytes=60000)
       3    2       UNION-ALL
       4    3         INDEX (FAST FULL SCAN) OF 'T10K_PK' (UNIQUE) (Cost=3
               Card=10000 Bytes=40000)
       5    3         TABLE ACCESS (FULL) OF 'T_5K1' (Cost=3 Card=5000 Byt
              es=20000)
    Statistics
             19  recursive calls
              0  db block gets
             54  consistent gets
              0  physical reads
              0  redo size
         132870  bytes sent via SQL*Net to client
           7825  bytes received via SQL*Net from client
            668  SQL*Net roundtrips to/from client
              3  sorts (memory)
              0  sorts (disk)
          10000  rows processed
    SQL>

  • How to select data from view V_TCURR

    Hi all,
    how to fetch data from view V_TCURR.
    I have to fetch 2 fieds:   kursp  and   *tfact
    (what does this * indicates in field name   *tfact)

    The view is a maintenance view and it doesn't even have field tfact available.
    Just select from the table directly
    PARAMETERS: p_kursp for tcurr-kurst,
                p_fcurr for tcurr-fcurr,
                p_tcurr for tcurr-tcurr,
                p_date  for tcurr-gdate.
    SELECT SINGLE
           kursp
           tfact
           INTO ( lv_kursp, lv_tfact )
           FROM tcurr
           WHERE kurst eq p_kurst
           AND   fcurr  eq p_fcurr
           AND   tcurr  eq p_tcurr
           AND   gdatu le p_date. 
    Hope that helps,
    Michael

  • ORA-01446 when selecting ROWID from View with Union

    I have a View that uses a Union to select from 3 tables. I would like the View to return the ROWID for the record that is returned so that I can update it in my form. The View compiles fine but when I select from the View I get ORA-01446 error.
    Example of my view:
    SELECT ROWID, col_a, col_b, col_c
    FROM tab_a
    UNION ALL
    SELECT ROWID, col_a, col_b, col_c
    FROM tab_b
    UNION ALL
    SELECT ROWID, col_a, col_b, col_c
    FROM tab_c
    I need the ROWID because my tables do not contain UNIQUE/PRIMARY key constraints. In my form I want to update the view with an underlying INSTEAD OF database trigger.
    Any suggestions?

    I think it will work if you give the column an alias (ie a name after the first rowid) and select that instead.
    You will probably also need another column in your view indicating which table the row came from if you want to update it.

  • ORA-01446: cannot select ROWID from view with DISTINCT, GROUP BY, etc.

    Hi,
    I have created view by joining two tables...And it is like this...
    Create view Test_Data as
    Select t.column1, t.column2, t.rowid from table1 t
    union s.column1,s.column2, s.rowid from table2 s
    with read only...
    Now I executed the following stmt...
    Select * from Test_Data where rowid = objid_ where I am passing the objid_ value...But it gave me the above error...can not I run this select stmt using the rowid ?
    Any input is highly appreciated...
    Thanks And Best Regards,
    /Dinesh...
    Hi All Again,
    I created the view in the following way...Just to check...
    CREATE VIEW my_view AS
    SELECT t.col1 col1,
    t.col2 col2,
    t.rowid objid
    FROM table1 t
    WHERE rownum < 400
    UNION
    SELECT q.col1 col1,
    q.col2 col2,
    q.rowid objid
    FROM table2 q
    WITH read only;
    Then I executed the following stmt...
    Select * from my_view where rowid = objid_
    Then I did not get that Oracle Error ORA-01446, Does anybody have any clue regarding this matter, i.e. how the use of rownum solve this prob...
    Thanks And Best Regards,
    /Dinesh...
    Edited by: user521478 on Aug 9, 2010 4:46 PM

    Check this:
    SQL> create view my_view as select rowid rd from dual;
    View created.
    SQL> select * from my_view;
    RD
    AAAACsAABAAAAGiAAA
    SQL> select * from my_view where rd = 'AAAACsAABAAAAGiAAA';
    RD
    AAAACsAABAAAAGiAAA
    SQL> So your create view statement should be:
    Create view Test_Data as
    Select t.column1, t.column2, t.rowid rd from table1 t
    union s.column1,s.column2, s.rowid from table2 s
    with read onlyThen try:
    Select * from Test_Data where rd = objid;Edited by: AP on Jul 28, 2010 2:19 AM

  • End of communication channel when select from view

    We are using DB 10.0.2.0.2 and when we run select statement from view it gives End of communication channel error but when we run the query by using the sql in the view it works fine.
    Please advise what may be wrong.

    Like other poster suggested, please post some sample code, query your used to build the view (you can scramble the real table/column name as your wish) and the actual screen capture of the error.
    This will help others to help you. Right now you are only describing symptoms while no one has idea what it really is.

  • Using Lightroom 5.7, Raw files become from my Nikon D810 become corrupted when I select them to view or edit.

    .Updated to Lightroom 5.7 to accommodate the Nikon D810. Upon importing RAW files to the files become corrupted when they are selected to be viewed or edited.
    I am using Windows 7, 64 bit, with 8 GB Ram.
    Any help would be appreciated.

    There are several likely sources of corruption, and video card would be far down on my list of possible suspects.
    The transfer from camera card to hard disk is the most likely place for problem, either the card reader or USB cable can go bad. Another likely source of problems is the computer's hard disk is starting to fail. The camera card itself may be bad. And lastly, the memory in the computer may be malfunctioning.

  • Problem using existsnode from view

    I am having a problem using existsnode from a view. I am currently using 10.2.0.3
    example
    CREATE OR REPLACE VIEW XML_PERSON_ASSOCIATION
    (PERSON)
    AS
    select
    xmlelement("Person",
        xmlforest(
            extractvalue(value(p),'/Person/PersonID') "PersonID",
            extractvalue(value(p),'/Person/Prefix') "Prefix",
            extractvalue(value(p),'/Person/FirstName') "FirstName",
            extractvalue(value(p),'/Person/MiddleName') "MiddleName",
            extractvalue(value(p),'/Person/LastName') "LastName",
            extractvalue(value(p),'/Person/Suffix') "Suffix",
            extractvalue(value(p),'/Person/PreferredName') "PreferredName",
            extractvalue(value(p),'/Person/Gender') "Gender",
            extractvalue(value(p),'/Person/PrimaryLanguage') "PrimaryLanguage",
            extractvalue(value(p),'/Person/RecordStatus') "RecordStatus",
            extractvalue(value(p),'/Person/ImportedDate') "ImportedDate",
            (select
                xmlagg(
                    xmlelement("Association",
                        xmlforest(
                            extractvalue(value(oa),'/OrganizationPersonAssoc/Name') "Name",
                            extractvalue(value(ot),'/OrganizationType/OrganizationID') "OrganizationID",
                            extractvalue(value(ot),'/OrganizationType/Type') "OrganizationType",
                            extractvalue(value(a),'/Association/Role') "Role",                        
                            extractvalue(value(a),'/Association/RecordStatus') "RecordStatus",
                            extractvalue(value(oa),'/OrganizationPersonAssoc/ImportedDate') "ImportedDate"                                                
                        xmlelement("PersonTypes",
                            extract(value(per),'/Person/PersonTypes/PersonType')
                        xmlelement("Addresses",
                            extract(value(a),'/Association/Addresses/Address')
                        xmlelement("ContactMechanisms",
                            extract(value(a),'/Association/ContactMechanisms/ContactMechanism')
            from org_person_assoc oa,
            table(xmlsequence(extract(value(oa),'/OrganizationPersonAssoc/OrganizationTypes/OrganizationType'))) ot,
            table(xmlsequence(extract(value(ot),'/OrganizationType/Associations/Association'))) a,
            table(xmlsequence(extract(value(a),'/Association/Persons/Person'))) per
            where extractvalue(value(per),'/Person/PersonID') = extractvalue(value(p),'/Person/PersonID')        
            ) "Associations"
    ) person
    from person p
    /When I run the following statment
    select person
    from xml_person_association o
    where existsnode(person,'/Person/Associations/Association[OrganizationID=30097]')=1;
    I get no records returned. Now if I used the extract function and use the same path that's in the existsnode clause I get a record returned.
    select extract(person,'/Person/Associations/Association')
    from xml_person_association o
    where existsnode(person,'/Person/Associations/Association[OrganizationID=30097]')=1;
    <Association>
    <Name>TEST DATA</Name>
    <OrganizationID>30097</OrganizationID>
    </Association>
    If I run the same style of existsnode statment against a table directly instead of a view I am not required to use an extract caluse that has the same path that is used in the existsnode clause.
    Thanks for the help.
    Message was edited by:
    mdrake

    Testing in 11g I get
    SQL>
    SQL>
    SQL> set echo on
    SQL> spool testcase.log
    SQL> --
    SQL> connect sys/ as sysdba
    Enter password:
    Connected.
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> define USERNAME = XDBTEST
    SQL> --
    SQL> def PASSWORD = XDBTEST
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user XDBTEST cascade
    User dropped.
    Elapsed: 00:00:09.42
    SQL> grant connect, resource to &USERNAME identified by &PASSWORD
      2  /
    old   1: grant connect, resource to &USERNAME identified by &PASSWORD
    new   1: grant connect, resource to XDBTEST identified by XDBTEST
    Grant succeeded.
    Elapsed: 00:00:00.03
    SQL> grant create any directory, drop any directory to &USERNAME
      2  /
    old   1: grant create any directory, drop any directory to &USERNAME
    new   1: grant create any directory, drop any directory to XDBTEST
    Grant succeeded.
    Elapsed: 00:00:00.00
    SQL> grant alter session, create view to &USERNAME
      2  /
    old   1: grant alter session, create view to &USERNAME
    new   1: grant alter session, create view to XDBTEST
    Grant succeeded.
    Elapsed: 00:00:00.00
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
    new   1: alter user XDBTEST default tablespace USERS temporary tablespace TEMP
    User altered.
    Elapsed: 00:00:00.00
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> alter session set events ='19027 trace name context forever, level 0x800'
      2  /
    Session altered.
    Elapsed: 00:00:00.00
    SQL> var xmlText1 clob
    SQL> var xmlText2 clob
    SQL> var xmlSchema clob
    SQL> var schemaURL varchar2(256)
    SQL> --
    SQL> begin
      2    :schemaURL := 'mcs.xsd';
      3    :xmlSchema :=
      4  '<!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by Shaun (PPD Inc) --> <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xdb=
    "http://xmlns.oracle.com/xdb" elementFormDefault="qualified" xdb:storeVarrayAsTable="true">
      5     <s:element name="Organization" type="Organization" xdb:defaultTable="ORG"/>
      6     <s:element name="Person" type="Person" xdb:defaultTable="PERSON"/>
      7     <s:element name="OrganizationPersonAssoc" type="Organization" xdb:defaultTable="ORG_PERSON_ASSOC"/>
      8     <s:complexType name="Organization" xdb:SQLType="Organization">
      9             <s:sequence minOccurs="0">
    10                     <s:element name="Name" type="s:string" nillable="true"/>
    11                     <s:element name="LongName" type="s:string" nillable="true"/>
    12                     <s:element name="Description" type="s:string" nillable="true"/>
    13                     <s:element name="FWANumber" type="s:string" nillable="true"/>
    14                     <s:element name="GUID" type="s:string" nillable="true"/>
    15                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    16                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    17                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    18                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    19                     <s:element name="OrganizationTypes" type="ArrayOfOrganizationType" minOccurs="0"/>
    20                     <s:element name="OrganizationSynonyms" type="ArrayOfOrganizationSynonym"/>
    21                     <s:element name="ImportedDate" type="s:date"/>
    22             </s:sequence>
    23     </s:complexType>
    24     <s:complexType name="ArrayOfOrganizationType" xdb:SQLType="ArrayOfOrganizationType">
    25             <s:sequence minOccurs="0">
    26                     <s:element name="OrganizationType" type="OrganizationType" minOccurs="0" maxOccurs="unbounded"/>
    27             </s:sequence>
    28     </s:complexType>
    29     <s:complexType name="OrganizationType" xdb:SQLType="OrganizationType">
    30             <s:sequence minOccurs="0">
    31                     <s:element name="OrganizationID" type="s:string"/>
    32                     <s:element name="Type" type="s:string" nillable="true"/>
    33                     <s:element name="QCDoneStatus" type="s:string" nillable="true"/>
    34                     <s:element name="QCDoneStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    35                     <s:element name="SiteEstablishmentStatus" type="s:string" nillable="true"/>
    36                     <s:element name="SiteEstablishmentStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    37                     <s:element name="IPFNumber" type="s:int"/>
    38                     <s:element name="DUNSNumber" type="s:int"/>
    39                     <s:element name="GUID" type="s:string" nillable="true"/>
    40                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    41                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    42                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    43                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    44                     <s:element name="LegacyCodes" type="ArrayOfLegacyCode" minOccurs="0"/>
    45                     <s:element name="Addresses" type="ArrayOfAddress" minOccurs="0"/>
    46                     <s:element name="ContactMechanisms" type="ArrayOfContactMechanism" minOccurs="0"/>
    47                     <s:element name="Associations" type="ArrayOfAssociation" minOccurs="0"/>
    48             </s:sequence>
    49     </s:complexType>
    50     <s:complexType name="ArrayOfLegacyCode" xdb:SQLType="ArrayOfLegacyCode">
    51             <s:sequence minOccurs="0">
    52                     <s:element name="LegacyCode" type="LegacyCode" minOccurs="0" maxOccurs="unbounded"/>
    53             </s:sequence>
    54     </s:complexType>
    55     <s:complexType name="LegacyCode" xdb:SQLType="LegacyCode">
    56             <s:sequence minOccurs="0">
    57                     <s:element name="Code" type="s:string" nillable="true"/>
    58                     <s:element name="NetworkID" type="s:string"/>
    59                     <s:element name="GUID" type="s:string" nillable="true"/>
    60                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    61                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    62                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    63                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    64             </s:sequence>
    65     </s:complexType>
    66     <s:complexType name="ArrayOfAddress" xdb:SQLType="ArrayOfAddress">
    67             <s:sequence minOccurs="0">
    68                     <s:element name="Address" type="Address" minOccurs="0" maxOccurs="unbounded"/>
    69             </s:sequence>
    70     </s:complexType>
    71     <s:complexType name="Address" xdb:SQLType="Address">
    72             <s:sequence minOccurs="0">
    73                     <s:element name="StreetName1" type="s:string" nillable="true"/>
    74                     <s:element name="StreetName2" type="s:string" nillable="true"/>
    75                     <s:element name="StreetName3" type="s:string" nillable="true"/>
    76                     <s:element name="StreetName4" type="s:string" nillable="true"/>
    77                     <s:element name="CityName" type="s:string" nillable="true"/>
    78                     <s:element name="CityGUID" type="s:string" nillable="true"/>
    79                     <s:element name="CityCreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    80                     <s:element name="CityLastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    81                     <s:element name="CityRecordStatus" type="s:string" nillable="true"/>
    82                     <s:element name="CityRecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    83                     <s:element name="StateName" type="s:string" nillable="true"/>
    84                     <s:element name="StateGUID" type="s:string" nillable="true"/>
    85                     <s:element name="StateCreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    86                     <s:element name="StateLastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    87                     <s:element name="StateRecordStatus" type="s:string" nillable="true"/>
    88                     <s:element name="StateRecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    89                     <s:element name="CountryName" type="s:string" nillable="true"/>
    90                     <s:element name="CountryCode" type="s:string" nillable="true"/>
    91                     <s:element name="CountryGUID" type="s:string" nillable="true"/>
    92                     <s:element name="CountryCreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    93                     <s:element name="CountryLastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    94                     <s:element name="CountryRecordStatus" type="s:string" nillable="true"/>
    95                     <s:element name="CountryRecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    96                     <s:element name="ZipPostalCode" type="s:string" nillable="true"/>
    97                     <s:element name="GUID" type="s:string" nillable="true"/>
    98                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    99                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    100                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    101                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    102                     <s:element name="Type" type="s:string" nillable="true"/>
    103                     <s:element name="TypeOtherSpecify" type="s:string" nillable="true"/>
    104                     <s:element name="InternalOffice" type="s:string" nillable="true"/>
    105                     <s:element name="MailStopCode" type="s:string" nillable="true"/>
    106                     <s:element name="PreferredFlag" type="s:string" nillable="true"/>
    107                     <s:element name="ActiveFromDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    108                     <s:element name="QCDoneStatus" type="s:string" nillable="true"/>
    109                     <s:element name="QCDoneStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    110             </s:sequence>
    111     </s:complexType>
    112     <s:complexType name="ArrayOfContactMechanism" xdb:SQLType="ArrayOfContactMechanism">
    113             <s:sequence minOccurs="0">
    114                     <s:element name="ContactMechanism" type="ContactMechanism" minOccurs="0" maxOccurs="unbounded"/>
    115             </s:sequence>
    116     </s:complexType>
    117     <s:complexType name="ContactMechanism" xdb:SQLType="ContactMechanism">
    118             <s:sequence minOccurs="0">
    119                     <s:element name="ContactType" type="s:string" nillable="true"/>
    120                     <s:element name="ContactTypeOtherSpecify" type="s:string" nillable="true"/>
    121                     <s:element name="ContactValue" type="s:string" nillable="true"/>
    122                     <s:element name="ContactAreaCode" type="s:string" nillable="true"/>
    123                     <s:element name="ContactCountryCallingCode" type="s:int"/>
    124                     <s:element name="ContactTollFreeFlag" type="s:string" nillable="true"/>
    125                     <s:element name="ContactGUID" type="s:string" nillable="true"/>
    126                     <s:element name="ContactCreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    127                     <s:element name="ContactLastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    128                     <s:element name="ContactRecordStatus" type="s:string" nillable="true"/>
    129                     <s:element name="ContactRecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    130                     <s:element name="Role" type="s:string" nillable="true"/>
    131                     <s:element name="PhoneExtension" type="s:string" nillable="true"/>
    132                     <s:element name="QCDoneStatus" type="s:string" nillable="true"/>
    133                     <s:element name="QCDoneStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    134                     <s:element name="ActiveFromDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    135                     <s:element name="GUID" type="s:string" nillable="true"/>
    136                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    137                     <s:element name="ModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    138                     <s:element name="PreferredFlag" type="s:string" nillable="true"/>
    139                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    140                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    141             </s:sequence>
    142     </s:complexType>
    143     <s:complexType name="ArrayOfAssociation" xdb:SQLType="ArrayOfAssociation">
    144             <s:sequence minOccurs="0">
    145                     <s:element name="Association" type="Association" minOccurs="0" maxOccurs="unbounded"/>
    146             </s:sequence>
    147     </s:complexType>
    148     <s:complexType name="Association" xdb:SQLType="Association">
    149             <s:sequence minOccurs="0">
    150                     <s:element name="Role" type="s:string" nillable="true"/>
    151                     <s:element name="GUID" type="s:string" nillable="true"/>
    152                     <s:element name="QCDoneStatus" type="s:string" nillable="true"/>
    153                     <s:element name="QCDoneStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    154                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    155                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    156                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    157                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    158                     <s:element name="Addresses" type="ArrayOfAddress" minOccurs="0"/>
    159                     <s:element name="ContactMechanisms" type="ArrayOfContactMechanism" minOccurs="0"/>
    160                     <s:element name="Persons" type="ArrayOfPerson" minOccurs="0"/>
    161             </s:sequence>
    162     </s:complexType>
    163     <s:complexType name="ArrayOfPerson" xdb:SQLType="ArrayOfPerson">
    164             <s:sequence minOccurs="0">
    165                     <s:element name="Person" type="Person" minOccurs="0" maxOccurs="unbounded"/>
    166             </s:sequence>
    167     </s:complexType>
    168     <s:complexType name="Person" xdb:SQLType="Person">
    169             <s:sequence minOccurs="0">
    170                     <s:element name="PersonID" type="s:int"/>
    171                     <s:element name="Prefix" type="s:string" nillable="true"/>
    172                     <s:element name="FirstName" type="s:string" nillable="true"/>
    173                     <s:element name="MiddleName" type="s:string" nillable="true"/>
    174                     <s:element name="LastName" type="s:string" nillable="true"/>
    175                     <s:element name="Suffix" type="s:string" nillable="true"/>
    176                     <s:element name="PreferredName" type="s:string" nillable="true"/>
    177                     <s:element name="Gender" type="s:string" nillable="true"/>
    178                     <s:element name="PrimaryLanguage" type="s:string" nillable="true"/>
    179                     <s:element name="GUID" type="s:string" nillable="true"/>
    180                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    181                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    182                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    183                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    184                     <s:element name="QCDoneStatus" type="s:string" nillable="true"/>
    185                     <s:element name="QCDoneStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    186                     <s:element name="PersonDegrees" type="ArrayOfPersonDegree" minOccurs="0"/>
    187                     <s:element name="PersonSpecialties" type="ArrayOfPersonSpecialty" minOccurs="0"/>
    188                     <s:element name="PersonTypes" type="ArrayOfPersonType" minOccurs="0"/>
    189                     <s:element name="Addresses" type="ArrayOfAddress" minOccurs="0"/>
    190                     <s:element name="ContactMechanisms" type="ArrayOfContactMechanism" minOccurs="0"/>
    191                     <s:element name="ImportedDate" type="s:date"/>
    192             </s:sequence>
    193     </s:complexType>
    194     <s:complexType name="ArrayOfPersonDegree" xdb:SQLType="ArrayOfPersonDegree">
    195             <s:sequence minOccurs="0">
    196                     <s:element name="PersonDegree" type="PersonDegree" minOccurs="0" maxOccurs="unbounded"/>
    197             </s:sequence>
    198     </s:complexType>
    199     <s:complexType name="PersonDegree" xdb:SQLType="PersonDegree">
    200             <s:sequence minOccurs="0">
    201                     <s:element name="Code" type="s:string" nillable="true"/>
    202                     <s:element name="Major" type="s:string" nillable="true"/>
    203                     <s:element name="ListingOrder" type="s:int"/>
    204                     <s:element name="GUID" type="s:string" nillable="true"/>
    205                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    206                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    207                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    208                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    209             </s:sequence>
    210     </s:complexType>
    211     <s:complexType name="ArrayOfPersonSpecialty" xdb:SQLType="ArrayOfPersonSpecialty">
    212             <s:sequence minOccurs="0">
    213                     <s:element name="PersonSpecialty" type="PersonSpecialty" minOccurs="0" maxOccurs="unbounded"/>
    214             </s:sequence>
    215     </s:complexType>
    216     <s:complexType name="PersonSpecialty" xdb:SQLType="PersonSpecialty">
    217             <s:sequence minOccurs="0">
    218                     <s:element name="Name" type="s:string" nillable="true"/>
    219                     <s:element name="GUID" type="s:string" nillable="true"/>
    220                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    221                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    222                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    223                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    224             </s:sequence>
    225     </s:complexType>
    226     <s:complexType name="ArrayOfPersonType" xdb:SQLType="ArrayOfPersonType">
    227             <s:sequence minOccurs="0">
    228                     <s:element name="PersonType" type="PersonType" minOccurs="0" maxOccurs="unbounded"/>
    229             </s:sequence>
    230     </s:complexType>
    231     <s:complexType name="PersonType" xdb:SQLType="PersonType">
    232             <s:sequence minOccurs="0">
    233                     <s:element name="Type" type="s:string" nillable="true"/>
    234                     <s:element name="GUID" type="s:string" nillable="true"/>
    235                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    236                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    237                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    238                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    239                     <s:element name="QCDoneStatus" type="s:string" nillable="true"/>
    240                     <s:element name="QCDoneStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    241             </s:sequence>
    242     </s:complexType>
    243     <s:complexType name="ArrayOfOrganizationSynonym" xdb:SQLType="ArrayOfOrganizationSynonym">
    244             <s:sequence minOccurs="0">
    245                     <s:element name="OrganizationSynonym" type="OrganizationSynonym" minOccurs="0" maxOccurs="unbounded"/>
    246             </s:sequence>
    247     </s:complexType>
    248     <s:complexType name="OrganizationSynonym" xdb:SQLType="OrganizationSynonym">
    249             <s:sequence minOccurs="0">
    250                     <s:element name="Name" type="s:string" nillable="true"/>
    251                     <s:element name="GUID" type="s:string" nillable="true"/>
    252                     <s:element name="CreatedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    253                     <s:element name="LastModifiedDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    254                     <s:element name="RecordStatus" type="s:string" nillable="true"/>
    255                     <s:element name="RecordStatusDate" type="s:dateTime" xdb:SQLType="TIMESTAMP(6) WITH TIME ZONE"/>
    256             </s:sequence>
    257     </s:complexType>
    258  </s:schema>';
    259    :xmltext1 :=
    260  '<?xml version="1.0" encoding="WINDOWS-1252"?> <Person xsi:noNamespaceSchemaLocation="mcs.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns
    :xsi="http://www.w3.org/2001/XMLSchema-instance">
    261    <PersonID>100448</PersonID>
    262    <Prefix/>
    263    <FirstName>John</FirstName>
    264    <MiddleName/>
    265    <LastName>Doe</LastName>
    266    <Suffix/>
    267    <PreferredName/>
    268    <Gender/>
    269    <PrimaryLanguage xsi:nil="true"/>
    270    <GUID>ffff-ffff-ffff</GUID>
    271    <RecordStatus>Active</RecordStatus>
    272    <RecordStatusDate>2007-04-29T00:11:50.750000-04:00</RecordStatusDate>
    273    <CreatedDate>2006-06-13T00:57:21.090000-04:00</CreatedDate>
    274    <LastModifiedDate>2007-04-29T00:11:50.770000-04:00</LastModifiedDate>
    275    <QCDoneStatus>Yes</QCDoneStatus>
    276    <QCDoneStatusDate>2006-06-13T00:57:22.977000-04:00</QCDoneStatusDate>
    277    <PersonDegrees>
    278      <PersonDegree>
    279        <Code>B.S.</Code>
    280        <Major xsi:nil="true"/>
    281        <ListingOrder>1</ListingOrder>
    282        <GUID>d01bbcfd-9d48-47bf-818d-9957b907a664</GUID>
    283        <RecordStatus>Active</RecordStatus>
    284        <RecordStatusDate>2006-10-05T10:48:04.430000-04:00</RecordStatusDate>
    285        <CreatedDate>2006-10-05T10:48:06.520000-04:00</CreatedDate>
    286        <LastModifiedDate>2006-10-05T10:48:06.520000-04:00</LastModifiedDate>
    287      </PersonDegree>
    288    </PersonDegrees>
    289    <PersonSpecialties/>
    290    <PersonTypes>
    291      <PersonType>
    292        <Type>Resource Personnel</Type>
    293        <GUID>3049ddcd-3590-4fd9-a534-e2cea5b82c09</GUID>
    294        <RecordStatus>Active</RecordStatus>
    295        <RecordStatusDate>2006-06-13T00:57:22.977000-04:00</RecordStatusDate>
    296        <CreatedDate>2006-06-13T00:57:21.090000-04:00</CreatedDate>
    297        <LastModifiedDate>2007-04-29T00:11:50.817000-04:00</LastModifiedDate>
    298        <QCDoneStatus>Yes</QCDoneStatus>
    299        <QCDoneStatusDate>2006-06-13T00:57:22.977000-04:00</QCDoneStatusDate>
    300      </PersonType>
    301    </PersonTypes>
    302    <Addresses/>
    303    <ContactMechanisms/>
    304    <ImportedDate>2007-04-30</ImportedDate>
    305  </Person>';
    306    :xmltext2 :=
    307  '<?xml version="1.0" encoding="WINDOWS-1252"?> <OrganizationPersonAssoc xsi:noNamespaceSchemaLocation="mcs.xsd" xmlns:xsd="http://www.w3.org/2001
    /XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    308    <Name>Org Name Office</Name>
    309    <LongName>Long Name</LongName>
    310    <Description xsi:nil="true"/>
    311    <FWANumber xsi:nil="true"/>
    312    <GUID>dddd-dddd</GUID>
    313    <CreatedDate>2006-05-18T18:59:01.500000-04:00</CreatedDate>
    314    <LastModifiedDate>2006-05-18T18:59:01.500000-04:00</LastModifiedDate>
    315    <RecordStatus>Active</RecordStatus>
    316    <RecordStatusDate>2006-05-18T18:59:01.500000-04:00</RecordStatusDate>
    317    <OrganizationTypes>
    318      <OrganizationType>
    319        <OrganizationID>30097</OrganizationID>
    320        <Type>Agency</Type>
    321        <QCDoneStatus>Yes</QCDoneStatus>
    322        <QCDoneStatusDate>2006-05-18T18:59:01.513000-04:00</QCDoneStatusDate>
    323        <SiteEstablishmentStatus xsi:nil="true"/>
    324        <SiteEstablishmentStatusDate>0001-01-01T00:00:00.000000-05:00</SiteEstablishmentStatusDate>
    325        <IPFNumber>0</IPFNumber>
    326        <DUNSNumber>0</DUNSNumber>
    327        <GUID>cfe9e9e0-68a3-45c9-81c0-74848523133b</GUID>
    328        <CreatedDate>2006-05-18T18:59:01.513000-04:00</CreatedDate>
    329        <LastModifiedDate>2006-05-18T18:59:01.513000-04:00</LastModifiedDate>
    330        <RecordStatus>Active</RecordStatus>
    331        <RecordStatusDate>2006-05-18T18:59:01.513000-04:00</RecordStatusDate>
    332        <Associations>
    333          <Association>
    334            <Role>Employee</Role>
    335            <GUID>9a9a9a-ababab</GUID>
    336            <QCDoneStatus>Yes</QCDoneStatus>
    337            <QCDoneStatusDate>2006-06-13T01:29:09.030000-04:00</QCDoneStatusDate>
    338            <CreatedDate>2006-06-13T01:29:09.030000-04:00</CreatedDate>
    339            <LastModifiedDate>2006-07-25T15:27:23.783000-04:00</LastModifiedDate>
    340            <RecordStatus>Active</RecordStatus>
    341            <RecordStatusDate>2006-06-13T01:29:09.030000-04:00</RecordStatusDate>
    342            <Addresses>
    343              <Address>
    344                <StreetName1>123 Front St.</StreetName1>
    345                <StreetName2 xsi:nil="true"/>
    346                <StreetName3 xsi:nil="true"/>
    347                <StreetName4 xsi:nil="true"/>
    348                <CityName>City</CityName>
    349                <CityGUID>234234</CityGUID>
    350                <CityCreatedDate>2006-05-08T20:06:45.143000-04:00</CityCreatedDate>
    351                <CityLastModifiedDate>2006-05-08T20:06:45.143000-04:00</CityLastModifiedDate>
    352                <CityRecordStatus>Active</CityRecordStatus>
    353                <CityRecordStatusDate>2006-05-08T20:06:45.143000-04:00</CityRecordStatusDate>
    354                <StateName>New York</StateName>
    355                <StateGUID>9fd469e1-4d4a-4f38-9def-50038e5ecca2</StateGUID>
    356                <StateCreatedDate>2006-04-22T16:09:35.830000-04:00</StateCreatedDate>
    357                <StateLastModifiedDate>2006-04-22T16:09:35.830000-04:00</StateLastModifiedDate>
    358                <StateRecordStatus>Active</StateRecordStatus>
    359                <StateRecordStatusDate>2006-04-22T16:09:35.830000-04:00</StateRecordStatusDate>
    360                <CountryName>United States</CountryName>
    361                <CountryCode>USA</CountryCode>
    362                <CountryGUID>532d35dd-3a49-408a-a416-20c41e9c7997</CountryGUID>
    363                <CountryCreatedDate>2006-04-22T15:30:47.000000-04:00</CountryCreatedDate>
    364                <CountryLastModifiedDate>2006-04-22T15:30:47.000000-04:00</CountryLastModifiedDate>
    365                <CountryRecordStatus>Active</CountryRecordStatus>
    366                <CountryRecordStatusDate>2006-04-22T15:30:47.000000-04:00</CountryRecordStatusDate>
    367                <ZipPostalCode>12345</ZipPostalCode>
    368                <GUID>b2414fa9-7375-4d26-8d76-89a6915d6751</GUID>
    369                <CreatedDate>2006-06-13T01:29:09.030000-04:00</CreatedDate>
    370                <LastModifiedDate>2006-07-29T23:45:17.670000-04:00</LastModifiedDate>
    371                <RecordStatus>Active</RecordStatus>
    372                <RecordStatusDate>2006-06-13T01:29:09.030000-04:00</RecordStatusDate>
    373                <Type>Office</Type>
    374                <TypeOtherSpecify/>
    375                <InternalOffice></InternalOffice>
    376                <MailStopCode/>
    377                <PreferredFlag>Yes</PreferredFlag>
    378                <ActiveFromDate>2006-06-13T01:29:09.000000-04:00</ActiveFromDate>
    379                <QCDoneStatus>Yes</QCDoneStatus>
    380                <QCDoneStatusDate>2006-06-13T01:29:09.030000-04:00</QCDoneStatusDate>
    381              </Address>
    382            </Addresses>
    383            <ContactMechanisms>
    384              <ContactMechanism>
    385                <ContactType>Phone</ContactType>
    386                <ContactTypeOtherSpecify xsi:nil="true"/>
    387                <ContactValue>555-5555</ContactValue>
    388                <ContactAreaCode>555</ContactAreaCode>
    389                <ContactCountryCallingCode>1</ContactCountryCallingCode>
    390                <ContactTollFreeFlag xsi:nil="true"/>
    391                <ContactGUID>123</ContactGUID>
    392                <ContactCreatedDate>2006-06-13T01:29:09.047000-04:00</ContactCreatedDate>
    393                <ContactLastModifiedDate>2007-02-23T16:36:10.260000-05:00</ContactLastModifiedDate>
    394                <ContactRecordStatus>Active</ContactRecordStatus>
    395                <ContactRecordStatusDate>2006-06-13T01:29:09.047000-04:00</ContactRecordStatusDate>
    396                <Role>Business</Role>
    397                <PhoneExtension/>
    398                <QCDoneStatus>Yes</QCDoneStatus>
    399                <QCDoneStatusDate>2006-06-13T01:29:09.047000-04:00</QCDoneStatusDate>
    400                <ActiveFromDate>2006-06-13T01:29:09.000000-04:00</ActiveFromDate>
    401                <GUID>321</GUID>
    402                <CreatedDate>2006-06-13T01:29:09.047000-04:00</CreatedDate>
    403                <ModifiedDate>2006-07-29T23:53:03.323000-04:00</ModifiedDate>
    404                <PreferredFlag>Yes</PreferredFlag>
    405                <RecordStatus>Inactive</RecordStatus>
    406                <RecordStatusDate>2006-07-29T23:53:03.393000-04:00</RecordStatusDate>
    407              </ContactMechanism>
    408              <ContactMechanism>
    409                <ContactType>Email</ContactType>
    410                <ContactTypeOtherSpecify xsi:nil="true"/>
    411                <ContactValue>[email protected]</ContactValue>
    412                <ContactAreaCode xsi:nil="true"/>
    413                <ContactCountryCallingCode>0</ContactCountryCallingCode>
    414                <ContactTollFreeFlag xsi:nil="true"/>
    415                <ContactGUID>ddd</ContactGUID>
    416                <ContactCreatedDate>2006-06-13T01:29:09.047000-04:00</ContactCreatedDate>
    417                <ContactLastModifiedDate>2006-06-13T01:29:09.047000-04:00</ContactLastModifiedDate>
    418                <ContactRecordStatus>Active</ContactRecordStatus>
    419                <ContactRecordStatusDate>2006-06-13T01:29:09.047000-04:00</ContactRecordStatusDate>
    420                <Role>Business</Role>
    421                <PhoneExtension xsi:nil="true"/>
    422                <QCDoneStatus>Yes</QCDoneStatus>
    423                <QCDoneStatusDate>2006-06-13T01:29:09.063000-04:00</QCDoneStatusDate>
    424                <ActiveFromDate>2006-06-13T01:29:09.063000-04:00</ActiveFromDate>
    425                <GUID>111</GUID>
    426                <CreatedDate>2006-06-13T01:29:09.063000-04:00</CreatedDate>
    427                <ModifiedDate>2006-06-13T01:29:09.063000-04:00</ModifiedDate>
    428                <PreferredFlag>Yes</PreferredFlag>
    429                <RecordStatus>Active</RecordStatus>
    430                <RecordStatusDate>2006-06-13T01:29:09.063000-04:00</RecordStatusDate>
    431              </ContactMechanism>
    432            </ContactMechanisms>
    433            <Persons>
    434              <Person>
    435                <PersonID>100448</PersonID>
    436                <Prefix/>
    437                <FirstName>John</FirstName>
    438                <MiddleName/>
    439                <LastName>Doe</LastName>
    440                <Suffix/>
    441                <PreferredName/>
    442                <Gender/>
    443                <PrimaryLanguage xsi:nil="true"/>
    444                <GUID>123</GUID>
    445                <RecordStatus>Active</RecordStatus>
    446                <RecordStatusDate>2007-04-29T00:11:50.750000-04:00</RecordStatusDate>
    447                <CreatedDate>2006-06-13T00:57:21.090000-04:00</CreatedDate>
    448                <LastModifiedDate>2007-04-29T00:11:50.770000-04:00</LastModifiedDate>
    449                <QCDoneStatus>Yes</QCDoneStatus>
    450                <QCDoneStatusDate>2006-06-13T00:57:22.977000-04:00</QCDoneStatusDate>
    451                <PersonTypes>
    452                  <PersonType>
    453                    <Type>Resource Personnel</Type>
    454                    <GUID>3049ddcd-3590-4fd9-a534-e2cea5b82c09</GUID>
    455                    <RecordStatus>Active</RecordStatus>
    456                    <RecordStatusDate>2006-06-13T00:57:22.977000-04:00</RecordStatusDate>
    457                    <CreatedDate>2006-06-13T00:57:21.090000-04:00</CreatedDate>
    458                    <LastModifiedDate>2007-04-29T00:11:50.817000-04:00</LastModifiedDate>
    459                    <QCDoneStatus>Yes</QCDoneStatus>
    460                    <QCDoneStatusDate>2006-06-13T00:57:22.977000-04:00</QCDoneStatusDate>
    461                  </PersonType>
    462                </PersonTypes>
    463              </Person>
    464            </Persons>
    465          </Association>
    466        </Associations>
    467      </OrganizationType>
    468    </OrganizationTypes>
    469    <ImportedDate>2007-04-30</ImportedDate>
    470  </OrganizationPersonAssoc>
    471  ';
    472  end;
    473  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> begin
      2    dbms_xmlschema.registerSchema
      3    (
      4        schemaURL => :schemaURL
      5       ,schemaDoc => :xmlSchema
      6       ,local     => TRUE
      7       ,genBean   => false
      8       ,genTypes  => TRUE
      9       ,genTables => TRUE
    10       ,enableHierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    11    );
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.67
    SQL> insert into Person values ( xmltype (:xmltext1))
      2  /
    1 row created.
    Elapsed: 00:00:00.07
    SQL> insert into org_person_assoc values ( xmltype (:xmltext2))
      2  /
    1 row created.
    Elapsed: 00:00:00.03
    SQL> commit
      2  /
    Commit complete.
    Elapsed: 00:00:00.00
    SQL> CREATE OR REPLACE VIEW XML_PERSON_ASSOCIATION
      2  (PERSON)
      3  AS
      4  select
      5  xmlelement("Person",
      6      xmlforest(
      7          extractvalue(value(p),'/Person/PersonID') "PersonID",
      8          extractvalue(value(p),'/Person/Prefix') "Prefix",
      9          extractvalue(value(p),'/Person/FirstName') "FirstName",
    10          extractvalue(value(p),'/Person/MiddleName') "MiddleName",
    11          extractvalue(value(p),'/Person/LastName') "LastName",
    12          extractvalue(value(p),'/Person/Suffix') "Suffix",
    13          extractvalue(value(p),'/Person/PreferredName') "PreferredName",
    14          extractvalue(value(p),'/Person/Gender') "Gender",
    15          extractvalue(value(p),'/Person/PrimaryLanguage') "PrimaryLanguage",
    16          extractvalue(value(p),'/Person/RecordStatus') "RecordStatus",
    17          extractvalue(value(p),'/Person/ImportedDate') "ImportedDate",
    18          (select
    19              xmlagg(
    20                  xmlelement("Association",
    21                      xmlforest(
    22                          extractvalue(value(oa),'/OrganizationPersonAssoc/Name') "Name",
    23                          extractvalue(value(ot),'/OrganizationType/OrganizationID') "OrganizationID",
    24                          extractvalue(value(ot),'/OrganizationType/Type') "OrganizationType",
    25                          extractvalue(value(a),'/Association/Role') "Role",
    26                          extractvalue(value(a),'/Association/RecordStatus') "RecordStatus",
    27                          extractvalue(value(oa),'/OrganizationPersonAssoc/ImportedDate') "ImportedDate"
    28                      ),
    29                      xmlelement("PersonTypes",
    30                          extract(value(per),'/Person/PersonTypes/PersonType')
    31                      ),
    32                      xmlelement("Addresses",
    33                          extract(value(a),'/Association/Addresses/Address')
    34                      ),
    35                      xmlelement("ContactMechanisms",
    36                          extract(value(a),'/Association/ContactMechanisms/ContactMechanism')
    37                      )
    38                  )
    39              )
    40          from org_person_assoc oa,
    41          table(xmlsequence(extract(value(oa),'/OrganizationPersonAssoc/OrganizationTypes/OrganizationType'))) ot,
    42          table(xmlsequence(extract(value(ot),'/OrganizationType/Associations/Association'))) a,
    43          table(xmlsequence(extract(value(a),'/Association/Persons/Person'))) per
    44          where extractvalue(value(per),'/Person/PersonID') = extractvalue(value(p),'/Person/PersonID')
    45          ) "Associations"
    46      )
    47  ) person
    48  from person p
    49  /
    View created.
    Elapsed: 00:00:00.06
    SQL> set autotrace on explain
    SQL> --
    SQL> set long 10000 pages 0 lines 150
    SQL> --
    SQL> select person
      2    from xml_person_association o
      3   where existsnode(person,'/Person/Associations/Association[OrganizationID=30097]')=1
      4  /
    <Person><PersonID>100448</PersonID><FirstName>John</FirstName><LastName>Doe</LastName><RecordStatus>Active</RecordStatus><ImportedDate>2007-04-30</Imp
    ortedDate><Associations><Association><Name>Org Name Office</Name><OrganizationID>30097</OrganizationID><OrganizationType>Agency</OrganizationType><Rol
    e>Employee</Role><RecordStatus>Active</RecordStatus><ImportedDate>2007-04-30</ImportedDate><PersonTypes><PersonType>
      <Type>Resource Personnel</Type>
      <GUID>3049ddcd-3590-4fd9-a534-e2cea5b82c09</GUID>
      <RecordStatus>Active</RecordStatus>
      <RecordStatusDate>2006-06-13T00:57:22.977000-04:00</RecordStatusDate>
      <CreatedDate>2006-06-13T00:57:21.090000-04:00</CreatedDate>
      <LastModifiedDate>2007-04-29T00:11:50.817000-04:00</LastModifiedDate>
      <QCDoneStatus>Yes</QCDoneStatus>
      <QCDoneStatusDate>2006-06-13T00:57:22.977000-04:00</QCDoneStatusDate>
    </PersonType>
    </PersonTypes><Addresses><Address>
      <StreetName1>123 Front St.</StreetName1>
      <StreetName2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <StreetName3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <StreetName4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <CityName>City</CityName>
      <CityGUID>234234</CityGUID>
      <CityCreatedDate>2006-05-08T20:06:45.143000-04:00</CityCreatedDate>
      <CityLastModifiedDate>2006-05-08T20:06:45.143000-04:00</CityLastModifiedDate>
      <CityRecordStatus>Active</CityRecordStatus>
      <CityRecordStatusDate>2006-05-08T20:06:45.143000-04:00</CityRecordStatusDate>
      <StateName>New York</StateName>
      <StateGUID>9fd469e1-4d4a-4f38-9def-50038e5ecca2</StateGUID>
      <StateCreatedDate>2006-04-22T16:09:35.830000-04:00</StateCreatedDate>
      <StateLastModifiedDate>2006-04-22T16:09:35.830000-04:00</StateLastModifiedDate>
      <StateRecordStatus>Active</StateRecordStatus>
      <StateRecordStatusDate>2006-04-22T16:09:35.830000-04:00</StateRecordStatusDate>
      <CountryName>United States</CountryName>
      <CountryCode>USA</CountryCode>
      <CountryGUID>532d35dd-3a49-408a-a416-20c41e9c7997</CountryGUID>
      <CountryCreatedDate>2006-04-22T15:30:47.000000-04:00</CountryCreatedDate>
      <CountryLastModifiedDate>2006-04-22T15:30:47.000000-04:00</CountryLastModifiedDate>
      <CountryRecordStatus>Active</CountryRecordStatus>
      <CountryRecordStatusDate>2006-04-22T15:30:47.000000-04:00</CountryRecordStatusDate>
      <ZipPostalCode>12345</ZipPostalCode>
      <GUID>b2414fa9-7375-4d26-8d76-89a6915d6751</GUID>
      <CreatedDate>2006-06-13T01:29:09.030000-04:00</CreatedDate>
      <LastModifiedDate>2006-07-29T23:45:17.670000-04:00</LastModifiedDate>
      <RecordStatus>Active</RecordStatus>
      <RecordStatusDate>2006-06-13T01:29:09.030000-04:00</RecordStatusDate>
      <Type>Office</Type>
      <TypeOtherSpecify/>
      <InternalOffice/>
      <MailStopCode/>
      <PreferredFlag>Yes</PreferredFlag>
      <ActiveFromDate>2006-06-13T01:29:09.000000-04:00</ActiveFromDate>
      <QCDoneStatus>Yes</QCDoneStatus>
      <QCDoneStatusDate>2006-06-13T01:29:09.030000-04:00</QCDoneStatusDate>
    </Address>
    </Addresses><ContactMechanisms><ContactMechanism>
      <ContactType>Phone</ContactType>
      <ContactTypeOtherSpecify xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <ContactValue>555-5555</ContactValue>
      <ContactAreaCode>555</ContactAreaCode>
      <ContactCountryCallingCode>1</ContactCountryCallingCode>
      <ContactTollFreeFlag xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <ContactGUID>123</ContactGUID>
      <ContactCreatedDate>2006-06-13T01:29:09.047000-04:00</ContactCreatedDate>
      <ContactLastModifiedDate>2007-02-23T16:36:10.260000-05:00</ContactLastModifiedDate>
      <ContactRecordStatus>Active</ContactRecordStatus>
      <ContactRecordStatusDate>2006-06-13T01:29:09.047000-04:00</ContactRecordStatusDate>
      <Role>Business</Role>
      <PhoneExtension/>
      <QCDoneStatus>Yes</QCDoneStatus>
      <QCDoneStatusDate>2006-06-13T01:29:09.047000-04:00</QCDoneStatusDate>
      <ActiveFromDate>2006-06-13T01:29:09.000000-04:00</ActiveFromDate>
      <GUID>321</GUID>
      <CreatedDate>2006-06-13T01:29:09.047000-04:00</CreatedDate>
      <ModifiedDate>2006-07-29T23:53:03.323000-04:00</ModifiedDate>
      <PreferredFlag>Yes</PreferredFlag>
      <RecordStatus>Inactive</RecordStatus>
      <RecordStatusDate>2006-07-29T23:53:03.393000-04:00</RecordStatusDate>
    </ContactMechanism>
    <ContactMechanism>
      <ContactType>Email</ContactType>
      <ContactTypeOtherSpecify xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <ContactValue>[email protected]</ContactValue>
      <ContactAreaCode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <ContactCountryCallingCode>0</ContactCountryCallingCode>
      <ContactTollFreeFlag xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <ContactGUID>ddd</ContactGUID>
      <ContactCreatedDate>2006-06-13T01:29:09.047000-04:00</ContactCreatedDate>
      <ContactLastModifiedDate>2006-06-13T01:29:09.047000-04:00</ContactLastModifiedDate>
      <ContactRecordStatus>Active</ContactRecordStatus>
      <ContactRecordStatusDate>2006-06-13T01:29:09.047000-04:00</ContactRecordStatusDate>
      <Role>Business</Role>
      <PhoneExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
      <QCDoneStatus>Yes</QCDoneStatus>
      <QCDoneStatusDate>2006-06-13T01:29:09.063000-04:00</QCDoneStatusDate>
      <ActiveFromDate>2006-06-13T01:29:09.063000-04:00</ActiveFromDate>
      <GUID>111</GUID>
      <CreatedDate>2006-06-13T01:29:09.063000-04:00</CreatedDate>
      <ModifiedDate>2006-06-13T01:29:09.063000-04:00</ModifiedDate>
      <PreferredFlag>Yes</PreferredFlag>
      <RecordStatus>Active</RecordStatus>
      <RecordStatusDate>2006-06-13T01:29:09.063000-04:00</RecordStatusDate>
    </ContactMechanism>
    </ContactMechanisms></Association></Associations></Person>
    Elapsed: 00:00:00.42
    Execution Plan
    Plan hash value: 95656148
    | Id  | Operation                        | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                 |                                |     1 | 18040 |     9   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE                  |                                |     1 | 10096 |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID    | SYS_NT32zHSpCZQ9ynComtqqKsrw== |     1 | 10096 |     2   (0)| 00:00:01 |
    |*  3 |    INDEX RANGE SCAN              | SYS_C009300                    |     1 |       |     2   (0)| 00:00:01 |
    |   4 |    SORT AGGREGATE                |                                |     1 | 48284 |            |          |
    |   5 |     TABLE ACCESS BY INDEX ROWID  | SYS_NTjbkXqKq3S96fbEOM3Qs5Gg== |     1 | 48284 |     2   (0)| 00:00:01 |
    |*  6 |      INDEX RANGE SCAN            | SYS_C009296                    |     1 |       |     2   (0)| 00:00:01 |
    |   7 |      SORT AGGREGATE              |                                |     1 | 28187 |            |          |
    |   8 |       TABLE ACCESS BY INDEX ROWID| SYS_NTm2nBfKKNSGm6hs2e1Z0w/A== |     1 | 28187 |     2   (0)| 00:00:01 |
    |*  9 |        INDEX RANGE SCAN          | SYS_C009297                    |     1 |       |     2   (0)| 00:00:01 |
    |  10 |  SORT AGGREGATE                  |                                |     1 | 13910 |            |          |
    |  11 |   NESTED LOOPS                   |                                |     1 | 13910 |     6   (0)| 00:00:01 |
    |  12 |    NESTED LOOPS                  |                                |     1 |  8131 |     5   (0)| 00:00:01 |
    |  13 |     NESTED LOOPS                 |                                |     1 |  4097 |     4   (0)| 00:00:01 |
    |* 14 |      TABLE ACCESS FULL           | SYS_NT7Erd/G5iSPWX9w20Z5cNRg== |     1 |    43 |     3   (0)| 00:00:01 |
    |* 15 |      TABLE ACCESS BY INDEX ROWID | SYS_NTQWY/m3uES5GM7AByRclr8A== |     1 |  4054 |     1   (0)| 00:00:01 |
    |* 16 |       INDEX UNIQUE SCAN          | SYS_C009310                    |     1 |       |     0   (0)| 00:00:01 |
    |* 17 |     TABLE ACCESS BY INDEX ROWID  | SYS_NTTiDHMvB7RbSEfNxho66yQg== |     1 |  4034 |     1   (0)| 00:00:01 |
    |* 18 |      INDEX UNIQUE SCAN           | SYS_C009314                    |     1 |       |     0   (0)| 00:00:01 |
    |  19 |    TABLE ACCESS BY INDEX ROWID   | ORG_PERSON_ASSOC               |     1 |  5779 |     1   (0)| 00:00:01 |
    |* 20 |     INDEX UNIQUE SCAN            | SYS_C009320                    |     1 |       |     0   (0)| 00:00:01 |
    |* 21 |  FILTER                          |                                |       |       |            |          |
    |  22 |   TABLE ACCESS FULL              | PERSON                         |     1 | 18040 |     3   (0)| 00:00:01 |
    |  23 |   NESTED LOOPS                   |                                |       |       |            |          |
    |  24 |    NESTED LOOPS                  |                                |     1 |  5893 |     6   (0)| 00:00:01 |
    |  25 |     NESTED LOOPS                 |                                |     1 |  2125 |     5   (0)| 00:00:01 |
    |  26 |      NESTED LOOPS                |                                |     1 |    93 |     4   (0)| 00:00:01 |
    |* 27 |       TABLE ACCESS FULL          | SYS_NT7Erd/G5iSPWX9w20Z5cNRg== |     1 |    43 |     3   (0)| 00:00:01 |
    |* 28 |       TABLE ACCESS BY INDEX ROWID| SYS_NTQWY/m3uES5GM7AByRclr8A== |     1 |    50 |     1   (0)| 00:00:01 |
    |* 29 |        INDEX UNIQUE SCAN         | SYS_C009310                    |     1 |       |     0   (0)| 00:00:01 |
    |* 30 |      TABLE ACCESS BY INDEX ROWID | SYS_NTTiDHMvB7RbSEfNxho66yQg== |     1 |  2032 |     1   (0)| 00:00:01 |
    |* 31 |       INDEX UNIQUE SCAN          | SYS_C009314                    |     1 |       |     0   (0)| 00:00:01 |
    |* 32 |     INDEX UNIQUE SCAN            | SYS_C009320                    |     1 |       |     0   (0)| 00:00:01 |
    |  33 |    TABLE ACCESS BY INDEX ROWID   | ORG_PERSON_ASSOC               |     1 |  3768 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       3 - access("NESTED_TABLE_ID"=:B1)
       6 - access("NESTED_TABLE_ID"=:B1)
       9 - access("NESTED_TABLE_ID"=:B1)
      14 - filter("SYS_NC_TYPEID$" IS NOT NULL AND "PersonID"=:B1)
      15 - filter("SYS_NC_TYPEID$" IS NOT NULL)
      16 - access("NESTED_TABLE_ID"="SYS_ALIAS_1"."SYS_NC0002700028$")
      17 - filter("SYS_NC_TYPEID$" IS NOT NULL)
      18 - access("NESTED_TABLE_ID"="SYS_ALIAS_0"."SYS_NC0003700038$")
      20 - access("NESTED_TABLE_ID"="OA"."SYS_NC0002100022$")
      21 - filter( EXISTS (SELECT 0 FROM "XDBTEST"."SYS_NT7Erd/G5iSPWX9w20Z5cNRg=="
                  "SYS_ALIAS_1","XDBTEST"."SYS_NTQWY/m3uES5GM7AByRclr8A=="
                  "SYS_ALIAS_3","XDBTEST"."SYS_NTTiDHMvB7RbSEfNxho66yQg==" "SYS_ALIAS_0","XDBTEST"."ORG_PERSON_ASSOC" "OA"
                  WHERE "SYS_ALIAS_0"."NESTED_TABLE_ID"="OA"."SYS_NC0002100022$" AND
                  "SYS_ALIAS_1"."NESTED_TABLE_ID"="SYS_ALIAS_0"."SYS_NC0003700038$" AND "SYS_ALIAS_0"."SYS_NC_TYPEID$" IS
                  NOT NULL AND TO_NUMBER("SYS_ALIAS_0"."OrganizationID")=30097 AND
                  "SYS_ALIAS_4"."NESTED_TABLE_ID"="SYS_ALIAS_1"."SYS_NC0002700028$" AND "SYS_ALIAS_1"."SYS_NC_TYPEID$" IS
                  NOT NULL AND "SYS_ALIAS_4"."SYS_NC_TYPEID$" IS NOT NULL AND "SYS_ALIAS_4"."PersonID"=:B1))
      27 - filter("SYS_ALIAS_4"."SYS_NC_TYPEID$" IS NOT NULL AND "SYS_ALIAS_4"."PersonID"=:B1)
      28 - filter("SYS_ALIAS_1"."SYS_NC_TYPEID$" IS NOT NULL)
      29 - access("SYS_ALIAS_4"."NESTED_TABLE_ID"="SYS_ALIAS_1"."SYS_NC0002700028$")
      30 - filter("SYS_ALIAS_0"."SYS_NC_TYPEID$" IS NOT NULL AND
                  TO_NUMBER("SYS_ALIAS_0"."OrganizationID")=30097)
      31 - access("SYS_ALIAS_1"."NESTED_TABLE_ID"="SYS_ALIAS_0"."SYS_NC0003700038$")
      32 - access("SYS_ALIAS_0"."NESTED_TABLE_ID"="OA"."SYS_NC0002100022$")
    Note
       - dynamic sampling used for this statement
    SQL> select extract(person,'/Person/Associations/Association')
      2    from xml_person_association o
      3   where existsnode(person,'/Person/Associations/Association[OrganizationID=30097]')=1
      4  /
    <Association><Name>Org Name Office</Name><OrganizationID>30097</OrganizationID><OrganizationType>Agency</OrganizationType><Role>Employee</Role><Record
    Status>Active</RecordStatus><ImportedDate>2007-04-30</ImportedDate><PersonTypes><PersonType><Type>Resource Personnel</Type><GUID>3049ddcd-3590-4fd9-a5
    34-e2cea5b82c09</GUID><RecordStatus>Active</RecordStatus><RecordStatusDate>2006-06-13T00:57:22.977000-04:00</RecordStatusDate><CreatedDate>2006-06-13T
    00:

  • ORA-01445: cannot select ROWID from, or sample, a join view without a key-p

    Hi All,
    I am facing issue with one sql query. It is giving me error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    I am not getting any clue to solve this. On internet, i didn't find proper reason for this error and troubleshooting way and solution for this error. Everywhere i saw one sentence, "Key preserved means the row from the base table will appear AT MOST ONCE in the output view on that table" but it didn't solve my problem.
    I have 1099 columns in one select query. so avoiding the actual column list in select clause. Instead I am trying to select ROWIDs from all tables in join. My understanding is ROWID is a unique identifier in table not in database. But though I remove ROWIDs, I get same error. So please don't bother about these ROWIDs.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,DIM_SEC.ROWID AS ABC3
    ,DIM_SEC_ADJ.ROWID AS ABC4
    ,DIS_CAT.ROWID AS ABC5
    ,CTRY.ROWID AS ABC6
    ,BCP.ROWID AS ABC7
    ,STAGE.ROWID AS ABC8
    FROM FACT_POSITION FACT
    LEFT JOIN FACT_POSITION_ADJ FACT_ADJ ON FACT.POSITION_PKID = FACT_ADJ.POSITION_FKID
    LEFT JOIN DIM_SOURCE_SYSTEM SOURCE ON FACT.SOURCE_SYSTEM_FKID = SOURCE.SOURCE_SYSTEM_PKID
    LEFT JOIN DIM_SECURITY DIM_SEC ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC.SECURITY_PKID
    LEFT JOIN DIM_SECURITY_ADJ DIM_SEC_ADJ ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC_ADJ.SECURITY_PKID
    LEFT JOIN DIM_DISCLOSURE_CATEGORY DIS_CAT ON FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    LEFT JOIN COUNTRY_REFERENCE CTRY ON CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    LEFT JOIN BUSINESS_CLOSE_PERIOD BCP
    ON BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_LOCKED='Y' AND BCP.IS_ACTIVE='Y'
    LEFT JOIN GUI_STAGING STAGE ON
    FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5)
    WHERE FACT.POSITION_PKID=64524374;
    While trying to sort this error, I found interesting things that made me more confused.
    if I remove TO_DATE function from select clause, same join query works.
    If I remove any table from join and keep TO_DATE function in select clause, query works.
    That tells, there is no problem in query.
    Then please anyone help me to sort out the error. FYI. I have googled a lot for this error. but didn't get solution/clue. That is why I am posting this problem to forum.
    Thanks in advance. waiting for reply ASAP.
    Pravin Pujari
    [email protected]

    I think i got the solution. The syntax i was using (ANSI syntax) doesn't work in the oracle database version i am using.
    When i updated my query with older oracle syntax, it worked.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,SOURCE.ROWID AS ABC3
    ,DIM_SEC.ROWID AS ABC4
    ,DIM_SEC_ADJ.ROWID AS ABC5
    ,DIS_CAT.ROWID AS ABC6
    ,CTRY.ROWID AS ABC7
    ,BCP.ROWID AS ABC8
    ,STAGE.ROWID AS ABC8
    FROM [email protected] FACT
    ,[email protected] FACT_ADJ
    ,[email protected] SOURCE
    ,[email protected] DIM_SEC
    , [email protected] DIM_SEC_ADJ
    , [email protected] DIS_CAT
    , GUI.COUNTRY_REFERENCE CTRY
    , GUI.BUSINESS_CLOSE_PERIOD BCP
    , GUI.GUI_STAGING STAGE
    WHERE FACT.POSITION_PKID=64517140
    AND FACT_ADJ.POSITION_FKID(+) = FACT.POSITION_PKID
    AND SOURCE.SOURCE_SYSTEM_PKID=FACT.SOURCE_SYSTEM_FKID
    AND DIM_SEC.SECURITY_PKID=FACT.SUBSYS_SECURITY_FKID
    AND DIM_SEC_ADJ.SECURITY_PKID(+)=DIM_SEC.SECURITY_PKID
    AND FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    AND CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    AND BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_ACTIVE='Y'
    AND FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5);

  • ORA-01017: invalid username/password through dblink when select from view

    Hello all,
    I work on 2 databases :
    - One is a 10g (let's call it db_10 )
    - The second one is a 11g (let's call it db_11 )
    I created a view V_PROTOCOLES in schema SCHEMA_1 on db_11.
    The FROM clause of this view call 4 tables :
    - table1 : owner is SCHEMA_1
    - table2 : owner is SCHEMA_2 (schema on db_11 )
    - table3 : owner is SCHEMA_3 (schema on db_10 )
    - table4 : owner is SCHEMA_4 (schema on db_10 )
    When I simply run SELECT * FROM V_PROTOCOLES on db11 with user X, I can have a result.
    The problem occurs when I connect on db10 also with user X. The V_PROTOCOLES view has a public synonym using the dblink DBDOC_LINK (without explicitly specify a user, so it connects with the X user).
    But here I can't run the SELECT * FROM V_PROTOCOLES. I Have the following error :
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from DBDOC_LINKThe passwords for user X are obviously the same on both 10g and 11g databases.
    Thanks for the help !

    On 10g :
    select password from dba_users where username = 'U872574';
    PASSWORD
    30811840BC618B77On 11g :
    select password from sys.user$ where name='U872574';
    PASSWORD
    30811840BC618B77I dropped and recreated the dblink but the problem always occurs...
    (By the way, curiously when I dropped the dblink I have no invalid objects although it is used in different packages or triggers)

  • Error when selecting from view created by OLAP_TABLE

    Hi all,
    I used OWB 10.2.0.4 to create a MOLAP datawarehouse.
    I created a view with this:
    CREATE OR REPLACE VIEW sales_view AS
    SELECT *
    FROM TABLE(OLAP_TABLE(
    'dw duration session',
    'MEASURE samt AS number(16,0) FROM SALES_SAMT
    DIMENSION cust_code AS varchar2(30) FROM cust
    DIMENSION prod_code AS varchar2(30) FROM prod
    DIMENSION sman_code AS varchar2(30) FROM sman
    DIMENSION time_id AS varchar2(30) FROM time
    DIMENSION orgn_code AS varchar2(30) FROM orgn'));
    and I try to run the following:
    select count(*) from sales_view;
    and I got the following error:
    Error starting at line 1 in command:
    select count(*) from sales_view
    Error report:
    SQL Error: ORA-29400: data cartridge error
    ORA-00600: internal error code, arguments: [xsvaluekeyget: type], [114], [], [], [], [], [], []
    29400. 00000 - "data cartridge error\n%s"
    *Cause:    An error has occurred in a data cartridge external procedure.
    This message will be followed by a second message giving
    more details about the data cartridge error.
    *Action:   See the data cartridge documentation
    for an explanation of the second error message.
    Can somebody give me some idea?
    Many thanks!
    - Andrew

    Brijesh,
    Really appreciate your help!
    With your hint (#2), I found my problems.
    I had 2 problems:
    1) I'm missing the 'Model' clause at the end of my view creation (in bold )
    2) I shouldn't do a count on all rows (e.g. I get result if I select with parameters)
    Here's my working view:
    CREATE OR REPLACE VIEW SALES_VIEW2
    AS
    SELECT * FROM TABLE(OLAP_TABLE(
    'DW DURATION SESSION',
    MEASURE SAMT FROM SALES_SAMT1
    DIMENSION PROD_CODE FROM PROD
    DIMENSION SMAN_CODE FROM SMAN
    DIMENSION TIME_CODE FROM TIME
    DIMENSION CUST_CODE FROM CUST
    DIMENSION ORGN_CODE FROM ORGN
    MODEL
    DIMENSION BY(PROD_CODE, CUST_CODE, SMAN_CODE, TIME_CODE, ORGN_CODE)
    MEASURES(SAMT)
    RULES UPDATE SEQUENTIAL ORDER();
    -----

  • Is select from view faster then select from table..???

    Hello Gurus,
    I want to query some data from two tables, both of table have many columns (attributes) and many rows...
    I use several where clauses to retrieve data from those tables..
    witch one is faster, I create a view or I just "select" from those tables???
    Regards.
    Nia...

    riedelme wrote:
    3360 wrote:
    riedelme wrote:
    Selecting through a view almost never helps performance and frequently hurts.Views do not affect performance.
    Views are simply queries and like queries there are fast and slow ones.I disagree.
    First of all, to use a view you are executing a query to get a result set, then accessing the data from that result set - a built-in extra step to perform to get data.First of all that entire explanation of how views work is not correct. The optimizer will rewrite the query to make the view go away if possible.
    SQL> create or replace view v as select * from dual;
    View created.
    SQL> explain plan for select * from dual where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.
    SQL> explain plan for select * from v where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.Exactly the same.
    >
    Second, when accessing the data from the view the result sets don't have indexes for fast lookups and efficient joins on later steps.This is also known as just making stuff up and is not how the database works. care to share any references at all for any of this?
    >
    Third, the systems I've seen that use views extensively - I am looking at one now - tend to perform joins on views using the same tables with the same data over and over. This is a design issue and not specifically a problem with views but they lend themselves to this misuse much too easilyCorrect as I said a view is just a query, and just like queries there are good fast views and bad slow views
    >
    I'll concede that the problem is not specifically with views themselves but as I just said they lend themselves to misuse. Tuning views of views and views joined to views is difficultYes, queries can be misused as can almost all SQL functions and functionality.
    As I said - Views are simply queries and like queries there are fast and slow ones.
    Nothing that you have posted that is accurate changes that.

  • Cannot select ROWID from, or sample, a join view without a key-preserve

    I'm getting an error "cannot select ROWID from, or sample, a join view without a key-preserved table" when performing an INSERT. There is no error when performing an UPDATE.
    I created a "Form with Reports" page, where the Reports is based on a view multi table join. The primary key I chose during the form creation process is "From Trigger". The primary key "ACCESS_ID" has been defined in the base table. On the view, I have created an INSTEAD OF TRIGGER, for both Insert and Update. The update seems to work. I am using the automatic row processing for the update and insert.
    Additional information: My insert works standalone i.e. i write
    insert into jxjplntr_access_v (col1, ...)
    values (va1, val2...)
    and it works when i run it on SQL window.
    access_id has a constraint defined as not null and also PK.
    I have an insert "instead of" trigger defined on the jxjplntr_access_v view.
    However, when i "CREATE" a record after filling in the values, I get the above error. BTW, here is the view definition:
    CREATE OR REPLACE VIEW jxjplntr_access_v (
    access_id,
    person_id,
    person_name,
    badge_number,
    ntr_resp_type,
    primary_flag,
    start_date_active,
    end_date_active,
    created_by,
    created_by_uname,
    creation_date,
    last_updated_by,
    last_updated_by_uname,
    last_update_date,
    last_update_login )
    AS
    select
    access_id,
    ja.person_id,
    initcap(p.last_name||', '||p.first_name) person_name,
    p.employee_number badge_number,
    ntr_resp_type,
    primary_flag,
    ja.start_date_active,
    ja.end_date_active,
    ja.created_by,
    f1.user_name created_by_uname,
    ja.creation_date,
    ja.last_updated_by,
    f2.user_name last_updated_by_uname,
    ja.last_update_date,
    ja.last_update_login
    from jplntr.jplntr_access ja
    ,fnd_user f1
    ,fnd_user f2
    ,per_people_x p
    where f1.user_id(+) = ja.created_by
    and f2.user_id(+) = ja.last_updated_by
    and p.person_id(+) = ja.person_id
    Thanks in advance.
    K
    Edited by: kktong on Dec 12, 2011 5:39 PM
    Edited by: kktong on Dec 13, 2011 10:06 AM

    I've just been looking at exactly the same problem. From my initial investigations, this seems to be a bug with Apex and creating a tabular form, as described in this thread here:
    v4.0 - Tabular form ORA-01445: cannot select ROWID from, or sample,
    Very frustrating!
    I hope thats of use to you. If I find out anything else, I'll come back and let you know.
    Simon
    Edited by: Simon Holt on 26-Jul-2012 03:32

  • ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP

    In my data model (load from a database) there is this data control and its accessor return.
    When I drag the accessor return inside a jsf page I create a adf read only table (that has about 5000 rows), the I run the page and it works.
    Since I want to display only 20 ( or 50 or 100 is the same) rows for each page I had changed the access mode from the default value "Scrollable" to "Range Paging" and then I ve selected range size 50.
    Now if I run hte jsf page there are no data to display and if I press the small triangles to order the column or insert a word in the filter field I have the message ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP.
    I dont know how to do to solve this problem.
    Stefano

    An other thing.
    I solved this problem, maybe I dont understand the meaning of access mode and range size , since every value I choose of these 2 fields the visualization of the table doesnt change.

Maybe you are looking for

  • Ipod touch - itunes music library sharing

    My 9 year old son has an ipod touch. Can he share my current iTunes music library? If so, how do we configure it in the settings without messing anything else up?  We finally just worked it out so we aren't getting each others texts anymore!!  Thanks

  • Daily show not downloading with a multi pass

    i have a multi pass for the daily show. the latest episode is available on the itunes store to buy, but won't download with my pass. does anyone know why or how to fix it?

  • Download file for my dock & Time Machine

    I had to do a reinstall om my Mac, and everything is gone that used to be there.  I don't know how to use my Time Machine, and my download file is gone from my dock and also from the drop down menu in the Finder.  What do I do~??  Can anyone help me

  • Adobe dynamic link - ACROSS multiple boxes on one LAN?

    Looking for help using ADOBE DYNAMIC LINK - But not one machine but between 2 different machines on one network - one AE, one Premiere CC: We need to be able to at least move between different motion graphics and editing machines. I want the animator

  • Can we record a script which can download files?

    Hi, I'm trying to record a script to download file at data collector. I'm using Dialog Manager to handle all the dialogs but it keep failing at the dialog which need to click on Save button. I've edit the Dialog Manager with action like [Save]{ENTER}