Getting PL/SQL:ORA-00933 when using CASE logic as a control structure

Hello Everybody,I have created a PL/SQL block(Control Structure) to calculate bonus of employees based on salary of the employee,but I get errors like ORA-00933 and ORA-06550.Given below is the PL/SQL block which I tried to implement
SQL> DECLARE
2
3 v_EMPNO NUMBER(7,2):= &p_EMPNO;
4 v_SAL EMP.SAL%TYPE;
5 v_BONUS NUMBER;
6
7 BEGIN
8 SELECT SAL
9 FROM EMP
10 INTO v_SAL
11 WHERE EMPNO = v_EMPNO;
12
13 v_BONUS :=
14 CASE v_SAL
15 WHEN v_SAL = 0 THEN 0
16 WHEN v_SAL < 1500 THEN (0.1*v_SAL)
17 WHEN v_SAL BETWEEN 1500 AND 3000 THEN (0.15*v_SAL)
18 WHEN v_SAL > 3000 THEN (0.20*v_SAL)
19 END;
20
21 DBMS_OUTPUT.PUT_LINE(' EMPNO '||v_EMPNO||' SALARY '||v_SAL||' BONUS '||V_BONUS);
22
23 END;
24 /
Enter value for p_empno: 7100
old 3: v_EMPNO NUMBER(7,2):= &p_EMPNO;
new 3: v_EMPNO NUMBER(7,2):= 7100;
INTO v_SAL
ERROR at line 10:
ORA-06550: line 10, column 7:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 8, column 7:
PL/SQL: SQL Statement ignored
Is it that I can not use "CASE" as a control structure in the above block , when I code
"SELECT SAL
FROM EMP
INTO v_SAL
WHERE EMPNO = v_EMPNO;" to get v_SAL and then use it in CASE exp to calculate a value for v_Bonus.
Kindly let me know.

Hi,
The CASE Expression is also available in PL/SQL.
Try this code:
DECLARE
   V_EMPNO   NUMBER (7, 2)  := 7788;
   V_SAL     EMP.SAL%TYPE;
   V_BONUS   NUMBER;
