How to prohibit leading and traling whitespace in XML Schema

I want to prohibit the use of leading and trailing whitespace in an element but besides that all other content is allowed.
For examble <   word? > should give a validation error.
I do not want to use
<whiteSpace value="collapse"/>
Because it doesn't give a validation error.
Is it possible to make a pattern og in some other way solve my problem?
Thanks in advance, Martin

Here is an example schema snippet (not a complete schema!) that does what you want I think, using a regular expresssion pattern, allowing one or more non-white-space characters followed by an optional sequence of any character followed by one or more non-white-space characters:
Code Snippet
        <xs:element name="foo" maxOccurs="unbounded">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:pattern value="\S+(.*\S+)*"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
Here are some example elements with valid contents:
Code Snippet
  <foo>a</foo>
  <foo>a b</foo>
  <foo>a b c d e f g</foo>
And here some elements with invalid contents that validation would catch:
Code Snippet
  <foo> a</foo>
  <foo>a </foo>

Similar Messages

  • How to get emp and dept tables of scott schema if they acdientally deleted

    Hii I accedentally modifiled emp and dept tables in scott schema.... Can you please tell how to recreate fresh emp and dept tables ? is there any way to get emp and dept tables? please help regarding this

    If you are on Oracle 10g version...
    The demo tableds under scott schema can be created using oracle supplied script.
    http://www.oracle.com/technology/sample_code/tech/sql_plus/htdocs/demobld.html
    Alternatively, this script exists in $ORACLE_HOME/sqlplus/demo directory.
    vr,
    Sudhakar B.

  • How do i create and write to an xml file?

    I know there are methods to create nodes and such but I am not at all familiar with xml. Isn't an easier way just to use the File class to create the file and use the write method to write to the xml file? Thank you.

    tsith wrote:
    <replies>
    <reply>
    <sentence>
    <pronoun>It</pronoun>
    <verb>is</verb>
    </sentence>
    </reply>
    </replies>
    Piddle! Try this: open up Microsoft Word, write "Hello, world!" and save it as XML:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <?mso-application progid="Word.Document"?>
    <w:wordDocument
        xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"
        xmlns:v="urn:schemas-microsoft-com:vml"
        xmlns:w10="urn:schemas-microsoft-com:office:word"
        xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"
        xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
        xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"
        xmlns:o="urn:schemas-microsoft-com:office:office"
        xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
        xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2"
        w:macrosPresent="no"
        w:embeddedObjPresent="no"
        w:ocxPresent="no"
        xml:space="preserve">
        <w:ignoreElements w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2"/>
        <o:DocumentProperties>
            <o:Title>Hello, world</o:Title>
            <o:Author>BDLH</o:Author>
            <o:LastAuthor>BDLH</o:LastAuthor>
            <o:Revision>1</o:Revision>
            <o:TotalTime>0</o:TotalTime>
            <o:Created>2008-09-19T17:37:00Z</o:Created>
            <o:LastSaved>2008-09-19T17:37:00Z</o:LastSaved>
            <o:Pages>1</o:Pages>
            <o:Words>2</o:Words>
            <o:Characters>12</o:Characters>
            <o:Company>Weight Watchers</o:Company>
            <o:Lines>1</o:Lines>
            <o:Paragraphs>1</o:Paragraphs>
            <o:CharactersWithSpaces>13</o:CharactersWithSpaces>
            <o:Version>11.0000</o:Version>
        </o:DocumentProperties>
        <w:fonts>
            <w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/>
        </w:fonts>
        <w:styles>
            <w:versionOfBuiltInStylenames w:val="4"/>
            <w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/>
            <w:style w:type="paragraph" w:default="on" w:styleId="Normal">
                <w:name w:val="Normal"/>
                <w:rPr>
                    <wx:font wx:val="Times New Roman"/>
                    <w:sz w:val="24"/>
                    <w:sz-cs w:val="24"/>
                    <w:lang w:val="EN-US" w:fareast="EN-US" w:bidi="AR-SA"/>
                </w:rPr>
            </w:style>
            <w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont">
                <w:name w:val="Default Paragraph Font"/>
                <w:semiHidden/>
            </w:style>
            <w:style w:type="table" w:default="on" w:styleId="TableNormal">
                <w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/>
                <w:semiHidden/>
                <w:rPr>
                    <wx:font wx:val="Times New Roman"/>
                </w:rPr>
                <w:tblPr>
                    <w:tblInd w:w="0" w:type="dxa"/>
                    <w:tblCellMar>
                        <w:top w:w="0" w:type="dxa"/>
                        <w:left w:w="108" w:type="dxa"/>
                        <w:bottom w:w="0" w:type="dxa"/>
                        <w:right w:w="108" w:type="dxa"/>
                    </w:tblCellMar>
                </w:tblPr>
            </w:style>
            <w:style w:type="list" w:default="on" w:styleId="NoList">
                <w:name w:val="No List"/>
                <w:semiHidden/>
            </w:style>
        </w:styles>
        <w:docPr>
            <w:view w:val="print"/>
            <w:zoom w:percent="100"/>
            <w:doNotEmbedSystemFonts/>
            <w:proofState w:spelling="clean" w:grammar="clean"/>
            <w:attachedTemplate w:val=""/>
            <w:defaultTabStop w:val="720"/>
            <w:punctuationKerning/>
            <w:characterSpacingControl w:val="DontCompress"/>
            <w:optimizeForBrowser/>
            <w:validateAgainstSchema/>
            <w:saveInvalidXML w:val="off"/>
            <w:ignoreMixedContent w:val="off"/>
            <w:alwaysShowPlaceholderText w:val="off"/>
            <w:compat>
                <w:breakWrappedTables/>
                <w:snapToGridInCell/>
                <w:wrapTextWithPunct/>
                <w:useAsianBreakRules/>
                <w:dontGrowAutofit/>
            </w:compat>
            <wsp:rsids>
                <wsp:rsidRoot wsp:val="0077226E"/>
                <wsp:rsid wsp:val="0077226E"/>
            </wsp:rsids>
        </w:docPr>
        <w:body>
            <wx:sect>
                <w:p wsp:rsidR="0077226E" wsp:rsidRDefault="0077226E">
                    <w:r>
                        <w:t>Hello, world!</w:t>
                    </w:r>
                </w:p>
                <w:sectPr wsp:rsidR="0077226E">
                    <w:pgSz w:w="12240" w:h="15840"/>
                    <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/>
                    <w:cols w:space="708"/>
                    <w:docGrid w:line-pitch="360"/>
                </w:sectPr>
            </wx:sect>
        </w:body>
    </w:wordDocument>

  • How can i change a xmltype column's xml schema?

    i create a table that have a xmltype column.this column is schema-based.
    my problem is ,
    now i want to this column's schema will be redefined to a global schema?
    [b]how can i change the column's schema which already have a schema?

    When a schema is registered a lot of additonal annotations are added to the XML schema by the schema registration process - Look at the version of the XML schema under /sys/schemas/... in the XML DB repository. This information is unqiue to that version of the XML schema and is used internally to manage instance level metadata.
    When instance documents are stored in the DB a set of metadata is generated for each document so that we can make sure that we can maintain DOM Fidelity. This metadata is tied directly to the XML schema the document is associated and is only valid in the context of that XML Schema.
    So when the schema is registered locally and instances are stored the generated metadata is only valid in the context of the local schema. If the same schema is now registered globally new values will be generated for the annotations applied to the global version of the XML schema. Consequently the metadata associated with a document belonging to the local version of the XML schema has no meaning when viewed in the context of the global version of the XML schema.
    The net effect of this is that you will need to copy the data in order to get documents where the metadata for each document is based on the global version of the XML SChema.

  • How can I find and edit the rss.xml feed made my iWed and .Mac?

    I need to edit my rss.xml made by iWeb and .Mac so I can redirect iTunes to a my new rss from feedburner. Please advise.
    Thank you.

    What's your URL?

  • Remove leading and trailing puncation

    What's the best way to remove leading/trailing puncation from a word? Trim is good for leading and trailing whitespace but can I do anything for leading and trailing punctuation. I need punctuation that's in the middle of a word.

    one way would be to create an array of characters that include all the common punctuation marks. Then, using an iterative loop, compare each char in the file with each char from the array. If a match is found, then the file char is punctuation.

  • How open and edit the coherence.xml file?

    How can I open and edit the coherence.xml file?
    I cannot find the coherence.xml file in the coherence.jar package.
    Thank you,
    June

    If you are intent on changing the coherence.xml file, then you could use the JAR command (that comes with Java) to extract the coherence.xml file from coherence.jar and the later repackage the coherence.jar file using the udpated coherence.xml file, e.g.:
    C:\java\opt\coherence-331\lib>jar -xvf coherence.jar tangosol-coherence.xmlextracted: tangosol-coherence.xml>
    Instead of using JAR, on Windows you can associate the .JAR, .WAR and .EAR extensions with WinZip and use it to access / modify the contents of JAR files.
    However, the suggested approach is as follows, and does not include any changes to the tangosol.jar file:
    The tangosol-coherence-override-dev.xml file can be found in the coherence.jar file. After editing this file (in this case to define a unique value for the port system-property value for the multicast listener), save the file and add it to the server's classpath. When the server is executed, the values in the tangosol-coherence-override-dev.xml file will override any corresponding settings in the tangosol-coherence.xml file.Peace,
    Cameron Purdy | Oracle Coherence

  • How to identify objects created by registering xml schema

    Hi Everyone,
    We are using Oracle 9i Rel2. I have registered an XML schema and I saw that there were several objects created for it table ,some types and a trigger . For some build purposes I want to exclude all of these objects which are associated with xml schema and should be able to drop and recreate the whole of oracle schema.
    I see the user_types table does not have any parameter to indicate that these are autogenerated or are different. In user_types they look like any other type that a user would have created. Do any of you know how to differentiate these types created by registering XML schemas from the normal types.
    Thanks for your help

    There is no way I know of to differentiate between a type created by Schema Registration and another Type. You can query the XML Schema itslef to get the Typenames it relies on.
    SQL> --
    SQL> SQL> select nvl(extractvalue
    2 (
    3 value(ct),
    4 '/xs:complexType/@name',
    5 'xmlns:xs="http://www.w3.org/2001/XMLSchema"
    6 xmlns:xdb="http://xmlns.oracle.com/xdb"'
    7 ),'Local Complex Type') COMPLEX_TYPE,
    8 extractvalue
    9 (
    10 value(ct),
    11 '/xs:complexType/@xdb:SQLType',
    12 'xmlns:xs="http://www.w3.org/2001/XMLSchema"
    13 xmlns:xdb="http://xmlns.oracle.com/xdb"'
    14 ) SQL_TYPE
    15 from user_xml_schemas,
    16 table
    17 (
    18 xmlsequence
    19 (
    20 extract
    21 (
    22 schema,
    23 '//xs:complexType',
    24 'xmlns:xs="http://www.w3.org/2001/XMLSchema"
    25 xmlns:xdb="http://xmlns.oracle.com/xdb"'
    26 )
    27 )
    28 ) ct
    29 /
    COMPLEX_TYPE
    SQL_TYPE
    PurchaseOrderType
    PURCHASEORDER_T
    LineItemsType
    LINEITEMS_T
    LineItemType
    LINEITEM_T
    COMPLEX_TYPE
    SQL_TYPE
    PartType
    PART_T
    ActionsType
    ACTIONS_T
    Local Complex Type
    ACTION_T
    COMPLEX_TYPE
    SQL_TYPE
    RejectionType
    REJECTION_T
    ShippingInstructionsType
    SHIPPING_INSTRUCTIONS_T
    Local Complex Type
    ROOT_T
    COMPLEX_TYPE
    SQL_TYPE
    Local Complex Type
    P222_T
    10 rows selected.
    SQL>

  • How to Update an XML schema..

    Hi All,
    I am new to XML concept. I have a requirement to create a xml schema which will be updated on a weekly basis and a table which associated to the created xml schema.. when ever the Schema is updated the table should not get affected.. Is there a way to solve my problem.. Kindly help me.
    I am using the following client:
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 31 11:44:59 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ////////////////////////////////// XML Schema ///////////////////////
    begin
    dbms_xmlschema.registerSchema(
    'http://www.oradev.com/chipsxml1.xsd',
    '<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oradev.com/chipsxml1.xsd"
    xmlns:samp="http://www.oradev.com/chipsxml1.xsd"
    version="1.0">
    <element name="HICC">
    <complexType>
    <sequence>
         <element name="UTI">
              <complexType>
              <sequence>
              <element name = "U01" type = "string"/>
              <element name = "U02" type = "string"/>
              <element name = "U03" type = "string"/>
              <element name = "U03a" type = "string"/>
              <element name = "U03b" type = "string"/>
              <element name = "U03c" type = "string"/>          
              <element name = "U04" type = "string"/>                    
              <element name = "U05" type = "string"/>                    
              </sequence>
              </complexType>
         </element>
         <element name="SSI">
              <complexType>
              <sequence>
              <element name = "S01" type = "string"/>
              <element name = "S02" type = "string"/>
              <element name = "S02A" type = "string"/>
              <element name = "S02B" type = "string"/>
              <element name = "S02C" type = "string"/>          
              </sequence>
              </complexType>
         </element>
    </sequence>
    </complexType>
    </element>
    </schema>',
    TRUE, TRUE, FALSE, FALSE);
    end;
    ////////////////////////// Table which has multiple Column //////////////////////////
    CREATE TABLE chipsxmltable2 (
    id number, HICCXMLDATA XmlType)
    XMLTYPE HICCXMLDATA STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.oradev.com/chipsxml1.xsd"
    ELEMENT "HICC";
    ///////////////////////////////// Insert Query in chipsxmltable //////////////////////////
    INSERT INTO chipsxmltable2 VALUES(1,
    xmltype.createxml('<?xml version="1.0"?>
    <samp:HICC xmlns:samp="http://www.oradev.com/chipsxml1.xsd" >
    <UTI>
    <U01>No</U01>
    <U02>Y</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>     
    <U04>Y</U04>
    <U05>Y</U05>          
    </UTI>
    <SSI>
    <S01>No</S01>
    <S02>Y</S02>
    <S02A>Y</S02A>
    <S02B>Y</S02B>
    <S02C>Y</S02C>
    </SSI>
    </samp:HICC>'));
    //////// This is my Revised XML Schema ///////////////////////
    begin
    dbms_xmlschema.registerSchema(
    'http://www.oradev.com/Rchipsxml1.xsd',
    '<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oradev.com/Rchipsxml1.xsd"
    xmlns:samp="http://www.oradev.com/Rchipsxml1.xsd"
    version="1.0">
    <element name="HICC">
    <complexType>
    <sequence>
         <element name="UTI">
              <complexType>
              <sequence>
              <element name = "U01" type = "string"/>
              <element name = "U02" type = "string"/>
              <element name = "U03" type = "string"/>
              <element name = "U03a" type = "string"/>
              <element name = "U03b" type = "string"/>
              <element name = "U03c" type = "string"/>          
              <element name = "U04" type = "string"/>                    
              <element name = "U05" type = "string"/>                    
              </sequence>
              </complexType>
         </element>
    </sequence>
    </complexType>
    </element>
    </schema>',
    TRUE, TRUE, FALSE, FALSE);
    end;
    My question is:
    How to update schema without affecting my table and the data which has already in the table?
    Apologies if the description is not clear. Kindly let me know if further details are needed. Many thanks for your help.
    Very best regards,
    Godwin Jebakumar C.V.
    Thanks in advance,
    Godwin Jebakumar

    Duplicate thread : {thread:id=2171878}
    Please mark this one as "answered".

  • Has anybody tried creating and validating a XML doc with XML Schema?

    Hi,
    Has anybody tried creating and validating a XML doc with XML Schema?

    With XMLBeans, an XML document may be created from and validated with an XML schema.

  • How do I Identify Lead and Lag in consecutive dates with multiple values?

    I am using:
    Oracle SQL Developer (3.0.04)
    Build MAin-04.34
    Oracle Database 11g
    Enterprise Edition 11.2.0.1.0 - 64bit Production
    I would like to identify the Lead and Lags based on two groups.
    The groupping is that multiple C_ID can be found in a Single W_ID
    and that multiple D_VAL can be found in C_ID
    So I would like to identify and mark with "Lead" and "Lag" related to the "consecutivedaysc" (this already matches the D_VAL and C_ID very well) for example W_ID 2004 has C_ID 2059 with D_VAL of 44 for April 2 & 3, the consecutive days are 2 and I would like to correctly mark April 2 as the Lead and April 3 as the lag.
    Then I would like to mark the "Lead" and "Lag" independent of if there are multiple D_VAL on the same W_ID
    Example that I am having trouble with:
    W_ID 2285 on April 10 for C_ID 7847, I don't understand whay I can't get "Lag" in stead of a "Lead" realted to the consecutivedaysw
    I would like to eventually have it that the data gets summarized based on W_ID and sinlge (non-repeating) dt with Lead and Lags.
    table
    with t as (
    select 4592 U_KEY,0 D_VAL_PRESENT,2004 W_ID,to_date('4/1/2013','mm-dd-yyyy') dt,2059 C_ID, (null) D_VAL,0 GWID,13 GCID,1 CONSECUTIVEDAYSC,1 CONSECUTIVEDAYSW from dual union all
    select 4591,1,2004,to_date('4/2/2013','mm-dd-yyyy'),2059,44,1,11,2,13 from dual union all
    select 4590,1,2004,to_date('4/3/2013','mm-dd-yyyy'),2059,44,1,11,2,13 from dual union all
    select 4589,1,2004,to_date('4/4/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4588,1,2004,to_date('4/5/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4587,1,2004,to_date('4/6/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4586,1,2004,to_date('4/7/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4585,1,2004,to_date('4/8/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4584,1,2004,to_date('4/9/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4583,1,2004,to_date('4/10/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4582,1,2004,to_date('4/11/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4581,1,2004,to_date('4/12/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4580,1,2004,to_date('4/13/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 4579,1,2004,to_date('4/14/2013','mm-dd-yyyy'),2059,389,1,0,11,13 from dual union all
    select 1092,0,2686,to_date('4/1/2013','mm-dd-yyyy'),7210,(null),0,11,3,3 from dual union all
    select 3416,0,2686,to_date('4/1/2013','mm-dd-yyyy'),7211,(null),0,11,3,3 from dual union all
    select 18118,0,2686,to_date('4/1/2013','mm-dd-yyyy'),17391,(null),0,11,3,3 from dual union all
    select 1091,0,2686,to_date('4/2/2013','mm-dd-yyyy'),7210,(null),0,11,3,3 from dual union all
    select 3415,0,2686,to_date('4/2/2013','mm-dd-yyyy'),7211,(null),0,11,3,3 from dual union all
    select 18117,0,2686,to_date('4/2/2013','mm-dd-yyyy'),17391,(null),0,11,3,3 from dual union all
    select 1090,0,2686,to_date('4/3/2013','mm-dd-yyyy'),7210,(null),0,11,3,3 from dual union all
    select 3414,0,2686,to_date('4/3/2013','mm-dd-yyyy'),7211,(null),0,11,3,3 from dual union all
    select 18116,0,2686,to_date('4/3/2013','mm-dd-yyyy'),17391,(null),0,11,3,3 from dual union all
    select 1089,1,2686,to_date('4/4/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3413,1,2686,to_date('4/4/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18115,1,2686,to_date('4/4/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1088,1,2686,to_date('4/5/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3412,1,2686,to_date('4/5/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18114,1,2686,to_date('4/5/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1087,1,2686,to_date('4/6/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3411,1,2686,to_date('4/6/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18113,1,2686,to_date('4/6/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1086,1,2686,to_date('4/7/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3410,1,2686,to_date('4/7/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18112,1,2686,to_date('4/7/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1085,1,2686,to_date('4/8/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3409,1,2686,to_date('4/8/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18111,1,2686,to_date('4/8/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1084,1,2686,to_date('4/9/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3408,1,2686,to_date('4/9/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18110,1,2686,to_date('4/9/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1083,1,2686,to_date('4/10/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3407,1,2686,to_date('4/10/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18109,1,2686,to_date('4/10/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1082,1,2686,to_date('4/11/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3406,1,2686,to_date('4/11/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18108,1,2686,to_date('4/11/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1081,1,2686,to_date('4/12/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3405,1,2686,to_date('4/12/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18107,1,2686,to_date('4/12/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1080,1,2686,to_date('4/13/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3404,1,2686,to_date('4/13/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18106,1,2686,to_date('4/13/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 1079,1,2686,to_date('4/14/2013','mm-dd-yyyy'),7210,51,9,0,11,11 from dual union all
    select 3403,1,2686,to_date('4/14/2013','mm-dd-yyyy'),7211,51,9,0,11,11 from dual union all
    select 18105,1,2686,to_date('4/14/2013','mm-dd-yyyy'),17391,51,9,0,11,11 from dual union all
    select 17390,1,3034,to_date('4/1/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 17389,1,3034,to_date('4/2/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 17388,1,3034,to_date('4/3/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 17387,1,3034,to_date('4/4/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 17386,1,3034,to_date('4/5/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 7305,1,3034,to_date('4/6/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17385,1,3034,to_date('4/6/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14123,1,3034,to_date('4/6/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual union all
    select 17384,1,3034,to_date('4/7/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 17383,1,3034,to_date('4/8/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 7302,1,3034,to_date('4/9/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17382,1,3034,to_date('4/9/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14120,1,3034,to_date('4/9/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual union all
    select 7301,1,3034,to_date('4/10/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17381,1,3034,to_date('4/10/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14119,1,3034,to_date('4/10/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual union all
    select 7300,1,3034,to_date('4/11/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17380,1,3034,to_date('4/11/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14118,1,3034,to_date('4/11/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual union all
    select 7299,1,3034,to_date('4/12/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17379,1,3034,to_date('4/12/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14117,1,3034,to_date('4/12/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual union all
    select 7298,1,3034,to_date('4/13/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17378,1,3034,to_date('4/13/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14116,1,3034,to_date('4/13/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual union all
    select 7297,1,3034,to_date('4/14/2013','mm-dd-yyyy'),5394,44,0,0,7,14 from dual union all
    select 17377,1,3034,to_date('4/14/2013','mm-dd-yyyy'),5395,298,0,0,14,14 from dual union all
    select 14115,1,3034,to_date('4/14/2013','mm-dd-yyyy'),22421,44,0,0,7,14 from dual
    )the script that I am using:
    select
    t.*/
    case
      when lag(dt) over(partition by c_id, d_val order by dt, u_key)+1 = dt
        then'Lag'
      when lead(dt) over(partition by c_id, d_val order by dt, u_key)-1 = dt
        then 'Lead_1'
      when consecutivedaysc = 1
        then'Lead_3'
      else 'wrong'
    end LeadLagD_VAL,
    case
      when lag(dt) over(partition by w_id, c_id, d_val_present,gwid order by dt)+1 = dt
        then'Lag'
      when lead(dt) over(partition by w_id, c_id, d_val_present, gwid order by dt)-1 = dt
        then 'Lead_A'
      when consecutivedaysw = 1
        then 'Lead_B'
      else 'wrong'
    end Lead_Lag2
    from t
    order by
    W_ID,
    dt asc,
    C_ID asc
    ;the results should look like this (but haveing issues)
    u_key     D_VAL_PRESENT     W_ID     C_ID          DT          D_VAL     GWID     GCID     CONSECUTIVEDAYSC     CONSECUTIVEDAYSW     LEADLAGD_VAL     LEAD_LAG2
    4592     0          2004     2059          01-APR-13          0     13     1               1               Lead_1          Lead_A
    4591     1          2004     2059          02-APR-13     44     1     11     2               13               Lead_1          Lead_A
    4590     1          2004     2059          03-APR-13     44     1     11     2               13               Lag          Lag
    4589     1          2004     2059          04-APR-13     389     1     0     11               13               Lead_1          Lag
    4588     1          2004     2059          05-APR-13     389     1     0     11               13               Lag          Lag
    4587     1          2004     2059          06-APR-13     389     1     0     11               13               Lag          Lag
    4586     1          2004     2059          07-APR-13     389     1     0     11               13               Lag          Lag
    4585     1          2004     2059          08-APR-13     389     1     0     11               13               Lag          Lag
    4584     1          2004     2059          09-APR-13     389     1     0     11               13               Lag          Lag
    4583     1          2004     2059          10-APR-13     389     1     0     11               13               Lag          Lag
    4582     1          2004     2059          11-APR-13     389     1     0     11               13               Lag          Lag
    4581     1          2004     2059          12-APR-13     389     1     0     11               13               Lag          Lag
    4580     1          2004     2059          13-APR-13     389     1     0     11               13               Lag          Lag
    4579     1          2004     2059          14-APR-13     389     1     0     11               13               Lag          Lag
    1092     0          2686     7210          01-APR-13          0     11     3               3               Lead_1          Lead_A
    3416     0          2686     7211          01-APR-13          0     11     3               3               Lead_1          Lead_A
    18118     0          2686     17391          01-APR-13          0     11     3               3               Lead_1          Lead_A
    1091     0          2686     7210          02-APR-13          0     11     3               3               Lag          Lag
    3415     0          2686     7211          02-APR-13          0     11     3               3               Lag          Lag
    18117     0          2686     17391          02-APR-13          0     11     3               3               Lag          Lag
    1090     0          2686     7210          03-APR-13          0     11     3               3               Lag          Lag
    3414     0          2686     7211          03-APR-13          0     11     3               3               Lag          Lag
    18116     0          2686     17391          03-APR-13          0     11     3               3               Lag          Lag
    1089     1          2686     7210          04-APR-13     51     9     0     11               11               Lead_1          Lead_A
    3413     1          2686     7211          04-APR-13     51     9     0     11               11               Lead_1          Lead_A
    18115     1          2686     17391          04-APR-13     51     9     0     11               11               Lead_1          Lead_A
    1088     1          2686     7210          05-APR-13     51     9     0     11               11               Lag          Lag
    3412     1          2686     7211          05-APR-13     51     9     0     11               11               Lag          Lag
    18114     1          2686     17391          05-APR-13     51     9     0     11               11               Lag          Lag
    1087     1          2686     7210          06-APR-13     51     9     0     11               11               Lag          Lag
    3411     1          2686     7211          06-APR-13     51     9     0     11               11               Lag          Lag
    18113     1          2686     17391          06-APR-13     51     9     0     11               11               Lag          Lag
    1086     1          2686     7210          07-APR-13     51     9     0     11               11               Lag          Lag
    3410     1          2686     7211          07-APR-13     51     9     0     11               11               Lag          Lag
    18112     1          2686     17391          07-APR-13     51     9     0     11               11               Lag          Lag
    1085     1          2686     7210          08-APR-13     51     9     0     11               11               Lag          Lag
    3409     1          2686     7211          08-APR-13     51     9     0     11               11               Lag          Lag
    18111     1          2686     17391          08-APR-13     51     9     0     11               11               Lag          Lag
    1084     1          2686     7210          09-APR-13     51     9     0     11               11               Lag          Lag
    3408     1          2686     7211          09-APR-13     51     9     0     11               11               Lag          Lag
    18110     1          2686     17391          09-APR-13     51     9     0     11               11               Lag          Lag
    1083     1          2686     7210          10-APR-13     51     9     0     11               11               Lag          Lag
    3407     1          2686     7211          10-APR-13     51     9     0     11               11               Lag          Lag
    18109     1          2686     17391          10-APR-13     51     9     0     11               11               Lag          Lag
    1082     1          2686     7210          11-APR-13     51     9     0     11               11               Lag          Lag
    3406     1          2686     7211          11-APR-13     51     9     0     11               11               Lag          Lag
    18108     1          2686     17391          11-APR-13     51     9     0     11               11               Lag          Lag
    1081     1          2686     7210          12-APR-13     51     9     0     11               11               Lag          Lag
    3405     1          2686     7211          12-APR-13     51     9     0     11               11               Lag          Lag
    18107     1          2686     17391          12-APR-13     51     9     0     11               11               Lag          Lag
    1080     1          2686     7210          13-APR-13     51     9     0     11               11               Lag          Lag
    3404     1          2686     7211          13-APR-13     51     9     0     11               11               Lag          Lag
    18106     1          2686     17391          13-APR-13     51     9     0     11               11               Lag          Lag
    1079     1          2686     7210          14-APR-13     51     9     0     11               11               Lag          Lag
    3403     1          2686     7211          14-APR-13     51     9     0     11               11               Lag          Lag
    18105     1          2686     17391          14-APR-13     51     9     0     11               11               Lag          Lag
    17390     1          3034     5395          01-APR-13     298     0     0     14               14               Lead_1          Lead_A
    17389     1          3034     5395          02-APR-13     298     0     0     14               14               Lag          Lag
    17388     1          3034     5395          03-APR-13     298     0     0     14               14               Lag          Lag
    17387     1          3034     5395          04-APR-13     298     0     0     14               14               Lag          Lag
    17386     1          3034     5395          05-APR-13     298     0     0     14               14               Lag          Lag
    7305     1          3034     5394          06-APR-13     44     0     0     7               14               Lead_1          Lag
    17385     1          3034     5395          06-APR-13     298     0     0     14               14               Lag          Lag
    14123     1          3034     22421          06-APR-13     44     0     0     7               14               Lead_1          Lag
    17384     1          3034     5395          07-APR-13     298     0     0     14               14               Lag          Lag
    17383     1          3034     5395          08-APR-13     298     0     0     14               14               Lag          Lag
    7302     1          3034     5394          09-APR-13     44     0     0     7               14               Lead_1          Lag
    17382     1          3034     5395          09-APR-13     298     0     0     14               14               Lag          Lag
    14120     1          3034     22421          09-APR-13     44     0     0     7               14               Lead_1          Lag
    7301     1          3034     5394          10-APR-13     44     0     0     7               14               Lag          Lag
    17381     1          3034     5395          10-APR-13     298     0     0     14               14               Lag          Lag
    14119     1          3034     22421          10-APR-13     44     0     0     7               14               Lag          Lag
    7300     1          3034     5394          11-APR-13     44     0     0     7               14               Lag          Lag
    17380     1          3034     5395          11-APR-13     298     0     0     14               14               Lag          Lag
    14118     1          3034     22421          11-APR-13     44     0     0     7               14               Lag          Lag
    7299     1          3034     5394          12-APR-13     44     0     0     7               14               Lag          Lag
    17379     1          3034     5395          12-APR-13     298     0     0     14               14               Lag          Lag
    14117     1          3034     22421          12-APR-13     44     0     0     7               14               Lag          Lag
    7298     1          3034     5394          13-APR-13     44     0     0     7               14               Lag          Lag
    17378     1          3034     5395          13-APR-13     298     0     0     14               14               Lag          Lag
    14116     1          3034     22421          13-APR-13     44     0     0     7               14               Lag          Lag
    7297     1          3034     5394          14-APR-13     44     0     0     7               14               Lag          Lag
    17377     1          3034     5395          14-APR-13     298     0     0     14               14               Lag          Lag
    14115     1          3034     22421          14-APR-13     44     0     0     7               14               Lag          Lag     I place the "wrong" showing that neither the when conditions were no able to work.
    any suggestions on a better direction for me to solve this?
    Edited by: 1004407 on May 23, 2013 1:16 PM
    Then I am trying to get this, not to include C_ID
    u_key     D_VAL_PRESENT     W_ID          DT          CONSECUTIVEDAYSW     LEAD_LAG2
    4592     0          2004          01-APR-13     1               Lead_A
    4591     1          2004          02-APR-13     13               Lead_A
    4590     1          2004          03-APR-13     13               Lag
    4589     1          2004          04-APR-13     13               Lag
    4588     1          2004          05-APR-13     13               Lag
    4587     1          2004          06-APR-13     13               Lag
    4586     1          2004          07-APR-13     13               Lag
    4585     1          2004          08-APR-13     13               Lag
    4584     1          2004          09-APR-13     13               Lag
    4583     1          2004          10-APR-13     13               Lag
    4582     1          2004          11-APR-13     13               Lag
    4581     1          2004          12-APR-13     13               Lag
    4580     1          2004          13-APR-13     13               Lag
    4579     1          2004          14-APR-13     13               Lag
    1092     0          2686          01-APR-13     3               Lead_A
    1091     0          2686          02-APR-13     3               Lag
    1090     0          2686          03-APR-13     3               Lag
    1089     1          2686          04-APR-13     11               Lead_A
    1088     1          2686          05-APR-13     11               Lag
    1087     1          2686          06-APR-13     11               Lag
    1086     1          2686          07-APR-13     11               Lag
    1085     1          2686          08-APR-13     11               Lag
    1084     1          2686          09-APR-13     11               Lag
    1083     1          2686          10-APR-13     11               Lag
    1082     1          2686          11-APR-13     11               Lag
    1081     1          2686          12-APR-13     11               Lag
    1080     1          2686          13-APR-13     11               Lag
    1079     1          2686          14-APR-13     11               Lag
    17390     1          3034          01-APR-13     14               Lead_A
    17389     1          3034          02-APR-13     14               Lag
    17388     1          3034          03-APR-13     14               Lag
    17387     1          3034          04-APR-13     14               Lag
    17386     1          3034          05-APR-13     14               Lag
    7305     1          3034          06-APR-13     14               Lag
    17384     1          3034          07-APR-13     14               Lag
    17383     1          3034          08-APR-13     14               Lag
    7302     1          3034          09-APR-13     14               Lag
    7301     1          3034          10-APR-13     14               Lag
    7300     1          3034          11-APR-13     14               Lag
    7299     1          3034          12-APR-13     14               Lag
    7298     1          3034          13-APR-13     14               Lag
    7297     1          3034          14-APR-13     14               Lag     then into this (which I would use where Lead_Lag2 = "Lead_A"
    u_key     D_VAL_PRESENT     W_ID          DT          CONSECUTIVEDAYSW     LEAD_LAG2
    4592     0          2004          01-APR-13     1               Lead_A
    4591     1          2004          02-APR-13     13               Lead_A
    1092     0          2686          01-APR-13     3               Lead_A
    11089     1          2686          04-APR-13     11               Lead_A
    17390     1          3034          01-APR-13     14               Lead_A     but onething at a time.
    Thanks for point out the errors Frank, always helpful to know what others see.
    Edited by: 1004407 on May 23, 2013 2:36 PM
    Edited by: 1004407 on May 23, 2013 4:01 PM

    Is this the first set you expect?
    SQL> with flagged as
      2  (
      3    select w_id,d_val,dt,u_key,
      4           case when lag(dt) over(partition by w_id,d_val order by dt,u_key)
      5                       in (dt,dt-1)
      6                then 0
      7                else 1
      8           end flg
      9    from t
    10  ),
    11  summed as
    12  (
    13    select w_id,d_val,dt,u_key,
    14           sum(flg) over(order by w_id,d_val nulls first,dt,u_key) sm
    15    from flagged
    16  ),
    17  day_count as
    18  (
    19  select  w_id,d_val,dt,u_key,count(distinct dt) over(partition by sm) cnt
    20  from summed
    21  )
    22  select w_id,d_val,dt,u_key,cnt
    23  from day_count
    24  order by w_id,d_val nulls first,dt,u_key;
          W_ID      D_VAL DT             U_KEY        CNT
          2004            01-APR-13       4592          1
          2004         44 02-APR-13       4591          2
          2004         44 03-APR-13       4590          2
          2004        389 04-APR-13       4589         11
          2004        389 05-APR-13       4588         11
          2004        389 06-APR-13       4587         11
          2004        389 07-APR-13       4586         11
          2004        389 08-APR-13       4585         11
          2004        389 09-APR-13       4584         11
          2004        389 10-APR-13       4583         11
          2004        389 11-APR-13       4582         11
          2004        389 12-APR-13       4581         11
          2004        389 13-APR-13       4580         11
          2004        389 14-APR-13       4579         11
          2686            01-APR-13       1092          3
          2686            01-APR-13       3416          3
          2686            01-APR-13      18118          3
          2686            02-APR-13       1091          3
          2686            02-APR-13       3415          3
          2686            02-APR-13      18117          3
          2686            03-APR-13       1090          3
          2686            03-APR-13       3414          3
          2686            03-APR-13      18116          3
    .....

  • How to create a Sales Lead and Sales Lead Contact using Web Services

    Hi,
    I am working on integration of sales lead with third party application. I want to create a sales lead and sales lead contact using web services.
    The question is What WSDLs should I use to create Sales Lead and sales lead Contact? And What are the required parameters to pass to that WSDL?
    Please let me know if any information required.
    Thanks and Regards,
    Jason

    Hi,
      Sample soap messages for creating Sales Lead ::
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/types/" xmlns:lead="http://xmlns.oracle.com/oracle/apps/marketing/leadMgmt/leads/leadService/" xmlns:lead1="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/" xmlns:not="http://xmlns.oracle.com/apps/crmCommon/notes/noteService" xmlns:not1="http://xmlns.oracle.com/apps/crmCommon/notes/flex/noteDff/">
       <soapenv:Header/>
       <soapenv:Body>
          <typ:createSalesLead>
             <typ:salesLead>
                <lead:Name>Lead Created For Migrration Test4</lead:Name>
                <lead:Rating_c>A</lead:Rating_c>
             </typ:salesLead>
          </typ:createSalesLead>
       </soapenv:Body>
    </soapenv:Envelope>
      Sample soap messages for creating Opportunity ::
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/types/" xmlns:opp="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/" xmlns:rev="http://xmlns.oracle.com/apps/sales/opptyMgmt/revenues/revenueService/" xmlns:not="http://xmlns.oracle.com/apps/crmCommon/notes/noteService" xmlns:not1="http://xmlns.oracle.com/apps/crmCommon/notes/flex/noteDff/" xmlns:rev1="http://xmlns.oracle.com/oracle/apps/sales/opptyMgmt/revenues/revenueService/" xmlns:act="http://xmlns.oracle.com/apps/crmCommon/activities/activitiesService/">
       <soapenv:Header/>
       <soapenv:Body>
          <typ:createOpportunity>
             <typ:opportunity>
                <opp:Name>Test Opportunity</opp:Name>
             </typ:opportunity>
          </typ:createOpportunity>
       </soapenv:Body>
    </soapenv:Envelope>
    Please revert if you have any clarifications.
    Best Regards,
    Mohd Sabeer

  • My iphone 4 isn not responding the screen is just showing a usb lead and the itunes symbol. When i plug it into my desktop mac and link it to itunes ,itunes is telling me the phone is in a restore mode .can i get it to respond without restoring ?

    my iphone 4 is not responding the screen is just showing a usb lead and the itunes symbol. when i plug it into my desktop mac and try to sync it to itunes ,itunes is telling me the phone is in a restore mode. How do i get it to respond without restoring the phone to new ? there is no option to restore with backup as i have not backed up any of the data on the phone any help would be greatly appreciated thanks

    http://support.apple.com/kb/HT1808
    You can't  not restore if you have reached this point

  • How to create lead follow up opportunity....

    Hello,
    How to create lead follow up opportunity automatically... Also my clients need is when we change the status of Lead from Open or In-Process or Won to Completed then an automatic email should go to the employee responsible in the lead.
    Please help me in this.... I tried doing this by creating Action profile & assigning that action profile to transaction type but didn't get the expected result.
    I would really appreciate some one help on this.... Please describe it in steps for automatic Opportunity creation & also for email.
    Thanks,
    Ajeet

    Using action is correct approach. You just have to configure action properly. For follow-up use in action 'method call' and use method 'copy_document' and as parameter specify transaction type that you want to be created as follow-up.
    For mail, you can use in action trigger_alert method.

  • SQL Server 2012 Management Studio:In the Database, how to print out or export the old 3 dbo Tables that were created manually and they have a relationship for 1 Parent table and 2 Child tables?How to handle this relationship in creating a new XML Schema?

    Hi all,
    Long time ago, I manually created a Database (APGriMMRP) and 3 Tables (dbo.Table_1_XYcoordinates, dbo.Table_2_Soil, and dbo.Table_3_Water) in my SQL Server 2012 Management Studio (SSMS2012). The dbo.Table_1_XYcoordinates has the following columns: file_id,
    Pt_ID, X, Y, Z, sample_id, Boring. The dbo.Table_2_Soil has the following columns: Boring, sample_date, sample_id, Unit, Arsenic, Chromium, Lead. The dbo.Table_3_Water has the following columns: Boring, sample_date, sample_id, Unit, Benzene, Ethylbenzene,
    Pyrene. The dbo.Table_1_XYcoordinates is a Parent Table. The dbo.Table_2_Soil and the dbo.Table_3_Water are 2 Child Tables. The sample_id is key link for the relationship between the Parent Table and the Child Tables.
    Problem #1) How can I print out or export these 3 dbo Tables?
    Problem #2) If I right-click on the dbo Table, I see "Start PowerShell" and click on it. I get the following error messages: Warning: Failed to load the 'SQLAS' extension: An exception occurred in SMO while trying to manage a service. 
    --> Failed to retrieve data for this request. --> Invalid class.  Warning: Could not obtain SQL Server Service information. An attemp to connect to WMI on 'NAB-WK-02657306' failed with the following error: An exception occurred in SMO while trying
    to manage a service. --> Failed to retrieve data for this request. --> Invalid class.  .... PS SQLSERVER:\SQL\NAB-WK-02657306\SQLEXPRESS\Databases\APGriMMRP\Table_1_XYcoordinates>   What causes this set of error messages? How can
    I get this problem fixed in my PC that is an end user of the Windows 7 LAN System? Note: I don't have the regular version of Microsoft Visual Studio 2012 in my PC. I just have the Microsoft 2012 Shell (Integrated) program in my PC.
    Problem #3: I plan to create an XML Schema Collection in the "APGriMMRP" database for the Parent Table and the Child Tables. How can I handle the relationship between the Parent Table and the Child Table in the XML Schema Collection?
    Problem #4: I plan to extract some results/data from the Parent Table and the Child Table by using XQuery. What kind of JOIN (Left or Right JOIN) should I use in the XQuerying?
    Please kindly help, answer my questions, and advise me how to resolve these 4 problems.
    Thanks in advance,
    Scott Chang    

    In the future, I would recommend you to post your questions one by one, and to the appropriate forum. Of your questions it is really only #3 that fits into this forum. (And that is the one I will not answer, because I have worked very little with XSD.)
    1) Not sure what you mean with "print" or "export", but when you right-click a database, you can select Tasks from the context menu and in this submenu you find "Export data".
    2) I don't know why you get that error, but any particular reason you want to run PowerShell?
    4) If you have tables, you query them with SQL, not XQuery. XQuery is when you query XML documents, but left and right joins are SQL things. There are no joins in XQuery.
    As for left/right join, notice that these two are equivalent:
    SELECT ...
    FROM   a LEFT JOIN b ON a.col = b.col
    SELECT ...
    FROM   b RIGHT JOIN a ON a.col = b.col
    But please never use RIGHT JOIN - it gives me a headache!
    There is nothing that says that you should use any of the other. In fact, if you are returning rows from parent and child, I would expect an inner join, unless you want to cater for parents without children.
    Here is an example where you can study the different join types and how they behave:
    CREATE TABLE apple (a int         NOT NULL PRIMARY KEY,
                        b varchar(23) NOT NULL)
    INSERT apple(a, b)
       VALUES(1, 'Granny Smith'),
             (2, 'Gloster'),
             (4, 'Ingrid-Marie'),
             (5, 'Milenga')
    CREATE TABLE orange(c int        NOT NULL PRIMARY KEY,
                        d varchar(23) NOT NULL)
    INSERT orange(c, d)
       VALUES(1, 'Agent'),
             (3, 'Netherlands'),
             (4, 'Revolution')
    SELECT a, b, c, d
    FROM   apple
    CROSS  JOIN orange
    SELECT a, b, c, d
    FROM   apple
    INNER  JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    LEFT   OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    RIGHT  OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    FULL OUTER JOIN orange ON apple.a = orange.c
    go
    DROP TABLE apple, orange
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for