Need help with Querying XML - XQuery

Hey guys, im new to this stuff so  I gained some knowledge from internet but I'm running is some problem that I'll explain below. I have XML like:  
<?xml version="1.0" encoding="iso-8859-1"?>
<star:ShowLaborOperations xmlns:star="http://www.starstandard.org/STAR/5" releaseID="5.4.4">
<star:ApplicationArea>
<star:Sender>
<star:CreatorNameCode>AD</star:CreatorNameCode>
<star:SenderNameCode>DDDD</star:SenderNameCode>
<star:SystemVersion>AD2.0</star:SystemVersion>
</star:Sender>
<star:CreationDateTime>2011-05-06T12:51:33Z</star:CreationDateTime>
<star:BODID>A29BF24F-F68E-5CE5-E040-35A54242A0C</star:BODID>
<star:Destination>
<star:DestinationNameCode>AD</star:DestinationNameCode>
</star:Destination>
</star:ApplicationArea>
<star:ShowLaborOperationsDataArea>
<star:Show>
<oagis:ResponseCriteria xmlns:oagis="http://www.openapplications.org/oagis/9">
<oagis:ChangeStatus>
<oagis:Description>Changes</oagis:Description>
</oagis:ChangeStatus>
</oagis:ResponseCriteria>
</star:Show>
<star:LaborOperations>
<star:LaborOperationsHeader>
<star:RequestCode>Changes</star:RequestCode>
<star:LaborOperationsHeaderBase>
<star:DocumentIdentificationGroup>
<star:DocumentIdentification>
<star:DocumentID>ShowOperationCode20110506050532TY</star:DocumentID>
</star:DocumentIdentification>
</star:DocumentIdentificationGroup>
</star:LaborOperationsHeaderBase>
<star:LaborOperationCodes/>
</star:LaborOperationsHeader>
<star:LaborOperationsDetail>
<star:LaborOperationID>001020</star:LaborOperationID>
<star:MajorGroupID>00</star:MajorGroupID>
<star:ComponentGroupID>01</star:ComponentGroupID>
<star:LaborOperationDescription>GAS TANK FILL</star:LaborOperationDescription>
<star:LaborActionCode>OTH</star:LaborActionCode>
<star:LaborOperationsChangeStatus>U</star:LaborOperationsChangeStatus>
<star:Combinations>
<star:VehicleGroupLaborAllowance>
<star:VehicleIdentificationGroup>
<star:VehicleGroupID>JTN</star:VehicleGroupID>
<star:VehicleID>JJXB0</star:VehicleID>
</star:VehicleIdentificationGroup>
<star:ChangeStatus>A</star:ChangeStatus>
<star:LaborAllowanceMeasure unitCode="hour">0.0</star:LaborAllowanceMeasure>
<star:ChargeHoursIndicator>false</star:ChargeHoursIndicator>
</star:VehicleGroupLaborAllowance>
<star:VehicleGroupLaborAllowance>
<star:VehicleIdentificationGroup>
<star:VehicleGroupID>JTM</star:VehicleGroupID>
<star:VehicleID>ZF32V</star:VehicleID>
</star:VehicleIdentificationGroup>
<star:ChangeStatus>U</star:ChangeStatus>
<star:LaborAllowanceMeasure unitCode="hour">0.6</star:LaborAllowanceMeasure>
<star:ChargeHoursIndicator>true</star:ChargeHoursIndicator>
</star:VehicleGroupLaborAllowance>
</star:Combinations>
</star:LaborOperationsDetail>
</star:LaborOperations>
</star:ShowLaborOperationsDataArea>
</star:ShowLaborOperations>
and I wanna be able to see the following result: 
<LaborOperationsDetail xmlns="http://www.starstandard.org/STAR/5">
<LaborOperationID>001020</LaborOperationID>
<MajorGroupID>00</MajorGroupID>
<ComponentGroupID>01</ComponentGroupID>
<LaborOperationDescription>GAS TANK FILL</LaborOperationDescription>
<LaborActionCode>OTH</LaborActionCode>
<LaborOperationsChangeStatus>U</LaborOperationsChangeStatus>
<Combinations>
<VehicleGroupLaborAllowance>
<VehicleIdentificationGroup>
<VehicleGroupID>JTN</VehicleGroupID>
<VehicleID>JJXB0</VehicleID>
</VehicleIdentificationGroup>
<ChangeStatus>A</ChangeStatus>
<LaborAllowanceMeasure unitCode="hour">0.0</LaborAllowanceMeasure>
<ChargeHoursIndicator>false</ChargeHoursIndicator>
</VehicleGroupLaborAllowance>
</Combinations>
</LaborOperationsDetail>
for which I'm writing the following query 
SELECT OpCodeXMLCol.query('
declare default element namespace "http://www.starstandard.org/STAR/5";
/ShowLaborOperations/ShowLaborOperationsDataArea/LaborOperations/LaborOperationsDetail[Combinations/VehicleGroupLaborAllowance/VehicleIdentificationGroup/VehicleGroupID="JTN"][LaborOperationID="001020"]
-- specified [LaborOperationID="001020"] because there are multiple <LabrOperationDetial> ') as x
FROM XMLData.dbo.OpCodeData
where [ID] = 3 -- primary key for that row containing XML in first snippet
but I'm getting both nodes for <VehicleIdentificatonGroup> whereas I expect to see one containing <VehicleGroupID>JTN</VehicleGroupID> as per filter in query. Please help

The closest thing which makes sense:
DECLARE @Data XML = N'
<star:ShowLaborOperations xmlns:star="http://www.starstandard.org/STAR/5" releaseID="5.4.4">
<star:ApplicationArea>
<star:Sender>
<star:CreatorNameCode>AD</star:CreatorNameCode>
<star:SenderNameCode>DDDD</star:SenderNameCode>
<star:SystemVersion>AD2.0</star:SystemVersion>
</star:Sender>
<star:CreationDateTime>2011-05-06T12:51:33Z</star:CreationDateTime>
<star:BODID>A29BF24F-F68E-5CE5-E040-35A54242A0C</star:BODID>
<star:Destination>
<star:DestinationNameCode>AD</star:DestinationNameCode>
</star:Destination>
</star:ApplicationArea>
<star:ShowLaborOperationsDataArea>
<star:Show>
<oagis:ResponseCriteria xmlns:oagis="http://www.openapplications.org/oagis/9">
<oagis:ChangeStatus>
<oagis:Description>Changes</oagis:Description>
</oagis:ChangeStatus>
</oagis:ResponseCriteria>
</star:Show>
<star:LaborOperations>
<star:LaborOperationsHeader>
<star:RequestCode>Changes</star:RequestCode>
<star:LaborOperationsHeaderBase>
<star:DocumentIdentificationGroup>
<star:DocumentIdentification>
<star:DocumentID>ShowOperationCode20110506050532TY</star:DocumentID>
</star:DocumentIdentification>
</star:DocumentIdentificationGroup>
</star:LaborOperationsHeaderBase>
<star:LaborOperationCodes/>
</star:LaborOperationsHeader>
<star:LaborOperationsDetail>
<star:LaborOperationID>001020</star:LaborOperationID>
<star:MajorGroupID>00</star:MajorGroupID>
<star:ComponentGroupID>01</star:ComponentGroupID>
<star:LaborOperationDescription>GAS TANK FILL</star:LaborOperationDescription>
<star:LaborActionCode>OTH</star:LaborActionCode>
<star:LaborOperationsChangeStatus>U</star:LaborOperationsChangeStatus>
<star:Combinations>
<star:VehicleGroupLaborAllowance>
<star:VehicleIdentificationGroup>
<star:VehicleGroupID>JTN</star:VehicleGroupID>
<star:VehicleID>JJXB0</star:VehicleID>
</star:VehicleIdentificationGroup>
<star:ChangeStatus>A</star:ChangeStatus>
<star:LaborAllowanceMeasure unitCode="hour">0.0</star:LaborAllowanceMeasure>
<star:ChargeHoursIndicator>false</star:ChargeHoursIndicator>
</star:VehicleGroupLaborAllowance>
<star:VehicleGroupLaborAllowance>
<star:VehicleIdentificationGroup>
<star:VehicleGroupID>JTM</star:VehicleGroupID>
<star:VehicleID>ZF32V</star:VehicleID>
</star:VehicleIdentificationGroup>
<star:ChangeStatus>U</star:ChangeStatus>
<star:LaborAllowanceMeasure unitCode="hour">0.6</star:LaborAllowanceMeasure>
<star:ChargeHoursIndicator>true</star:ChargeHoursIndicator>
</star:VehicleGroupLaborAllowance>
</star:Combinations>
</star:LaborOperationsDetail>
</star:LaborOperations>
</star:ShowLaborOperationsDataArea>
</star:ShowLaborOperations>
WITH XMLNAMESPACES ( DEFAULT 'http://www.starstandard.org/STAR/5' )
SELECT LaborOperationsDetail.query('.'),
VehicleGroupLaborAllowance.query('.')
FROM @Data.nodes('/ShowLaborOperations/ShowLaborOperationsDataArea/LaborOperations/LaborOperationsDetail') A ( LaborOperationsDetail )
CROSS APPLY LaborOperationsDetail.nodes('Combinations/VehicleGroupLaborAllowance[VehicleIdentificationGroup/VehicleGroupID="JTN"]') B ( VehicleGroupLaborAllowance );
Otherwise we need to destruct and rebuild the XML. This in this case imho better done with XSLT.

Similar Messages

  • Need help with Berkeley XML DB Performance

    We need help with maximizing performance of our use of Berkeley XML DB. I am filling most of the 29 part question as listed by Oracle's BDB team.
    Berkeley DB XML Performance Questionnaire
    1. Describe the Performance area that you are measuring? What is the
    current performance? What are your performance goals you hope to
    achieve?
    We are measuring the performance while loading a document during
    web application startup. It is currently taking 10-12 seconds when
    only one user is on the system. We are trying to do some testing to
    get the load time when several users are on the system.
    We would like the load time to be 5 seconds or less.
    2. What Berkeley DB XML Version? Any optional configuration flags
    specified? Are you running with any special patches? Please specify?
    dbxml 2.4.13. No special patches.
    3. What Berkeley DB Version? Any optional configuration flags
    specified? Are you running with any special patches? Please Specify.
    bdb 4.6.21. No special patches.
    4. Processor name, speed and chipset?
    Intel Xeon CPU 5150 2.66GHz
    5. Operating System and Version?
    Red Hat Enterprise Linux Relase 4 Update 6
    6. Disk Drive Type and speed?
    Don't have that information
    7. File System Type? (such as EXT2, NTFS, Reiser)
    EXT3
    8. Physical Memory Available?
    4GB
    9. Are you using Replication (HA) with Berkeley DB XML? If so, please
    describe the network you are using, and the number of Replica’s.
    No
    10. Are you using a Remote Filesystem (NFS) ? If so, for which
    Berkeley DB XML/DB files?
    No
    11. What type of mutexes do you have configured? Did you specify
    –with-mutex=? Specify what you find inn your config.log, search
    for db_cv_mutex?
    None. Did not specify -with-mutex during bdb compilation
    12. Which API are you using (C++, Java, Perl, PHP, Python, other) ?
    Which compiler and version?
    Java 1.5
    13. If you are using an Application Server or Web Server, please
    provide the name and version?
    Oracle Appication Server 10.1.3.4.0
    14. Please provide your exact Environment Configuration Flags (include
    anything specified in you DB_CONFIG file)
    Default.
    15. Please provide your Container Configuration Flags?
    final EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not
    // exist, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory
    // region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional
    // subsystem.
    envConf.setLockDetectMode(LockDetectMode.MINWRITE);
    envConf.setThreaded(true);
    envConf.setErrorStream(System.err);
    envConf.setCacheSize(1024*1024*64);
    envConf.setMaxLockers(2000);
    envConf.setMaxLocks(2000);
    envConf.setMaxLockObjects(2000);
    envConf.setTxnMaxActive(200);
    envConf.setTxnWriteNoSync(true);
    envConf.setMaxMutexes(40000);
    16. How many XML Containers do you have? For each one please specify:
    One.
    1. The Container Configuration Flags
              XmlContainerConfig xmlContainerConfig = new XmlContainerConfig();
              xmlContainerConfig.setTransactional(true);
    xmlContainerConfig.setIndexNodes(true);
    xmlContainerConfig.setReadUncommitted(true);
    2. How many documents?
    Everytime the user logs in, the current xml document is loaded from
    a oracle database table and put it in the Berkeley XML DB.
    The documents get deleted from XML DB when the Oracle application
    server container is stopped.
    The number of documents should start with zero initially and it
    will grow with every login.
    3. What type (node or wholedoc)?
    Node
    4. Please indicate the minimum, maximum and average size of
    documents?
    The minimum is about 2MB and the maximum could 20MB. The average
    mostly about 5MB.
    5. Are you using document data? If so please describe how?
    We are using document data only to save changes made
    to the application data in a web application. The final save goes
    to the relational database. Berkeley XML DB is just used to store
    temporary data since going to the relational database for each change
    will cause severe performance issues.
    17. Please describe the shape of one of your typical documents? Please
    do this by sending us a skeleton XML document.
    Due to the sensitive nature of the data, I can provide XML schema instead.
    18. What is the rate of document insertion/update required or
    expected? Are you doing partial node updates (via XmlModify) or
    replacing the document?
    The document is inserted during user login. Any change made to the application
    data grid or other data components gets saved in Berkeley DB. We also have
    an automatic save every two minutes. The final save from the application
    gets saved in a relational database.
    19. What is the query rate required/expected?
    Users will not be entering data rapidly. There will be lot of think time
    before the users enter/modify data in the web application. This is a pilot
    project but when we go live with this application, we will expect 25 users
    at the same time.
    20. XQuery -- supply some sample queries
    1. Please provide the Query Plan
    2. Are you using DBXML_INDEX_NODES?
    Yes.
    3. Display the indices you have defined for the specific query.
         XmlIndexSpecification spec = container.getIndexSpecification();
         // ids
         spec.addIndex("", "id", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         spec.addIndex("", "idref", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // index to cover AttributeValue/Description
         spec.addIndex("", "Description", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_SUBSTRING, XmlValue.STRING);
         // cover AttributeValue/@value
         spec.addIndex("", "value", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // item attribute values
         spec.addIndex("", "type", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // default index
         spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
         // save the spec to the container
         XmlUpdateContext uc = xmlManager.createUpdateContext();
         container.setIndexSpecification(spec, uc);
    4. If this is a large query, please consider sending a smaller
    query (and query plan) that demonstrates the problem.
    21. Are you running with Transactions? If so please provide any
    transactions flags you specify with any API calls.
    Yes. READ_UNCOMMITED in some and READ_COMMITTED in other transactions.
    22. If your application is transactional, are your log files stored on
    the same disk as your containers/databases?
    Yes.
    23. Do you use AUTO_COMMIT?
         No.
    24. Please list any non-transactional operations performed?
    No.
    25. How many threads of control are running? How many threads in read
    only mode? How many threads are updating?
    We use Berkeley XML DB within the context of a struts web application.
    Each user logged into the web application will be running a bdb transactoin
    within the context of a struts action thread.
    26. Please include a paragraph describing the performance measurements
    you have made. Please specifically list any Berkeley DB operations
    where the performance is currently insufficient.
    We are clocking 10-12 seconds of loading a document from dbd when
    five users are on the system.
    getContainer().getDocument(documentName);
    27. What performance level do you hope to achieve?
    We would like to get less than 5 seconds when 25 users are on the system.
    28. Please send us the output of the following db_stat utility commands
    after your application has been running under "normal" load for some
    period of time:
    % db_stat -h database environment -c
    % db_stat -h database environment -l
    % db_stat -h database environment -m
    % db_stat -h database environment -r
    % db_stat -h database environment -t
    (These commands require the db_stat utility access a shared database
    environment. If your application has a private environment, please
    remove the DB_PRIVATE flag used when the environment is created, so
    you can obtain these measurements. If removing the DB_PRIVATE flag
    is not possible, let us know and we can discuss alternatives with
    you.)
    If your application has periods of "good" and "bad" performance,
    please run the above list of commands several times, during both
    good and bad periods, and additionally specify the -Z flags (so
    the output of each command isn't cumulative).
    When possible, please run basic system performance reporting tools
    during the time you are measuring the application's performance.
    For example, on UNIX systems, the vmstat and iostat utilities are
    good choices.
    Will give this information soon.
    29. Are there any other significant applications running on this
    system? Are you using Berkeley DB outside of Berkeley DB XML?
    Please describe the application?
    No to the first two questions.
    The web application is an online review of test questions. The users
    login and then review the items one by one. The relational database
    holds the data in xml. During application load, the application
    retrieves the xml and then saves it to bdb. While the user
    is making changes to the data in the application, it writes those
    changes to bdb. Finally when the user hits the SAVE button, the data
    gets saved to the relational database. We also have an automatic save
    every two minues, which saves bdb xml data and saves it to relational
    database.
    Thanks,
    Madhav
    [email protected]

    Could it be that you simply do not have set up indexes to support your query? If so, you could do some basic testing using the dbxml shell:
    milu@colinux:~/xpg > dbxml -h ~/dbenv
    Joined existing environment
    dbxml> setverbose 7 2
    dbxml> open tv.dbxml
    dbxml> listIndexes
    dbxml> query     { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }
    dbxml> queryplan { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }Verbosity will make the engine display some (rather cryptic) information on index usage. I can't remember where the output is explained; my feeling is that "V(...)" means the index is being used (which is good), but that observation may not be accurate. Note that some details in the setVerbose command could differ, as I'm using 2.4.16 while you're using 2.4.13.
    Also, take a look at the query plan. You can post it here and some people will be able to diagnose it.
    Michael Ludwig

  • Need help with error: XML parser failed: Error An exception occurred! Type:......

    <p>Need help with the following error.....what does it mean....</p><p>28943 3086739136 XML-240304 3/7/07 7:13:23 PM |SessionNew_Job1<br /><font color="#ff0000">28943 3086739136 XML-240304 3/7/07 7:13:23 PM XML parser failed: Error <An exception occurred! Type:UnexpectedEOFException, Message:The end of input was not expected> at</font><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM line <7>, char <8> in <<?xml version="1.0" encoding="WINDOWS-1252" ?><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfigurations><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfiguration default="true" name="Configuration1"><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <case_sensitive>no</case_sensitive><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <database_type>Oracle</database_type><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_alias_name1>ODS_OWNER</db_alias_name1><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_ali>, file <>.<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM |SessionNew_Job1<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM XML parser failed: See previously displayed error message.</p><p>Any help would be greatly appreciated.  It&#39;s something to do with my datasource and possibly the codepage but I&#39;m really not sure.</p><p>-m<br /></p>

    please export your datastore as ATL and send it to support. Somehow the internal language around configurations got corrupted - never seen before.

  • Need help with Query

    Hi,
    Good day everyone! I need help writing a query. I have this table with the following data in them...
    ACCT_CODE  FSYR      YTD_AMT
    A123            11          100  
    A456            11          200
    A123            10          50
    A456            10          100I want the output to look like this:
    ACCT_CODE     CURRENT_YEAR(11)       PRIOR_YEAR(10)
    A123               100                              50
    A456               200                              100The user will input the fiscal year and based on that input, I want to get the prior year value as well.
    Thank you for all your help!!
    Edited by: user5737516 on Jun 29, 2011 6:48 AM
    Edited by: user5737516 on Jun 29, 2011 6:50 AM

    user5737516 wrote:
    Hi,
    Good day everyone! I need help writing a query. I have this table with the following data in them...
    ACCT_CODE FSYR YTD_AMT
    A123 11 100
    A456 11 200
    A123 10 50
    A456 10 100
    I want the output to look like this:
    ACCT_CODE CURRENT_YEAR PRIOR_YEAR
    A123 100 50
    A456 200 100
    The user will input the fiscal year and based on that input, I want to get the prior year value as well.
    Thank you for all your help!!what is prior year?

  • Need help with this xml gallery !!!

    i have build a gallery but its very simple...... it takes images from xml file.
    i have attached all files in zip.
    i just want two things if anyone can help.
    first when i press next button it goes to next image but with no effect. it just displays next image ... i want to incorporate a sliding effect when the image is changed to another.
    and second i want to use autoplay feature.
    as soon as swf starts the images came one by one with difference of few seconds.
    thx in advance... i really need help in this....!

    You're welcome.
    I don't have an example to offer for the autorun.  You should be able to think it thru.  One key, as I mentioned is to preload all of the images first, that will allow for smooth playing of the show--no waiting for images to load between changes.  You can load them into empty movieclips and hide them (_viisible = false) until they are needed.  You could load them when called for, but you would have to put conditions on the displaying of things until the image loads, which will change when they are all loaded, so I recommend just loading them all first.
    For the timing you can use setInterval.  If something is going to be allowed to interupt the autorun, then you will need to make use of the clearInterval function as well, so that you stop the clock.
    Since you will be wanting to know when things are loaded, you will need to use the MovieClipLoader.loadClip method for loading the images instead of using loadMovie.  This is because the MovieClipLoader class supports having an event listener.  If you look in the help documents in the MovieClipLoader.addListener section, there is an example there that provides a fairly good complete overview of using the code.  The only difference is you'd be looking for the onLoadComplete event rather than the onLoadInit event.

  • Need help with query joining several tables into a single return line

    what i have:
    tableA:
    puid, task
    id0, task0
    id1, task1
    id2, task2
    tableB:
    puid, seq, state
    id0, 0, foo
    id0, 1, bar
    id0, 2, me
    id1, 0, foo
    id2, 0, foo
    id2, 1, bar
    tableC:
    puid, seq, date
    id0, 0, 12/21
    id0, 1, 12/22
    id0, 2, 12/22
    id1, 0, 12/23
    id2, 0, 12/22
    id2, 1, 12/23
    what i'd like to return:
    id0, task0, 12/21, 12/22, 12/22
    id1, task1, 12/23, N/A, N/A
    id2, task2, 12/22, 12/23, N/A
    N/A doesn't mean return the string "N/A"... it just means there was no value, so we don't need anything in this column (null?)
    i can get output like below through several joins, however i was hoping to condense each "id" into a single line...
    id0, task0, 12/21
    id0, task0, 12/22
    id0, task0, 12/23
    id1, task1, 12/23
    is this possible fairly easily?
    Edited by: user9979830 on Mar 29, 2011 10:53 AM
    Edited by: user9979830 on Mar 29, 2011 10:58 AM

    Hi,
    Welcome to the forum!
    user9979830 wrote:
    what i have:...Thanks for posting that so clearly!
    Whenever you have a question, it's even better if you post CREATE TABLE and INSERT statements for your sample data, like this:
    CREATE TABLE     tablea
    (       puid     VARCHAR2 (5)
    ,     task     VARCHAR2 (5)
    INSERT INTO tablea (puid, task) VALUES ('id0',  'task0');
    INSERT INTO tablea (puid, task) VALUES ('id1',  'task1');
    INSERT INTO tablea (puid, task) VALUES ('id2',  'task2');
    CREATE TABLE     tablec
    (       puid     VARCHAR2 (5)
    ,     seq     NUMBER (3)
    ,     dt     DATE          -- DATE is not a good column name
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  0,  DATE '2010-12-21');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  1,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  2,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id1',  0,  DATE '2010-12-23');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id2',  0,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id2',  1,  DATE '2010-12-23');This way, people can re-create the problem and test their ideas.
    It doesn't look like tableb plays any role in this problem, so I didn't post it.
    Explain how you get the results from that data. For example, why do you want this row in the results:
    PUID  TASK  DT1        DT2        DT3
    id0   task0 12/21/2010 12/22/2010 12/22/2010rather than, say
    PUID  TASK  DT1        DT2        DT3
    id0   task0 12/22/2010 12/21/2010 12/22/2010? Does 12/21 have to go in the first column because it is the earliest date, or is it because 12/21 is related to the lowest seq value? Or do you even care about the order, just as long as all 3 dates are shown?
    Always say what version of Oracle you're uisng. The query below will work in Oracle 9 (and up), but starting in Oracle 11, the SELECT ... PIVOT feature could help you.
    i can get output like below through several joins, however i was hoping to condense each "id" into a single line... Condensing the output, so that there's only one line for each puid, sounds like a job for "GROUP BY puid":
    WITH     got_r_num     AS
         SELECT     puid
         ,     dt
         ,     ROW_NUMBER () OVER ( PARTITION BY  puid
                                   ORDER BY          seq          -- and/or dt
                           )         AS r_num
         FROM    tablec
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT       a.puid
    ,       a.task
    ,       MIN (CASE WHEN r.r_num = 1 THEN r.dt END)     AS dt1
    ,       MIN (CASE WHEN r.r_num = 2 THEN r.dt END)     AS dt2
    ,       MIN (CASE WHEN r.r_num = 3 THEN r.dt END)     AS dt3
    ,       MIN (CASE WHEN r.r_num = 4 THEN r.dt END)     AS dt4
    FROM       tablea    a
    JOIN       got_r_num r  ON   a.puid  = r.puid
    GROUP BY  a.puid
    ,            a.task
    ORDER BY  a.puid
    ;I'm guessing that you want the dates arranged by seq; that is, for each puid, the date related to the lowest seq comes first, regardless of whther that date is the earliest date for that puid or not. If that's not what you need, then change the analytic ORDER BY clause.
    This does not assume that the seq values are always consecutive integers (0, 1, 2, ...) for each puid. You can skip, or even duplicate values. However, if the values are always consecutive integers, starting from 0, then you could simplify this. You won't need a sub-query at all; just use seq instead of r_num in the main query.
    Here's the output I got from the query above:
    PUID  TASK  DT1        DT2        DT3        DT4
    id0   task0 12/21/2010 12/22/2010 12/22/2010
    id1   task1 12/23/2010
    id2   task2 12/22/2010 12/23/2010As posted, the query will display the first 4 dts for each puid.
    If there are fewer than 4 dts for a puid, the query will still work. It will leave some columns NULL at the end.
    If there are more than 4 dts for a puid, the query will still work. It will display the first 4, and ignore the others.
    There's nothing special about the number 4; you could make it 3, or 5, or 35, but whatever number you choose, you have to hard-code that many columns into the query, and always get that many columns of output.
    For various ways to deal with a variable number of pivoted coolumns, see the following thread:
    PL/SQL
    This question actually doesn't have anything to do with SQL*Plus; it's strictly a SQL question, and SQL questions are best posted on the "SQL and PL/SQL" forum:
    PL/SQL
    If you're not sure whether a question is more of a SQL question or a SQL*Plus question, then post it on the SQL forum. Many more people pay attention to that forum than to this one.

  • Need help with simple XML validation

    I am new to Spry and need some help creating a simple
    validation. There is a form field which must not contain a value
    already in the database. I have a script which accepts a parameter
    and returns a boolean result. Here is the XML:
    <samples>
    <sample>
    <ISFOUND>0</ISFOUND>
    </sample>
    </samples>
    1. How do I call this script when the form field changes and
    pass the form value as the parameter?
    2. How do I check the returned value in the XML and throw an
    error if true?
    I appreciate any help with this. Please let me know if there
    is a better way to achieve the same result.
    Thanks,
    Rich

    I enabled the call to the XML response. However, I am having
    trouble identifying when the call is complete so I can parse the
    result. How do I run my check after the data load and display the
    proper message?

  • Need help with an XML-based SQL query

    Hello, everyone:
    I get 'no rows selected' from the following queries:
    SELECT extractValue((p.entity_types_xml), '/entities/test[a=fagioli]')
    FROM entity_types p
    WHERE
    existsNode(p.entity_types_xml,
    '/entities/test/text()') = 1;
    SELECT extractValue((p.entity_types_xml), '/entities/test/text()')
    FROM entity_types p
    WHERE
    existsNode(p.entity_types_xml, '/entities/test/text()') = 1;
    SELECT
    extractValue(p.entity_types_xml,'/entities/ARFinance-elem/entity-type')
    FROM entity_types p
    WHERE
    existsNode(p.entity_types_xml,'/entities/ARFinance-elem/ARFinanceTBD/text()') = 1;
    where the entity_types table looks like this:
    SQL> desc entity_Types;
    Name Null? Type
    ENTITY_TYPES_ID NOT NULL VARCHAR2(36)
    ENTITY_TYPES_XML NOT NULL XMLTYPE
    CLIENT_ID VARCHAR2(30)
    and the XML fragment looks like this:
    +++++++++++++++++++++++++++++++++++++
    <?xml version="1.0" encoding="UTF-8"?>
    <entities
    xmlns="http://www.thirdpillar.com/xml/namespace/aom/entity"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.thirdpillar.com/xml/namespace/aom/entity ../generated/denormalized-schema.0.xsd">
    <test a="fagioli">pasta</test>
    <ARFinance-elem>
    <uid b="pasta">123</uid>
    <entity-type><![CDATA[ARFinance]]></entity-type>
    <ARFinanceTBD>tobedetermined</ARFinanceTBD>
    </ARFinance-elem>
    ++++++++++++++++++++++++++++++++++++++++++++
    As you can see, there is data in /entities/test[@a] as well as /entities/test/text(),
    so why aren't any of the queries returning the preceding XML fragment? Suggestions welcome and appreciated....
    Regards,
    Oswald
    ps: I'm sure I've overlooked something simple.

    Oswald,
    I think you need to add the namespace
    select extractValue(.....','xmlns:xsi="http://www.thirdpillar.com/xml/namespace/aom/entity"')
    from entity_types p

  • Need help with query that can look data back please help.

    hi guys i have a table like such
    CREATE TABLE "FGL"
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )and i have a data like such
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7470','4730','02','10','2','200');I bascially need to get the total of the budget column. however its not as simple as it sound(well atleast not for me.) the totals carry over to the new period. youll noticed the you have a period column. basically what im saying is that
    fgl_grant_year 10 period 1 = for account 7600 its $100 and $100 for period 2 you see 100 dollars again this is not to be added this is the carried over balance. which remains $100.
    so im trying to write a query that basically does the following.
    im given a period for the sake of this example lets say period 1 i get nothing else. I have to find the greates grant year grab the amount for period 14(which is the total from the previous year) and add it to the amount of the current period. in this case period 1 grnt_year 11
    so the expected outcome should be $700
    240055     240055     7240     4730     02     10     14     200
    240055     240055     7600     4730     02     10     14     100
    240055     240055     7600     4730     02     11     1     400keep in mind that im not given a year just a period.
    any help that you guys can offer would be immensely appreciated. I have been trying to get this to work for over 3 days now.
    finally broke down and put together this post
    Edited by: mlov83 on Sep 14, 2011 8:48 PM

    Frank
    wondering if you can help me modify this sql statement that you provided me with .
    table values have been modified a bit.
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','00','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7200','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7600','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','11','2','600');i need to take one more thing into consideration. if the greatest year has a value on period 00 i need to ignore the period 14 and the current period total would be
    the current period +(current period - greatest year 00)
    hope that makes sense so in other words with the new data above. if i was querying period two of grant year 11. i would end up with $800
    because the greatest year is 11 it contains a period 0 with amount of $400 so my total should be
    period 2 amount $ 600
    period 0 amount $ 400 - period 2 amount of $600 = 200
    600+200 = $800
    if i query period 1 of grant 360055 i would just end up with 800 of grnt year 10.
    i have tried to modify that query you supplied to me with no luck. I have tried for several day but im embarrased to say i just can get it to do what im trying to do .
    can you please help me out.
    Miguel

  • Query off of Oracle using WinSql - Need help with query

    I am trying to query off of Oracle using program WinSql.
    I have a table(tticpr200110) that has the following sample data:
    ITEM     CODE     T$AMNT
    23500076 ACL     .0049
    23500076 APM     0
    23500076 APO     .0093
    23500076 EXP     .0001
    23500076 RES     .0072
    and what I want it to look like is:
    ITEM     ACL     APM     APO     EXP     RES
    23500076     0.0049     0     0.0093     0.0001     0.0072
    (actually I need the last 2 columns added together to be MATL-but can deal with that down the road).
    Seems simple enough, but I don't know to put into the columns.
    Any help would be GREATLY appreciated as soon as possible would be even better.

    My table - tticpr200110 when it runs I get the following sample data for part number 23500076:
    The first coloumn ITEM is the part number.
    The second column CODE is 1 of 5 different cost codes
    The third column is the cost for that code for that part.
    ITEM CODE AMNT
    23500076 ACL 0.0049
    23500076 APM 0.0000
    23500076 APO 0.0093
    23500076 EXP 0.0001
    23500076 RES 0.0072
    I want to make a query that makes the data look like this:
    ITEM ACL APM APO EXP RES
    23500076 0.0049 0.0000 0.0093 0.0001 0.0072
    (similar to a pivot table in excel or acess)
    I hope this helps better.
    Thanks!

  • Need help with Query to determine Credit Memos and Invoices

    Hi All
    Thanks for all the help here.
    I need a query to determine any credits or invoices issued within a given period.
    OINV and ORIN with UNION ALL?
    Please advise any help.
    Thank you!

    Hi Daniel,
    Please check below Query.
    SELECT T0.[DocNum] as 'Invice No', T0.[DocDate] as 'Invoice Date', T0.[CardName] as 'Invoiced Customer', T3.[DocNum] as 'Credit Memo No', T3.[DocDate] as 'Credit Mamo Date', T3.[CardName] as 'Credit Memo Customer' FROM OINV T0  LEFT JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry] LEFT JOIN RIN1 T2 ON T2.[BaseEntry] = T1.[DocEntry] AND T2.[BaseLine] =  T1.[LineNum] LEFT JOIN ORIN T3 ON T2.[DocEntry] = T3.[DocEntry] WHERE T0.[DocDate]  >=[%3]  AND   T0.[DocDate] <=[%4]
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Need help with table, xml files, click actions and visibility

    Hi.
    I am new to adobe livecycle and I need some guidance in a problem that I am facing.
    I have an XML. The main tag 'employee' has 4 tags in it, name, age, ph# and address.
    Address tag has 6 more tags in it.
    I have to create a table which has 4 columns initially (all text fields). The rows are populated acccording to the XML.
    1. S. No., which increments according to row number.
    2. Name from XML.
    3. Age from XML.
    4. ph# from XML.
    When any S. No. is clicked on, it should display the address details below that row, when it is clicked on again, it should hide those details and the original table view should be restored.
    I googled a lot but am still not able to get how to do this.
    Please help.

    I created a sample for you with what I think you want. Here is a file and the associated XML that goes with it.
    Paul

  • Need Help With Query Using Aggregation

    If I have a table, defined like this:
    CREATE TABLE range_test
    range_id NUMBER(20) NOT NULL,
    grade CHAR(1) NOT NULL,
    lower_bound_of_range NUMBER(5,2) NOT NULL,
    upper_bound_of_range NUMBER(5,2) NOT NULL,
    received_date_time_stamp TIMESTAMP DEFAULT SYSTIMESTAMP NOT NULL
    And I wanted to query the table to find the range associated with the last inserted row for each 'grade' (e.g. 'A', 'B', 'C', etc), how would I go about that?
    I want something like the following, but I know that this won't work right:
    SELECT
    grade,
    lower_bounding_of_range,
    upper_bounding_of_range,
    max(received_date_time_stamp)
    FROM
    range_test GROUP BY received_date_time_stamp;
    Thanks for your help. . .I'm frustrating myself with this one and I think it should be possible without having to use PL/SQL (i.e. SQL aggregate functions or sub-queries should work).

    Perhaps something along the lines of...
    SQL> ed
    Wrote file afiedt.buf
      1  select deptno, empno, ename, hiredate
      2  from emp
      3* order by deptno, empno
    SQL> /
        DEPTNO      EMPNO ENAME      HIREDATE
            10       7782 CLARK      09-JUN-1981 00:00:00
            10       7839 KING       17-NOV-1981 00:00:00
            10       7934 MILLER     23-JAN-1982 00:00:00
            20       7369 SMITH      17-DEC-1980 00:00:00
            20       7566 JONES      02-APR-1981 00:00:00
            20       7788 SCOTT      19-APR-1987 00:00:00
            20       7876 ADAMS      23-MAY-1987 00:00:00
            20       7902 FORD       03-DEC-1981 00:00:00
            30       7499 ALLEN      20-FEB-1981 00:00:00
            30       7521 WARD       22-FEB-1981 00:00:00
            30       7654 MARTIN     28-SEP-1981 00:00:00
            30       7698 BLAKE      01-MAY-1981 00:00:00
            30       7844 TURNER     08-SEP-1981 00:00:00
            30       7900 JAMES      03-DEC-1981 00:00:00
    14 rows selected.
    SQL> ed
    Wrote file afiedt.buf
      1  select deptno, empno, ename, hiredate
      2  from (
      3        select deptno, empno, ename, hiredate
      4              ,row_number() over (partition by deptno order by hiredate desc) as rn
      5        from emp
      6       )
      7  where rn = 1
      8* order by deptno, empno
    SQL> /
        DEPTNO      EMPNO ENAME      HIREDATE
            10       7934 MILLER     23-JAN-1982 00:00:00
            20       7876 ADAMS      23-MAY-1987 00:00:00
            30       7900 JAMES      03-DEC-1981 00:00:00
    SQL>

  • Need help with reading XML using File Adapter

    I have created a simple BPEL process that uses a file adapter to read files containing XML messages of a simple xsd schema. But when reading the xml, I get the following error message:
    [2010/03/01 23:43:13] Invalid data: The value for variable "Receive_1_Read_InputVariable", part "revision-report" does not match the schema definition for this part.The invalid xml document is shown below: More...
    [2010/03/01 23:43:13] "{http://schemas.oracle.com/bpel/extension}invalidVariables" has been thrown. less
    -<invalidVariables xmlns="http://schemas.oracle.com/bpel/extension">
    -<part name="code">
    <code>
    9710
    </code>
    </part>
    -<part name="summary">
    <summary>
    Invalid xml document.
    According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-complex-type.4: Attribute 'doc' must appear on element 'revision-report'.
    Error::cvc-complex-type.4: Attribute 'model' must appear on element 'revision-report'.
    Error::cvc-complex-type.4: Attribute 'pubdate' must appear on element 'revision-report'.
    Error::cvc-complex-type.2.4.b: The content of element 'revision-report' is not complete. One of '{"http://xmlns.oracle.com/xmlfile":alternategroup}' is expected.
    Please make sure that the xml document is valid against your schemas.
    </summary>
    </part>
    </invalidVariables>
    It seems that there is some issue with the namespace, but even after trying out various combinations, I am not able to resolve this.
    Here the message schema (xsd):
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/xmlfile"
    xmlns:tns="http://xmlns.oracle.com/xmlfile"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="revision-report">
    <xs:complexType>
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="alternategroup">
    <xs:complexType>
    <xs:attribute name="name" use="required" type="xs:string"/>
    <xs:attribute name="Desc" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="doc" use="required" type="xs:string"/>
    <xs:attribute name="model" use="required" type="xs:string"/>
    <xs:attribute name="pubdate" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    And here is the xml file to be read by the file adapter:
    <?xml version="1.0" encoding="UTF-8" ?>
    <revision-report doc="doc2" model="model4" pubdate="pubdate5">
    <alternategroup Name="ABC" Desc="ABC-Desc">
    </alternategroup>
    <alternategroup Name="DEF" Desc="DEF-Desc">
    </alternategroup>
    <alternategroup Name="GHI" Desc="GHI-Desc">
    </alternategroup>
    </revision-report>
    Appreciate any help.
    Thanks in advance for your attention.
    Jay

    Thanks for your response.
    I am not sure if there is any easier way, but I tried out the following tool available on the net to check an xml against a xsd:
    http://tools.decisionsoft.com/schemaValidate/
    There were a few issues, that I corrected and finally had a xsd and xml that were matching and valid. I tried this out in my file reading BPEL process, but the error still remained the same!
    Here is my updated/simplified xsd and xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/xmlfile"
    xmlns:tns="http://xmlns.oracle.com/xmlfile"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://xmlns.oracle.com/xmlfile">
    <xs:element name="revision-report">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="unbounded" ref="alternategroup"/>
    </xs:sequence>
    <xs:attribute name="doc" use="required" type="xs:string"/>
    <xs:attribute name="model" use="required" type="xs:string"/>
    <xs:attribute name="pubdate" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="alternategroup">
    <xs:complexType>
    <xs:attribute name="Name" use="required" type="xs:string"/>
    <xs:attribute name="Desc" use="required" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    <?xml version="1.0" encoding="UTF-8" ?>
    <revision-report doc="doc2" model="model4" pubdate="pubdate5" xmlns="http://xmlns.oracle.com/xmlfile">
    <alternategroup Name="ABC" Desc="ABC-Desc"/>
    <alternategroup Name="DEF" Desc="DEF-Desc"/>
    <alternategroup Name="GHI" Desc="GHI-Desc"/>
    </revision-report>
    I even tried the option that is available in JDeveloper to generate a sample xml from a xsd (when in the context of a Transformation activity). The xml generated by this also seems exactly like the one above.
    So, I am not able to figure out why my BPEL process errors out with the message Invalid xml document.

  • Need help with query from .csv file

    I am trying to import a csv file with only 1 column in it.
    The column will only contain a 9 digit ID number. I want to read
    the file then use the contents to query a table to get the names
    and other information and display it. Here is what I have so far:
    <cffile action="read" file="#form.FiletoUpload#"
    variable="csvfile">
    <cfloop index="index" list="#csvfile#">
    <cfquery name="massimport" datasource="data1">
    SELECT * FROM IDTable
    WHERE CardNumber = ('#csvfile#')
    </cfquery>
    </cfloop>
    <cfoutput>#Name# #ID# #Site#</cfoutput>
    I get no errors but I am not getting any results. Just a
    blank page. Does anyone know how to query directly from a csv
    import? Thanks.

    You need to convert your file to a list somehow. Not sure if
    this is the most efficient way but, you can use the cfhttp tag to
    produce a query. Then your where clause becomes,
    where cardnumber in (#quotedvaluelist(query.column)#)
    and you won't need a loop.

Maybe you are looking for

  • How to ignore the password policy in a custom workflow?

    Hi, We have a custom workflow which is called via SPML to provide 'Administrator Change Password' functionality in a portal. Our password policy sets the String Quality rules and Number of Previous Passwords that Cannot be Reused. But we like to bypa

  • Why are someone elses photo albums showing up in my icloud account on apple tv?

    Logged in to my account on iCloud on Apple TV.  It did not ask for my password, and it is now showing me hundreds of photos of a very nice family ... whom I have never met.  I am unable to see any of my photos, but I have the personal photos of somoe

  • IMac running 10.9 not rebooting after network issues

    This is weird, and while I am going through Apple's Knowledgebase steps - so far without success - I thought I'd post here to see if anyone else experienced a similar issue. I was having network issues (or what I think/thought were network issues) fo

  • Safari - server has stopped working

    I have tried the advice given to get safari to work but no joy. (deleting the app and restart. Also holding both home and sleep down to restart.) When I try to search I get "safari could not open this page because the server stopped working". How do

  • Stuck in the mud

    I cannot find my sim serial number at all! What do I do?! Help me please