BEGIN
   SELECT SAL
     INTO V_SAL
     FROM EMP
    WHERE EMPNO = V_EMPNO;
   V_BONUS :=
      CASE
         WHEN V_SAL = 0
            THEN 0
         WHEN V_SAL < 1500
            THEN (0.1 * V_SAL)
         WHEN V_SAL BETWEEN 1500 AND 3000
            THEN (0.15 * V_SAL)
         WHEN V_SAL > 3000
            THEN (0.20 * V_SAL)
      END;
   DBMS_OUTPUT.PUT_LINE (   ' EMPNO '
                         || V_EMPNO
                         || ' SALARY '
                         || V_SAL
                         || ' BONUS '
                         || V_BONUS
END;As you are Using,Comparison Expression to find a match, Your Searched CASE Expression should be something like this.
DECLARE
  sal       NUMBER := 2000;
  sal_desc  VARCHAR2(20);
BEGIN
  sal_desc := CASE
                 WHEN sal < 1000 THEN 'Low'
                 WHEN sal BETWEEN 1000 AND 3000 THEN 'Medium'
                 WHEN sal > 3000 THEN 'High'
                 ELSE 'N/A'
              END;
  DBMS_OUTPUT.PUT_LINE(sal_desc);
END;If you are Using CASE as a Value matching then your piece of code should be like this..
DECLARE
  deptno     NUMBER := 20;
  dept_desc  VARCHAR2(20);
BEGIN
  dept_desc := CASE deptno
                 WHEN 10 THEN 'Accounting'
                 WHEN 20 THEN 'Research'
                 WHEN 30 THEN 'Sales'
                 WHEN 40 THEN 'Operations'
                 ELSE 'Unknown'
               END;
  DBMS_OUTPUT.PUT_LINE(dept_desc);
END;Thanks,
Shankar

Similar Messages

  • URGENT : ORA 302000 when using TEXT_IO.fopen

    Hi,
    I get this error ORA 302000 when using TEXT_IO package, the code I use is
    new_file:=text_io.fopen('c:\text.txt','r')
    i don't have the description of this ORA 302000 , pls does anyone have it?

    Hi,
    I know it's been 2 years but it's still up to date for me.
    I tried the suggested piece of code to trace the error but it did not bring anything more
    EXCEPTION
    When Others then
    srw.Message( 2, 'EXCEPTION ' || SQLCODE || ' in common package. Can not open the file ');
    IF SQLCODE = -302000 then
    LOOP
    EXIT WHEN TOOL_ERR.NERRORS = 0;
    SRW.MESSAGE( 667, TO_CHAR(TOOL_ERR.CODE) || ': ' || TOOL_ERR.MESSAGE);
    TOOL_ERR.POP;
    END LOOP;
    END IF;
    srw.Message( 3, 'EXCEPTION ' || SQLCODE || ' in com package. Can not open the file ' || I_Desname || ' : ' || SQLERRM );
    Only Message 2 and 3 are displayed in the trace file
    Any other suggestion?
    Manu

  • Error ORA-06502 When using function REPLACE in PL/SQL

    Hi,
    I have a PL/SQL procedure which gives error 'Error ORA-06502 When using function REPLACE in PL/SQL' when the string value is quite long (I noticed this with a string 9K in length)
    variable var_a is of type CLOB
    and the assignment statement where it gives the error is
    var_a := REPLACE(var_a, '^', ''',''');
    Can anyone please help!
    Thanks

    Even then that shouldn't do so:
    SQL> select overload, position, argument_name, data_type, in_out
      2  from all_arguments
      3  where package_name = 'STANDARD'
      4  and object_name = 'LPAD'
      5  order by 1,2
      6  /
    OVERLOAD   POSITION ARGUMENT_NAME                  DATA_TYPE                      IN_OUT
    1                 0                                VARCHAR2                       OUT
    1                 1 STR1                           VARCHAR2                       IN
    1                 2 LEN                            BINARY_INTEGER                 IN
    1                 3 PAD                            VARCHAR2                       IN
    2                 0                                VARCHAR2                       OUT
    2                 1 STR1                           VARCHAR2                       IN
    2                 2 LEN                            BINARY_INTEGER                 IN
    3                 0                                CLOB                           OUT
    3                 1 STR1                           CLOB                           IN
    3                 2 LEN                            NUMBER                         IN
    3                 3 PAD                            CLOB                           IN
    4                 0                                CLOB                           OUT
    4                 1 STR1                           CLOB                           IN
    4                 2 LEN                            NUMBER                         INI wonder what happened?

  • PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables

    Dear ALL,
    My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
    Can anybody tell me how to fix this error ? Because am not able to get the records.
    Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
    +(The following error has occurred:+
    A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
    If anyone having any idea kindly share.
    Thanks and Regards
    Biswa

    Hi,
    Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
    But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
    Kindly tell if u know any resolution.
    Thanks

  • Hi..."PL/SQL: ORA-00933: SQL command not properly ended"

    Error starting at line 1 in command:
    DECLARE
    V_ENAME EMP.ENAME%TYPE;
    V_SAL EMP.SAL%TYPE;
    V_RANK INTEGER(2);
    BEGIN
    V_RANK:=&RN;
    select ENAME,SAL,RNK from (select ENAME,SAL,dense_rank() over(order by sal desc) AS RNK from emp)
    into V_ENAME,V_SAL,V_RANK from emp where RNK=V_RANK;
    DOPL('EMPLOYEE NAME:'||V_ENAME);
    DOPL('EMPLOYEE SAL:'||V_SAL);
    DOPL('EMPLOYEE RANK:'||V_RNK);
    END;
    Error report:
    ORA-06550: line 7, column 99:
    PL/SQL: ORA-00933: SQL command not properly ended
    ORA-06550: line 7, column 1:
    PL/SQL: SQL Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    hi..,when i executing above pl/sql program, it shows error...!
    so i am unable to find error correctly..! plz help me..!
    Regards..!
    Cnu.

    Your SELECT syntax is messed up. The INTO should follow the SELECT. Is this what you are trying to do:
    DECLARE
      V_ENAME     EMP.ENAME%TYPE;
      V_SAL       EMP.SAL%TYPE;
      V_RANK      INTEGER (2);
    BEGIN
      V_RANK := &RN;
      select ENAME,
             SAL,
             RNK
        into V_ENAME,
             V_SAL,
             V_RANK
        from (select ENAME,
                     SAL,
                     dense_rank () over (order by sal desc) AS RNK
                from emp),
             emp
       where RNK = V_RANK;
      DOPL ('EMPLOYEE NAME:' || V_ENAME);
      DOPL ('EMPLOYEE SAL:' || V_SAL);
      DOPL ('EMPLOYEE RANK:' || V_RNK);
    END;By the way, looking at some of your past entries it looks like you have a bad habit of opening a request then never responding to it. You really should mark a entry as closed once it is no longer an issue. Also, if you mark helpful hints and helpful and correct hints as correct it makes people that help you happy and they are more likely going to help you again in the future... just saying.

  • I am unable to get dragging guides from rulers when using CS6 InDesign. Is anybody else getting this problem?

    I am unable to get dragging guides from rulers when using CS6 InDesign. Is anybody else getting this problem?

    Try restoring your InDesign preferences:
    Trash, Replace, Reset, or Restore the application Preferences

  • I am getting a lot of static when using Brookstone wireless headphones and watching movies on the Apple TV. I know it is not headphones, because they work fine when I switch it to cable TV, then the sound is clear with no static. Any suggestions?

    I am getting a lot of static when using Brookstone wireless headphones and watching movies on the Apple TV. I know it is not headphones, because they work fine when I switch it to cable TV, then the sound is clear with no static. Any suggestions? Which wireless headphones work best with the apple TV?

    Ok so I've been doing more testing. It's all videos on the iTunes store. Anytime I try to download a podcast or stream it or anything it's super slow. To download an episode of Diggnation it tells me over 2 hours to download but the time keeps climbing and I just stop the transfer.
    Some people said it's an Open DNS thing? Maybe it is but it's not computer specific and I couldn't find a way to change the DNS settings in my Airport, only on each computer. I tried deleting PLists and restoring my Apple TV and restoring my Airport and nothing is working.
    I don't know if it an issue with me, my ISP or Apple. Anyone else experiencing this problem?

  • ORA-24801 when using Dataset.Fill

    I'm getting and exception ORA-24801 when I call the Dataset Fill method as per the following example.
    The stored procedure takes 3 parameters. This error does not occur when calling another procedure which does not return CLOBs. Any ideas ??
    oCommand.CommandText = "JBS_REPORT_002.Build";
    oCommand.CommandType = CommandType.StoredProcedure;
    OracleDataAdapter da = new OracleDataAdapter(oCommand);
    OracleCommandBuilder builder = new OracleCommandBuilder(da);
    DataSet ds = new DataSet();
    da.Fill(ds);
    Database is 8.1.7

    Thanks for the reply.
    firstly we have not tried on 9.2 and this is not an option.
    Secondly the problem can be replicated without a stored procedure as per follows. If there is a CLOB field it fails.
    string commandStr = "SELECT * FROM MYTABLE";
    OracleDataAdapter adapter = new OracleDataAdapter (commandStr, conn);
    try
    OracleCommandBuilder builder = new OracleCommandBuilder(adapter);
    DataSet ds = new DataSet();
    adapter.Fill(ds,"MYTABLE");
    catch(OracleException e){}

  • How do i get passed the billing step when using my apple id to download apps

    how do i get passed the billing step when using my apple id to download apps on my ipod touch

    DId you enter a valid payment method?

  • 10.9.4: Graphical errors when using OSX functions like Mission Control, Spotlight

    Device: MBP 15" Retina 2.3 GHz Intel i7
    OSX: 10.9.4
    Monitor: 27" Thunderbolt Display
    Issue: When using OSX functions like Mission Control (Expose) and spotlight, I frequently get graphical errors that remain on the desktop unless I reset the computer. I can resolve the issue by adding a new desktop and dragging my windows over.
    This happens almost every day.

    You have installed all these non-Apple system modifications:
    Kernel Extensions: ?
      [loaded] at.obdev.nke.LittleSnitch (4052 - SDK 10.8) Support
      [loaded] com.nvidia.CUDA (1.1.0) Support
      [loaded] com.promise.driver.stex (5.2.7 - SDK 10.9) Support
      [not loaded] com.silabs.driver.CP210xVCPDriver (3.0.0d1) Support
      [not loaded] com.silabs.driver.CP210xVCPDriver64 (3.0.0d1) Support
      [not loaded] com.wacom.kext.pentablet (5.2.6) Support
      [not loaded] com.wacom.kext.wacomtablet (6.3.8 - SDK 10.9) Support
    Litlle snitch has been a bad actor for some users.
    You do not have any CUDA Hardware, so the CUDA Driver is not needed.
    I do not know what siLabs driver thinks it may be driving.
    You left the door open:
    Gatekeeper: ?
      Anywhere

  • Extractvalue giving ORA-00932 when used in PL/SQL

    Hi,
    When I use the extractvalue function from within PL/SQL I get this error:
    ORA-00932: inconsistent datatypes: expected NUMBER got
    SINAPP.body.contentType1898_T
    The same SQL statement run from SQL Plus gives me the correct result. Is there any difference in calling this function from within PL/SQL?
    This is my SQL:
    select extractvalue (value(p),
    '/NewsML/NewsItem/NewsComponent/ContentItem/DataContent/body/body.content')
    into story from sin_xml_cx_temp p where
    extract(value(p),
    '/NewsML/NewsItem/NewsComponent/AdministrativeMetadata/FileName/text()').getStringval() = '39039859.xml';
    The Oracle version we are using is 9.2.0.3
    Here is the XML schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://www.sin.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sin.com" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified">
    <!-- enabling xml:lang attribute -->
    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
    <xs:complexType name="AdministrativeMetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="FileName" type="FileNameType" minOccurs="0"/>
    <xs:element name="SystemIdentifier" type="SystemIdentifierType" minOccurs="0"/>
    <xs:element name="Provider" type="ProviderType" minOccurs="0"/>
    <xs:element name="Creator" type="CreatorType" minOccurs="0"/>
    <xs:element name="Source" type="SourceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Contributor" type="ContributorType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <!-- All attributes are optional by default!!! -->
    </xs:complexType>
    <xs:complexType name="AssociatedWithType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="BasisForChoiceType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Rank" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    <!-- The simpleContent element contains extensions or restrictions on a text-only complex
    type or on a simple type as content and contains no elements. -->
    </xs:complexType>
    <!-- A mixed complex type element can contain attributes, elements, and text -->
    <xs:complexType name="ByLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CatalogType">
    <xs:sequence>
    <xs:element name="Resource" type="ResourceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="TopicUse" type="TopicUseType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CharacteristicsType">
    <xs:sequence>
    <xs:element name="SizeInBytes" type="SizeInBytesType" minOccurs="0"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CommentType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="TranslationOf" type="xs:IDREF"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="ContentItemType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="MediaType" type="MediaTypeType" minOccurs="0"/>
    <xs:element name="Format" type="FormatType" minOccurs="0"/>
    <xs:element name="MimeType" type="MimeTypeType" minOccurs="0"/>
    <xs:element name="Notation" type="NotationType" minOccurs="0"/>
    <xs:element name="Characteristics" type="CharacteristicsType" minOccurs="0"/>
    <xs:choice minOccurs="0">
    <xs:element name="Encoding" type="EncodingType"/>
    <xs:element name="DataContent" type="DataContentType"/>
    </xs:choice>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ContributorType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CopyrightType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="CopyrightHolder" type="CopyrightHolderType"/>
    <xs:element name="CopyrightDate" type="CopyrightDateType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CopyrightDateType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CopyrightHolderType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CopyrightLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CreatorType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CreditLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="DataContentType" mixed="true">
    <xs:sequence>
    <xs:element name="head" type="headType"/>
    <xs:element name="body" type="bodyType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="DateAndTimeType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:element name="DateId" type="xs:string"/>
    <xs:complexType name="DateLabelType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="DateLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="DefaultVocabularyForType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Context" type="xs:string" use="required"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="DeleteType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="DerivedFromType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="DescriptionType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="Variant" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="DescriptiveMetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="Language" type="LanguageType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Genre" type="GenreType" minOccurs="0"/>
    <xs:element name="SubjectCode" type="SubjectCodeType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="OfInterestTo" type="OfInterestToType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="TopicOccurrence" type="TopicOccurrenceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="EncodingType">
    <xs:choice minOccurs="0">
    <xs:element name="Encoding" type="EncodingType"/>
    <xs:element name="DataContent" type="DataContentType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Notation" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="EndDateType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="FileNameType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="FirstCreatedType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="FormalNameType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="FormatType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="FutureStatusType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="GenreType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="GeographyType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="HeadLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="IdentificationType">
    <xs:sequence>
    <xs:element name="NewsIdentifier" type="NewsIdentifierType"/>
    <xs:element name="NameLabel" type="NameLabelType" minOccurs="0"/>
    <xs:element name="DateLabel" type="DateLabelType" minOccurs="0"/>
    <xs:element name="Label" type="LabelType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="InsertAfterType" mixed="true">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="InsertBeforeType" mixed="true">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="InstructionType">
    <xs:sequence>
    <xs:element name="RevisionStatus" type="RevisionStatusType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="KeywordLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="LabelType">
    <xs:sequence>
    <xs:element name="LabelType" type="LabelTypeType"/>
    <xs:element name="LabelText" type="LabelTextType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="LabelTextType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="LabelTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="LanguageType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="LimitationsType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MediaTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="MetadataType" type="MetadataTypeType"/>
    <xs:element name="Property" type="PropertyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MetadataTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MimeTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NameLabelType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="NewsComponentType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicSet" type="TopicSetType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Role" type="RoleType" minOccurs="0"/>
    <xs:element name="BasisForChoice" type="BasisForChoiceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="NewsLines" type="NewsLinesType" minOccurs="0"/>
    <xs:element name="AdministrativeMetadata" type="AdministrativeMetadataType" minOccurs="0"/>
    <xs:element name="RightsMetadata" type="RightsMetadataType" minOccurs="0"/>
    <xs:element name="DescriptiveMetadata" type="DescriptiveMetadataType" minOccurs="0"/>
    <xs:element name="Metadata" type="MetadataType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:choice minOccurs="0">
    <xs:choice maxOccurs="unbounded">
    <xs:element name="NewsItem" type="NewsItemType"/>
    <xs:element name="NewsItemRef" type="NewsItemRefType"/>
    </xs:choice>
    <xs:element name="NewsComponent" type="NewsComponentType" maxOccurs="unbounded"/>
    <xs:element name="ContentItem" type="ContentItemType" maxOccurs="unbounded"/>
    </xs:choice>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Essential" default="no">
    <xs:simpleType>
    <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="yes"/>
    <xs:enumeration value="no"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="EquivalentsList" default="no">
    <xs:simpleType>
    <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="yes"/>
    <xs:enumeration value="no"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="NewsEnvelopeType">
    <xs:sequence>
    <xs:element name="TransmissionId" type="TransmissionIdType" minOccurs="0"/>
    <xs:element name="SentFrom" type="SentFromType" minOccurs="0"/>
    <xs:element name="SentTo" type="SentToType" minOccurs="0"/>
    <xs:element name="DateAndTime" type="DateAndTimeType"/>
    <xs:element name="NewsService" type="NewsServiceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="NewsProduct" type="NewsProductType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Priority" type="PriorityType" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsIdentifierType">
    <xs:sequence>
    <xs:element name="ProviderId" type="ProviderIdType"/>
    <xs:element ref="DateId"/>
    <xs:element name="NewsItemId" type="NewsItemIdType"/>
    <xs:element name="RevisionId" type="RevisionIdType"/>
    <xs:element ref="PublicIdentifier"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NewsItemType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="Identification" type="IdentificationType"/>
    <xs:element name="NewsManagement" type="NewsManagementType"/>
    <xs:choice minOccurs="0">
    <xs:element name="NewsComponent" type="NewsComponentType"/>
    <xs:element name="Update" type="UpdateType" maxOccurs="unbounded"/>
    <xs:element name="TopicSet" type="TopicSetType"/>
    </xs:choice>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="NewsItemIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="NewsItemRefType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsItemTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsLineType">
    <xs:sequence>
    <xs:element name="NewsLineType" type="NewsLineTypeType"/>
    <xs:element name="NewsLineText" type="NewsLineTextType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsLineTextType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="NewsLineTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsLinesType">
    <xs:sequence>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element name="HeadLine" type="HeadLineType"/>
    <xs:element name="SubHeadLine" type="SubHeadLineType" minOccurs="0"/>
    </xs:sequence>
    <xs:element name="ByLine" type="ByLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="DateLine" type="DateLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="CreditLine" type="CreditLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="CopyrightLine" type="CopyrightLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="RightsLine" type="RightsLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="SeriesLine" type="SeriesLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="SlugLine" type="SlugLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="KeywordLine" type="KeywordLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="NewsLine" type="NewsLineType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:element name="NewsML" xdb:defaultTable="SIN_XML_CX_TEMP">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicSet" type="TopicSetType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:sequence>
    <xs:element name="NewsEnvelope" type="NewsEnvelopeType"/>
    <xs:element name="NewsItem" type="NewsItemType" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="NewsManagementType">
    <xs:sequence>
    <xs:element name="NewsItemType" type="NewsItemTypeType"/>
    <xs:element name="FirstCreated" type="FirstCreatedType"/>
    <xs:element name="ThisRevisionCreated" type="ThisRevisionCreatedType"/>
    <xs:element name="Status" type="StatusType"/>
    <xs:element name="StatusWillChange" type="StatusWillChangeType" minOccurs="0"/>
    <xs:element name="Urgency" type="UrgencyType" minOccurs="0"/>
    <xs:element name="RevisionHistory" type="RevisionHistoryType" minOccurs="0"/>
    <xs:element name="DerivedFrom" type="DerivedFromType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="AssociatedWith" type="AssociatedWithType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Instruction" type="InstructionType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsProductType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsServiceType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NotationType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="OfInterestToType">
    <xs:sequence>
    <xs:element name="Relevance" type="RelevanceType" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="OriginType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="PartyType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="Topic" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="PriorityType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="PropertyType">
    <xs:sequence>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    <xs:attribute name="Value" type="xs:string"/>
    <xs:attribute name="ValueRef" type="xs:string"/>
    <xs:attribute name="AllowedValues" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ProviderType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ProviderIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Vocabulary" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:element name="PublicIdentifier" type="xs:string"/>
    <xs:complexType name="RelevanceType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ReplaceType" mixed="true">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="ResourceType">
    <xs:sequence>
    <xs:element name="Urn" type="UrnType" minOccurs="0"/>
    <xs:element name="Url" type="UrlType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="DefaultVocabularyFor" type="DefaultVocabularyForType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RevisionHistoryType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="RevisionIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="PreviousRevision" type="xs:string" use="required"/>
    <xs:attribute name="Update" type="xs:string" use="required"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="RevisionStatusType">
    <xs:sequence>
    <xs:element name="Status" type="StatusType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Revision" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RightsHolderType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RightsLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="RightsMetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="Copyright" type="CopyrightType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="UsageRights" type="UsageRightsType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RoleType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SentFromType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SentToType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SeriesLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="SizeInBytesType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="SlugLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="SourceType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="StartDateType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="StatusType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="StatusWillChangeType">
    <xs:sequence>
    <xs:element name="FutureStatus" type="FutureStatusType"/>
    <xs:element name="DateAndTime" type="DateAndTimeType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubHeadLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="SubjectType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectCodeType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:choice>
    <xs:element name="Subject" type="SubjectType"/>
    <xs:element name="SubjectMatter" type="SubjectMatterType"/>
    <xs:element name="SubjectDetail" type="SubjectDetailType"/>
    </xs:choice>
    <xs:element name="SubjectQualifier" type="SubjectQualifierType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectDetailType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectMatterType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectQualifierType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SystemIdentifierType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="ThisRevisionCreatedType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="TopicType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicType" type="TopicTypeType" maxOccurs="unbounded"/>
    <xs:element name="FormalName" type="FormalNameType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Description" type="DescriptionType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Details" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicOccurrenceType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    <xs:attribute name="Topic" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicSetType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicSetRef" type="TopicSetRefType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Topic" type="TopicType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicSetRefType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="TopicSet" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicUseType">
    <xs:attribute name="Topic" type="xs:string" use="required"/>
    <xs:attribute name="Context" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TransmissionIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Repeat" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="UpdateType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="InsertBefore" type="InsertBeforeType"/>
    <xs:element name="InsertAfter" type="InsertAfterType"/>
    <xs:element name="Replace" type="ReplaceType"/>
    <xs:element name="Delete" type="DeleteType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="UrgencyType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="UrlType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="UrnType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="UsageRightsType">
    <xs:sequence>
    <xs:element name="UsageType" type="UsageTypeType" minOccurs="0"/>
    <xs:element name="Geography" type="GeographyType" minOccurs="0"/>
    <xs:element name="RightsHolder" type="RightsHolderType" minOccurs="0"/>
    <xs:element name="Limitations" type="LimitationsType" minOccurs="0"/>
    <xs:element name="StartDate" type="StartDateType" minOccurs="0"/>
    <xs:element name="EndDate" type="EndDateType" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="UsageTypeType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="bodyType">
    <xs:sequence>
    <xs:element name="body.head" type="body.headType" xdb:SQLName="BODY_HEAD"/>
    <xs:element name="body.content" type="body.contentType" xdb:SQLName="BODY_CONTENT"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="body.contentType">
    <xs:choice maxOccurs="unbounded">
    <xs:element ref="p"/>
    <xs:element ref="pre"/>
    </xs:choice>
    </xs:complexType>
    <xs:complexType name="body.headType">
    <xs:sequence>
    <xs:element ref="distributor"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="distributor" type="xs:string"/>
    <xs:complexType name="headType">
    <xs:sequence>
    <xs:element name="meta" type="metaType" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="metaType">
    <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
    <xs:attribute name="content" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="p" type="xs:string"/>
    <xs:element name="pre" type="xs:string"/>
    </xs:schema>

    Hi,
    When I use the extractvalue function from within PL/SQL I get this error:
    ORA-00932: inconsistent datatypes: expected NUMBER got
    SINAPP.body.contentType1898_T
    The same SQL statement run from SQL Plus gives me the correct result. Is there any difference in calling this function from within PL/SQL?
    This is my SQL:
    select extractvalue (value(p),
    '/NewsML/NewsItem/NewsComponent/ContentItem/DataContent/body/body.content')
    into story from sin_xml_cx_temp p where
    extract(value(p),
    '/NewsML/NewsItem/NewsComponent/AdministrativeMetadata/FileName/text()').getStringval() = '39039859.xml';
    The Oracle version we are using is 9.2.0.3
    Here is the XML schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://www.sin.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sin.com" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified">
    <!-- enabling xml:lang attribute -->
    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
    <xs:complexType name="AdministrativeMetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="FileName" type="FileNameType" minOccurs="0"/>
    <xs:element name="SystemIdentifier" type="SystemIdentifierType" minOccurs="0"/>
    <xs:element name="Provider" type="ProviderType" minOccurs="0"/>
    <xs:element name="Creator" type="CreatorType" minOccurs="0"/>
    <xs:element name="Source" type="SourceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Contributor" type="ContributorType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <!-- All attributes are optional by default!!! -->
    </xs:complexType>
    <xs:complexType name="AssociatedWithType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="BasisForChoiceType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Rank" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    <!-- The simpleContent element contains extensions or restrictions on a text-only complex
    type or on a simple type as content and contains no elements. -->
    </xs:complexType>
    <!-- A mixed complex type element can contain attributes, elements, and text -->
    <xs:complexType name="ByLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CatalogType">
    <xs:sequence>
    <xs:element name="Resource" type="ResourceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="TopicUse" type="TopicUseType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CharacteristicsType">
    <xs:sequence>
    <xs:element name="SizeInBytes" type="SizeInBytesType" minOccurs="0"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CommentType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="TranslationOf" type="xs:IDREF"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="ContentItemType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="MediaType" type="MediaTypeType" minOccurs="0"/>
    <xs:element name="Format" type="FormatType" minOccurs="0"/>
    <xs:element name="MimeType" type="MimeTypeType" minOccurs="0"/>
    <xs:element name="Notation" type="NotationType" minOccurs="0"/>
    <xs:element name="Characteristics" type="CharacteristicsType" minOccurs="0"/>
    <xs:choice minOccurs="0">
    <xs:element name="Encoding" type="EncodingType"/>
    <xs:element name="DataContent" type="DataContentType"/>
    </xs:choice>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ContributorType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CopyrightType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="CopyrightHolder" type="CopyrightHolderType"/>
    <xs:element name="CopyrightDate" type="CopyrightDateType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CopyrightDateType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CopyrightHolderType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CopyrightLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="CreatorType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="CreditLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="DataContentType" mixed="true">
    <xs:sequence>
    <xs:element name="head" type="headType"/>
    <xs:element name="body" type="bodyType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="DateAndTimeType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:element name="DateId" type="xs:string"/>
    <xs:complexType name="DateLabelType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="DateLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="DefaultVocabularyForType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Context" type="xs:string" use="required"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="DeleteType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="DerivedFromType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="DescriptionType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="Variant" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="DescriptiveMetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="Language" type="LanguageType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Genre" type="GenreType" minOccurs="0"/>
    <xs:element name="SubjectCode" type="SubjectCodeType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="OfInterestTo" type="OfInterestToType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="TopicOccurrence" type="TopicOccurrenceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="EncodingType">
    <xs:choice minOccurs="0">
    <xs:element name="Encoding" type="EncodingType"/>
    <xs:element name="DataContent" type="DataContentType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Notation" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="EndDateType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="FileNameType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="FirstCreatedType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="FormalNameType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="FormatType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="FutureStatusType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="GenreType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="GeographyType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="HeadLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="IdentificationType">
    <xs:sequence>
    <xs:element name="NewsIdentifier" type="NewsIdentifierType"/>
    <xs:element name="NameLabel" type="NameLabelType" minOccurs="0"/>
    <xs:element name="DateLabel" type="DateLabelType" minOccurs="0"/>
    <xs:element name="Label" type="LabelType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="InsertAfterType" mixed="true">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="InsertBeforeType" mixed="true">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="InstructionType">
    <xs:sequence>
    <xs:element name="RevisionStatus" type="RevisionStatusType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="KeywordLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="LabelType">
    <xs:sequence>
    <xs:element name="LabelType" type="LabelTypeType"/>
    <xs:element name="LabelText" type="LabelTextType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="LabelTextType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="LabelTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="LanguageType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="LimitationsType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MediaTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="MetadataType" type="MetadataTypeType"/>
    <xs:element name="Property" type="PropertyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MetadataTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="MimeTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NameLabelType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="NewsComponentType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicSet" type="TopicSetType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Role" type="RoleType" minOccurs="0"/>
    <xs:element name="BasisForChoice" type="BasisForChoiceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="NewsLines" type="NewsLinesType" minOccurs="0"/>
    <xs:element name="AdministrativeMetadata" type="AdministrativeMetadataType" minOccurs="0"/>
    <xs:element name="RightsMetadata" type="RightsMetadataType" minOccurs="0"/>
    <xs:element name="DescriptiveMetadata" type="DescriptiveMetadataType" minOccurs="0"/>
    <xs:element name="Metadata" type="MetadataType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:choice minOccurs="0">
    <xs:choice maxOccurs="unbounded">
    <xs:element name="NewsItem" type="NewsItemType"/>
    <xs:element name="NewsItemRef" type="NewsItemRefType"/>
    </xs:choice>
    <xs:element name="NewsComponent" type="NewsComponentType" maxOccurs="unbounded"/>
    <xs:element name="ContentItem" type="ContentItemType" maxOccurs="unbounded"/>
    </xs:choice>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Essential" default="no">
    <xs:simpleType>
    <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="yes"/>
    <xs:enumeration value="no"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="EquivalentsList" default="no">
    <xs:simpleType>
    <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="yes"/>
    <xs:enumeration value="no"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="NewsEnvelopeType">
    <xs:sequence>
    <xs:element name="TransmissionId" type="TransmissionIdType" minOccurs="0"/>
    <xs:element name="SentFrom" type="SentFromType" minOccurs="0"/>
    <xs:element name="SentTo" type="SentToType" minOccurs="0"/>
    <xs:element name="DateAndTime" type="DateAndTimeType"/>
    <xs:element name="NewsService" type="NewsServiceType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="NewsProduct" type="NewsProductType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Priority" type="PriorityType" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsIdentifierType">
    <xs:sequence>
    <xs:element name="ProviderId" type="ProviderIdType"/>
    <xs:element ref="DateId"/>
    <xs:element name="NewsItemId" type="NewsItemIdType"/>
    <xs:element name="RevisionId" type="RevisionIdType"/>
    <xs:element ref="PublicIdentifier"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NewsItemType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="Identification" type="IdentificationType"/>
    <xs:element name="NewsManagement" type="NewsManagementType"/>
    <xs:choice minOccurs="0">
    <xs:element name="NewsComponent" type="NewsComponentType"/>
    <xs:element name="Update" type="UpdateType" maxOccurs="unbounded"/>
    <xs:element name="TopicSet" type="TopicSetType"/>
    </xs:choice>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="NewsItemIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="NewsItemRefType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsItemTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsLineType">
    <xs:sequence>
    <xs:element name="NewsLineType" type="NewsLineTypeType"/>
    <xs:element name="NewsLineText" type="NewsLineTextType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsLineTextType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="NewsLineTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsLinesType">
    <xs:sequence>
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element name="HeadLine" type="HeadLineType"/>
    <xs:element name="SubHeadLine" type="SubHeadLineType" minOccurs="0"/>
    </xs:sequence>
    <xs:element name="ByLine" type="ByLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="DateLine" type="DateLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="CreditLine" type="CreditLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="CopyrightLine" type="CopyrightLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="RightsLine" type="RightsLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="SeriesLine" type="SeriesLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="SlugLine" type="SlugLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="KeywordLine" type="KeywordLineType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="NewsLine" type="NewsLineType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:element name="NewsML" xdb:defaultTable="SIN_XML_CX_TEMP">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicSet" type="TopicSetType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:sequence>
    <xs:element name="NewsEnvelope" type="NewsEnvelopeType"/>
    <xs:element name="NewsItem" type="NewsItemType" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:complexType name="NewsManagementType">
    <xs:sequence>
    <xs:element name="NewsItemType" type="NewsItemTypeType"/>
    <xs:element name="FirstCreated" type="FirstCreatedType"/>
    <xs:element name="ThisRevisionCreated" type="ThisRevisionCreatedType"/>
    <xs:element name="Status" type="StatusType"/>
    <xs:element name="StatusWillChange" type="StatusWillChangeType" minOccurs="0"/>
    <xs:element name="Urgency" type="UrgencyType" minOccurs="0"/>
    <xs:element name="RevisionHistory" type="RevisionHistoryType" minOccurs="0"/>
    <xs:element name="DerivedFrom" type="DerivedFromType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="AssociatedWith" type="AssociatedWithType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Instruction" type="InstructionType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsProductType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NewsServiceType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="NotationType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="OfInterestToType">
    <xs:sequence>
    <xs:element name="Relevance" type="RelevanceType" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="OriginType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="PartyType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="Topic" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="PriorityType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="PropertyType">
    <xs:sequence>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    <xs:attribute name="Value" type="xs:string"/>
    <xs:attribute name="ValueRef" type="xs:string"/>
    <xs:attribute name="AllowedValues" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ProviderType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ProviderIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Vocabulary" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:element name="PublicIdentifier" type="xs:string"/>
    <xs:complexType name="RelevanceType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="ReplaceType" mixed="true">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="DuidRef" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="ResourceType">
    <xs:sequence>
    <xs:element name="Urn" type="UrnType" minOccurs="0"/>
    <xs:element name="Url" type="UrlType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="DefaultVocabularyFor" type="DefaultVocabularyForType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RevisionHistoryType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Href" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="RevisionIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="PreviousRevision" type="xs:string" use="required"/>
    <xs:attribute name="Update" type="xs:string" use="required"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="RevisionStatusType">
    <xs:sequence>
    <xs:element name="Status" type="StatusType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Revision" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RightsHolderType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RightsLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="RightsMetadataType">
    <xs:sequence>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="Copyright" type="CopyrightType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="UsageRights" type="UsageRightsType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RoleType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SentFromType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SentToType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SeriesLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="SizeInBytesType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="SlugLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="SourceType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Party" type="PartyType" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="NewsItem" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="StartDateType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="StatusType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="StatusWillChangeType">
    <xs:sequence>
    <xs:element name="FutureStatus" type="FutureStatusType"/>
    <xs:element name="DateAndTime" type="DateAndTimeType"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubHeadLineType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    </xs:complexType>
    <xs:complexType name="SubjectType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectCodeType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:choice>
    <xs:element name="Subject" type="SubjectType"/>
    <xs:element name="SubjectMatter" type="SubjectMatterType"/>
    <xs:element name="SubjectDetail" type="SubjectDetailType"/>
    </xs:choice>
    <xs:element name="SubjectQualifier" type="SubjectQualifierType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectDetailType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectMatterType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SubjectQualifierType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="SystemIdentifierType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="ThisRevisionCreatedType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="TopicType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicType" type="TopicTypeType" maxOccurs="unbounded"/>
    <xs:element name="FormalName" type="FormalNameType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Description" type="DescriptionType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Details" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicOccurrenceType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    <xs:attribute name="Topic" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicSetType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Catalog" type="CatalogType" minOccurs="0"/>
    <xs:element name="TopicSetRef" type="TopicSetRefType" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Topic" type="TopicType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicSetRefType">
    <xs:sequence>
    <xs:element name="Comment" type="CommentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="TopicSet" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicTypeType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TopicUseType">
    <xs:attribute name="Topic" type="xs:string" use="required"/>
    <xs:attribute name="Context" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="TransmissionIdType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="Repeat" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="UpdateType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="InsertBefore" type="InsertBeforeType"/>
    <xs:element name="InsertAfter" type="InsertAfterType"/>
    <xs:element name="Replace" type="ReplaceType"/>
    <xs:element name="Delete" type="DeleteType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="UrgencyType">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="FormalName" type="xs:string" use="required"/>
    <xs:attribute name="Vocabulary" type="xs:string"/>
    <xs:attribute name="Scheme" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="UrlType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="UrnType">
    <xs:simpleContent>
    <xs:extension base="xs:string">
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    </xs:extension>
    </xs:simpleContent>
    </xs:complexType>
    <xs:complexType name="UsageRightsType">
    <xs:sequence>
    <xs:element name="UsageType" type="UsageTypeType" minOccurs="0"/>
    <xs:element name="Geography" type="GeographyType" minOccurs="0"/>
    <xs:element name="RightsHolder" type="RightsHolderType" minOccurs="0"/>
    <xs:element name="Limitations" type="LimitationsType" minOccurs="0"/>
    <xs:element name="StartDate" type="StartDateType" minOccurs="0"/>
    <xs:element name="EndDate" type="EndDateType" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="UsageTypeType" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="Origin" type="OriginType"/>
    </xs:choice>
    <xs:attribute name="Duid" type="xs:ID"/>
    <xs:attribute name="Euid" type="xs:string"/>
    <xs:attribute ref="xml:lang"/>
    <xs:attribute name="AssignedBy" type="xs:string"/>
    <xs:attribute name="Importance" type="xs:string"/>
    <xs:attribute name="Confidence" type="xs:string"/>
    <xs:attribute name="HowPresent" type="xs:string"/>
    <xs:attribute name="DateAndTime" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="bodyType">
    <xs:sequence>
    <xs:element name="body.head" type="body.headType" xdb:SQLName="BODY_HEAD"/>
    <xs:element name="body.content" type="body.contentType" xdb:SQLName="BODY_CONTENT"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="body.contentType">
    <xs:choice maxOccurs="unbounded">
    <xs:element ref="p"/>
    <xs:element ref="pre"/>
    </xs:choice>
    </xs:complexType>
    <xs:complexType name="body.headType">
    <xs:sequence>
    <xs:element ref="distributor"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="distributor" type="xs:string"/>
    <xs:complexType name="headType">
    <xs:sequence>
    <xs:element name="meta" type="metaType" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="metaType">
    <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
    <xs:attribute name="content" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="p" type="xs:string"/>
    <xs:element name="pre" type="xs:string"/>
    </xs:schema>

  • Why my subqueries all get ORA-00933 when I execute them?

    Everytime I try to run a subquery, I always get the following error:
    [error]
    ORA-00933: SQL command not properly ended
    [error]
    Here are two examples. The 1st is a large one, and the 2nd one is more paired down, because I'm trying to figure out where the error is, but Golden always points to where the subquery begins.
    1st query
    select p1.associate_id, p1.application_id, p1.entity_id, p1.profile_id, p1.language, p1.neutrals, p1.created_date, p1.sf_completed_date,
    p1.completed_time, p1.parent_respondent, p1.parent_aid, p1.attempt, p1.parent_attempt, p1.reported_top1, p1.reported_top2, p1.reported_top3,
    p1.reported_top4, p1.reported_top5, p1.top1, p1.top2, p1.top3, p1.top4, p1.top5
    from sf.profiles p1
    where p1.sf_completed_date < to_date('15-June-2006 00:00:00', 'DD-MM-YYYY HH24:MI:SS')
    and p1.parent_respondent is null
    and p1.parent_aid is null
    and p1.neutrals < 155 in (
    select nvl(max(p2.attempt), 0)
    from sf.profiles p2
    where p2.associate_id = p1.associate_id);2nd query
    select p1.language, pl.neutrals, p1.top1, p1.top2, p1.top3, p1.top4, p1.top5
    from sf.profiles
    where p1.parent_respondent_id is null (
    select nvl(max(p2.attempt), 0)
    from sf.profiles p2
    where p2.associate_id = p1.associate_id);I'm not sure what I'm doing wrong, is there anything that I can read up on to get better at these?
    I found this via Google
    http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96540/queries.htm#2057934
    thanks

    It is because neither of your queries are syntactically valid. You cannot combine operators in the way you are trying to do it.
    I'm not sure aht you are trying to accomplish, but the queries need to be more like:
    select p1.associate_id, p1.application_id, p1.entity_id, p1.profile_id,
           p1.language, p1.neutrals, p1.created_date, p1.sf_completed_date,
           p1.completed_time, p1.parent_respondent, p1.parent_aid, p1.attempt,
           p1.parent_attempt, p1.reported_top1, p1.reported_top2, p1.reported_top3,
           p1.reported_top4, p1.reported_top5, p1.top1, p1.top2, p1.top3, p1.top4,
           p1.top5
    from sf.profiles p1
    where p1.sf_completed_date < to_date('15-June-2006 00:00:00', 'DD-MM-YYYY HH24:MI:SS') and
          p1.parent_respondent is null and
          p1.parent_aid is null and
          p1.neutrals < 155 and
          p1.neutrals in(or possibly =) (select nvl(max(p2.attempt), 0)
                          from sf.profiles p2
                          where p2.associate_id = p1.associate_id);
    select p1.language, pl.neutrals, p1.top1, p1.top2, p1.top3, p1.top4, p1.top5
    from sf.profiles
    where p1.parent_respondent_id is null  and
          p1.something IN(or possibly =)(select nvl(max(p2.attempt), 0)
                                         from sf.profiles p2
                                         where p2.associate_id = p1.associate_id);HTH
    John

  • ORA-12714 when using inline view in PL/SQL

    Oracle 9.2.0.4 on Solaris8(SPARC 64).
    I have stripped and simplify the code:
    create type parent_type as object (parent_col number(10)) not instantiable not final;
    create type sub_type under parent_type (child_col nvarchar2(30));
    create table test (table_col parent_type);
    SQL statement works:
    SELECT a
    FROM
    (select treat(table_col as sub_type).child_col a
    from test)
    ...but the sam statement in PL/SQL returns:
    DECLARE temp_var NVARCHAR2(30);
    BEGIN
    SELECT a
    INTO temp_var
    FROM
    (select treat(table_col as sub_type).child_col a
    from test);
    end;
    ERROR at line 3:
    ORA-06550: line 3, column 8:
    PL/SQL: ORA-12714: invalid national character set specified
    ORA-06550: line 3, column 1:
    PL/SQL: SQL Statement ignored
    SQL> run
    1* select parameter,value from v$nls_parameters where parameter like '%CHARACTERSET%'
    PARAMETER VALUE
    NLS_CHARACTERSET EE8ISO8859P2
    NLS_NCHAR_CHARACTERSET AL16UTF16
    Where do I specify national character set ?
    NLS_LANG=SLOVENIAN_SLOVENIA.EE8ISO8859P2
    ORA_NLS33 is unset (it makes no diference if I set it manually).
    Can anyone reproduce error ?

    I get the error even on 10g. The value for NLS_LANG is:
    AMERICAN_AMERICA.WE8MSWIN1252
    SQL> create type parent_type as object (parent_col number(10)) not instantiable not final;
      2  /
    Type created.
    SQL> create type sub_type under parent_type (child_col nvarchar2(30));
      2  /
    Type created.
    SQL> create table test (table_col parent_type);
    Table created.
    SQL> SELECT a
      2  FROM
      3  (select treat(table_col as sub_type).child_col a
      4  from test)
      5  /
    no rows selected
    SQL> DECLARE temp_var NVARCHAR2(30);
      2  BEGIN
      3  SELECT a
      4  INTO temp_var
      5  FROM
      6  (select treat(table_col as sub_type).child_col a
      7  from test);
      8  end;
      9  /
    SELECT a
    ERROR at line 3:
    ORA-06550: line 3, column 8:
    PL/SQL: ORA-12714: invalid national character set specified
    ORA-06550: line 3, column 1:
    PL/SQL: SQL Statement ignored
    SQL> select * from nls_database_parameters
      2  where parameter like '%CHARACTERSET';
    PARAMETER                      VALUE
    NLS_CHARACTERSET               WE8ISO8859P15
    NLS_NCHAR_CHARACTERSET         AL16UTF16
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    PL/SQL Release 9.2.0.3.0 - Production
    CORE    9.2.0.3.0       Production
    TNS for Solaris: Version 9.2.0.3.0 - Production
    NLSRTL Version 9.2.0.3.0 - Production
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Production
    SQL> create type parent_type as object (parent_col number(10)) not instantiable not final;
      2  /
    Type created.
    SQL> create type sub_type under parent_type (child_col nvarchar2(30));
      2  /
    Type created.
    SQL> create table test (table_col parent_type);
    Table created.
    SQL> SELECT a
      2  FROM
      3  (select treat(table_col as sub_type).child_col a
      4  from test)
      5  /
    no rows selected
    SQL> DECLARE temp_var NVARCHAR2(30);
      2  BEGIN
      3  SELECT a
      4  INTO temp_var
      5  FROM
      6  (select treat(table_col as sub_type).child_col a
      7  from test);
      8  end;
      9  /
    SELECT a
    ERROR at line 3:
    ORA-06550: line 3, column 8:
    PL/SQL: ORA-12714: invalid national character set specified
    ORA-06550: line 3, column 1:
    PL/SQL: SQL Statement ignored
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bi
    PL/SQL Release 10.1.0.2.0 - Production
    CORE    10.1.0.2.0      Production
    TNS for Solaris: Version 10.1.0.2.0 - Production
    NLSRTL Version 10.1.0.2.0 - Production
    SQL> select * from nls_database_parameters
      2  where parameter like '%CHARACTERSET';
    PARAMETER                      VALUE
    NLS_CHARACTERSET               WE8ISO8859P15
    NLS_NCHAR_CHARACTERSET         AL16UTF16
    SQL> disconnect
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - 64bit Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining options
    SQL>

  • Crystal 2011 getting Logon failed IM004 error when using ODBC (RDO)

    I just installed Crystal Reports 2011 on Windows 7 Ultimate SP1.  Sporadically, but way too often (I would estimate about 60% of the time), when I go to set up an ODBC (RDO) connection or refresh an existing report and enter the password, I get the following error:
    Logon failed.
    Details: IM004:[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_Handle_ENV failed
    Other times, it just works, with no changed made.  It seems to work slightly more often when using the SQL Server driver (the one for SQL 2000) as opposed to the SQL Native Client or SQL Server Native Client 10.0 drivers.  But not often enough for that to be the solution.
    I have tested this with a locally installed SQL Server (on the same machine as Crystal Reports) and remote SQL Servers, with SQL 2000, 2005 and 2008.  Same results.
    I have Crystal Reports 2008 installed on the same machine and have not once had this problem.  I have tried using the same ODBC connections I already had from Crystal 2008 with Crystal 2011 and also to create new ones, same results either way.
    Is this a known issue, or is there a switch/setting I need to change to make this work consistently?  I am especially puzzled by the fact that it seems random, I have not been able to find any pattern at all.

    Hi Victoria,
    MS SQL Server 2008 has a client install now, the MDAC/WDAC doesn't install it as MS used to do with all of their OS's. CR also had to update the use of SQL Server 2008 to include the SQLNCLI10 client engine.
    I suggest, if you have not already, install the Native 10 client from either the SQL Server CD or you can download the MSI from MS's site and only use the Native 10 driver.
    MS kind of dropped ODBC and moved to OLE DB. The native client actually uses the OLE DB driver so using ODBC just puts another layer on top of OLE DB anyways. It's more convenient to use ODBC for deploying applications but it can affect performance.
    Anyways, as noted, CR 2011 is still in Ramp up mode so this issue may have been tracked. If not though you can purchase a support case, if it's a bug then you'll get a refund, if it's a limitation in MS then no refund.
    There is [SP 1 for CR 2011|https://smpdl.sap-ag.de/~sapidp/012002523100007683092011E/cr2011sp1.exe] - http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm
    Seems to be a problem with that page right now so try again later... and apply SP 1 or wait until it goes GA and test again. If it's still an issue then you can log a case.
    Firefox just got updated and it's failing, IE works though...
    Thanks again
    Don
    Edited by: Don Williams on Jun 22, 2011 8:51 AM

  • Invalid number error when using case when

    I have table called NATIONAL_RARE_ECOSYSTEMS which has 1 column called TEST_COLUMN (data type: varchar2):
    TEST_COLUMN
    rare ecosystem
    rare
    0
    0
    (null)
    (null)
    what I want is a query which will add a column called NRE_SCORE which will give each row instance a score of 0 if it null.
    If it is 0 then score should be 0.
    If the row contains any text then score should be 1
    I have written the query:
    SELECT
    (CASE WHEN test_column is null THEN 0
    WHEN test_column = 0 THEN 0
    WHEN test_column > 0 THEN 1
    END) AS NRE_SCORE
    FROM NATIONAL_RARE_ECOSYSTEMS;
    I get the error message:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    I think this is because on the 2nd and 3rd line I'm trying to do arithmetic on a column which is varchar2 which I know I cant do.
    How do I write a query which says: if the row contains text then give score of 1?
    I'm using oracle 11g.

    Hi,
    993451 wrote:
    I have table called NATIONAL_RARE_ECOSYSTEMS which has 1 column called TEST_COLUMN (data type: varchar2):
    TEST_COLUMN
    rare ecosystem
    rare
    0
    0
    (null)
    (null)
    what I want is a query which will add a column called NRE_SCORE which will give each row instance a score of 0 if it null.
    If it is 0 then score should be 0.
    If the row contains any text then score should be 1Any text other than '0', you mean. I assume it doesn't matter if that text happens to be all digits, such as '9876', or something with no digits, such as 'rare'.
    I have written the query:
    SELECT
    (CASE WHEN test_column is null THEN 0
    WHEN test_column = 0 THEN 0
    WHEN test_column > 0 THEN 1
    END) AS NRE_SCORE
    FROM NATIONAL_RARE_ECOSYSTEMS;
    I get the error message:
    ORA-01722: invalid number
    01722. 00000 - "invalid number"
    I think this is because on the 2nd and 3rd line I'm trying to do arithmetic on a column which is varchar2 which I know I cant do.You're actually not doing any arithmetic, but you are comparing your VARCHAR2 column to a NUMBER, so it tries to convert the string to a NUMBER, and that's why you get the ORA-01722 error.
    >
    How do I write a query which says: if the row contains text then give score of 1?
    I'm using oracle 11g.Here's one way:
    SELECT       CASE
               WHEN  NVL (test_column, '0') = '0'
               THEN  0
               ELSE  1
           END          AS nre_score
    ,       ...          -- you must want other columns, too
    FROM       national_rare_ecosystems
    ;Since you don't really care about the numeric value, don't use NUMBERs anywhere; stick with VARCHAR2s, such as '0'.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the query above is getting the wrong results, and explain, using specific examples, how you get those results from the sample data in those palces.
    See the forum FAQ {message:id=9360002}

Maybe you are looking for