SQL query returning data inconsitantly

I am running Oracle 8i and have create a stored procedure that has a cursor in it. The select statement for the cursor returns 15 records that I loop through and insert into another table. At the beginning of the loop, just before the insert statement, I have also created DBMS output that will return the time stamp. This more or less tells me how long each loop takes to complete. The loop processes 14 of the 15 records in less than a minute. The last loop takes over two hours to complete. I have also tried running this stored proc in another environment. In that environment the cursor should process 3555 records. It processes 2650 in five minutes or less. It then takes about 115 minutes to process the last 905. Does anyone have any ideas as to why this may be occurring? Could there be a bottleneck somewhere? What DB/table settings can I look at? Thanks in advance for you ideas.

Please check the query plan in this environment and that environment also(It processes 2650 in five minutes or less)

Similar Messages

  • Problem with a SQL query involving dates

    I have a database with each task made by a developer in the company's systems, with 2 fields to determine the duration of the tasks: begin_date and end_date, both Dates. Now I have to make an SQL query returning the total of hours each one worked counting every task, so I'm using something like this (simplifying):
    select user_id, sum(end_date - begin_date)
    from task
    group by user_id
    but I get a weird fractional number. How do I do this query?

    What database are you using? Oracle?
    The weird fractional number is probably the difference between the dates in days. If you want it in hours, try multiplying it with 24.
    select user_id, sum(end_date - begin_date) * 24
    from task
    group by user_id

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Creating a directory via a jsp page sql query return

    Is it possible to create a directory based on the results of a sql query?
    i.e.
    My sql query returns application number 1234 for a building application (BC for short).
    Is it possible to create a directory /BC/1234
    It is then proposed to use an iframe to look into the directory so users can place and access scanned documents which are captured during the approval process.
    If so how?
    An example would be great.
    Jason

    Sorry hope your still around I've been away for a while. We've created a samber share to the file server where the documents are stored and mounted it within the web file directory. It works ok if there is an existing directory but if there isn't we want it to be created when the page looks for the folder. I've done this with an asp page it basically did a directory exist test first then create folder if it didn't. The problem is can't find an example of how to do the directory exist test then directory create syntax so an example of both would be great

  • SQL query returns varchar - default value type!!!

    On a field in my portal form there is a default value type of 'SQL query returns varchar', where can I put this sql to get a default value from a table?

    Hi again
    I have this code in 'additional pl/sql code' - '...before displaying the page'. But it comes up with an error when I run the form.
    declare
    prop_v varchar2(20);
    group_v varchar2(3);
    el1_v varchar2(3);
    blk varchar2(10) := 'DEFAULT';
    begin
    prop_v := p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'l_property_p');
    group_v := p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'l_group_p');
    select element_code
    into el1_v
    from eh_risk_element_detail
    where property_ref = prop_v
    and group_code = group_v
    and line_no = 1;
    p_session.set_value(p_block_name => blk, p_attribute_name => 'L_ELEMENT1_P', p_value => el1_v);
    end;
    Rich

  • Multiple SQL Query as Data Source

    I have an SQL Query as Data Source of my Crystal Report. It combine the contents of two tables.
    I want to do another SQL query based on the previuos SQL Query.
    Can I do this in CR ? How I can reference the new SQL query to the main SQL query ?
    Thanks,
    Gabriel

    This is my main Query
    SELECT
    SBO_001.dbo.JDT1.Account,
    sum(SBO_001.dbo.JDT1.SYSDeb - SBO_001.dbo.JDT1.SYSCred) AS Balance_001,
    0 as Balance_004
    FROM SBO_001.dbo.JDT1
    GROUP BY SBO_001.dbo.JDT1.Account
    UNION
    SELECT
    SBO_004.dbo.JDT1.Account,
    0 as Balance_001,
    sum(SBO_004.dbo.JDT1.SYSDeb - SBO_004.dbo.JDT1.SYSCred) AS Balance_004
    FROM SBO_004.dbo.JDT1
    GROUP BY SBO_004.dbo.JDT1.Account
    This is a result
    Account     Balance_001     Balance_004
    80800005     0     -431.67
    80800005     590121.07           0
    80800006     -3621028.250            0     
    88780056     5000.00                    0
    90731001     0                          174780.11     
    I want to obtain this result
    Account     Balance_001            Balance_004
    80800005     590121.07             -431.67
    80800006     -3621028.250            0     
    88780056     5000.00                    0
    90731001     0                          174780.11     
    How I Can modify this Query?
    Thanks,
    Edited by: gablus on Aug 7, 2009 1:43 AM

  • PL/SQL function body return sql query, no data found problem

    Hi all,
    we are trying to build a dynamic report based on item selection by user. we are using SQL Query (PL/SQL function body returning SQL query). However when a user change the item and submit the page . The following error appears.
    ORA-01403: no data found.
    our query is so simple
    declare
    l_query varchar2(30000) default 'select id from chw';
    begin
    if(:P11_PARA=1) then
    l_query:='select name from chw';
    end if;
    return l_query;
    end;
    any quick help please.

    Hello Mike,
    I tried it, the problem still exists.
    ORA-01403: no data found
    my new code is
    declare
    l_query varchar2(30000) default 'select id from chw';
    begin
    if (nvl(TO_NUMBER(:P11_PARA),0) = 1) then
    l_query:='select name from chw';
    end if;
    return (l_query);
    end;
    note, there is no process in this page.
    Edited by: M.Jabr on Oct 14, 2009 6:13 AM

  • Why does Oracle SQL query returning a date field without the time component

    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!

    hokim wrote:
    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!http://edstevensdba.wordpress.com/category/nls_date_format/

  • Report from sql query invalid date condition

    Hi, I created a Reports From SQL Query. My sql is like
    "select column1, column2
    from myschema.tablename
    where mydate > :p_date1 and mydate < :p_date2"
    I am using portal with turkish and english option. If I pass p_date paramaters 'dd-MON-yyyy' format
    (for example p_date1 = 23-MAR-2003 p_date2 = 26-APR-2003) in english mode portlet is return correct result,
    in turkish mode 'No Row Returned'. I changed my sql statement with
    "select column1, column2
    from myschema.tablename
    where to_date(mydate,'dd/mm/yyy') > to_date(:p_date1,'dd/mm/yyy') and to_date(mydate) < to_date(:p_date2,'dd/mm/yyyy')"
    and I pass p_date parameters 'dd/mm/yyyy' format (for example p_date1 = 23/03/2003 p_date2 = 26/04/2003)
    but now turkish and english mode No row returned.
    How may I write correct sql statament. My database NLS_DATE_FORMAT=DD/MM/YYYY and NLS_LANGUAGE=TURKISH.
    thanks.

    Hi,
    Try this for turkish mode:
    Case 1: the 'mydate' column has a kind of a char data type (like char, varchar or varchar2)
    and a value like '30/03/2003'
    "select column1, column2
    from myschema.tablename
    where
    to_date(mydate,'DD/MM/YYYY') > :p_date1
    and
    to_date(mydate,'DD/MM/YYYY') < :p_date2"
    Case 2: the mydate column has a date type:
    "select column1, column2
    from myschema.tablename
    where
    mydate > :p_date1
    and
    mydate < :p_date2"
    In both cases use the following parameter values:
    p_date1 = 23/03/2003
    p_date2 = 26/04/2003
    This should work
    Thanks
    Peter

  • 'Driver]Parameter missing' Error while trying to pass parameter to MS query & Return Data to Microsoft Excel

    I am trying to set up a parameter query using ODBC-Microsoft Query
    to BMC Remedy The ODBC connection is "AR System ODBC Data Source".
    I want to pass a parameter to modified date field and get all the remedy tickets for which the modified date is<= to the passed parameter date.
    So in MS query, SQL- 
    the query looks like
     WHERE ("Trouble Ticket"."Create Date">={ts '2014-10-01 00:00:00'}) AND ("Trouble Ticket"."Modified-date"<=?)
    I am getting the data fetched from database in the MS query window, but unfortunately
    When I click File-Return Data to Microsoft Excel, its showing an error: Driver]Parameter missing
    I set the connection properties- parameter-Prompt for value using the following string.
    Please help

    Hi,
    Based on the error message, I recommend we try the suggestion: Replace all "..."  with [...]
    http://www.pcreview.co.uk/forums/error-parameter-query-odbc-remedy-bmc-software-com-t3232964.html
    Then, if you want to connect the Remedy's oracle database, please see the thread:
    http://www.tek-tips.com/viewthread.cfm?qid=1123112
    We may try the workaround: Write an Excel macro which connects to the database and fetch the data based on the SQL query.
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    If you have further question about write macro, I recommend you post the question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • APEX,PDF's, BI Publisher and SQL Query returning SQL code..

    I don't know if I should be posting this in this Forum or the BI Publisher forum, so I am posting in BOTH forums..
    I love APEX, let me say that first.. And appreciate the support offered here by the group, but am running int a confusing issue when BI Publisher tries to build a report from the above type APEX report..
    Here is my dilemma:
    I have a number of reports that are part of a Oracle package. They return an SQL Query back to a reports region on a page. I am having to deal with the column names returned are col01, col02..
    The issue I have is, when building the Application Level query to download the XML sample from in building RTF layouts in Word, you can not use this code, you MUST use a standard SQL Select.
    I have taken the sql from the function returning sql, and copied into the application query, supplying the required data values for bind variables being used in the query.
    An XML file is produced, and I use this to build the RTF format file that I load back into APEX and try to use it for the PDF rendering of the report. I can view the output as a PDF in the Word add on, but when I try using it with the report, it is returning an empty PDF file.
    Can anyone tell me what error log files on the bi publisher side I can look at to see what error is happening?
    Thank you,
    Tony Miller
    UTMB/EHN
    Title adjusted to allow people to know what I am talking about...
    Message was edited by:
    Tony Miller

    Tony,
    You can find the log as follows:
    - go to http://[yourserver]:[yourport]/em
    - logon to OC4J EM: oc4jadmin/[yourpassword]
    - click on "logs" at the bottom of the page
    - in the hgrid/tree, expand OC4J->home->Application
    xmlpserver
    - click on view log icon
    You can also observe what's going on in BI Publisher
    by going to the command prompt from where you started
    it.
    Or, as a third option, you can locate the file on
    your file system, depending on your setup, the path
    would be something similar to this:
    \oracle\product\10.2.0\bip\j2ee\home\application-deplo
    yments\xmlpserver\application.log
    With that said though, I don't expect you'll find
    much in there that would help with your particular
    problem. I suspect you either get no rows in your XML
    at runtime, due to some session state issues, or your
    XML structure does in fact not match your RTF
    template.
    I'm not quite following your problem description,
    i.e. when did you do what and are you associating
    your report layout with a report query or report
    region. So just some general notes, your query needs
    to be parseable at design-time, when exporting the
    XML, so that you get the XML file with the proper
    column names derived from your query. If you want to
    use your RTF template with a standard report region,
    you must export the XML file first using the advanced
    XML structure option. And of course the column names
    in your report query need to match the column names
    in your report region.
    Perhaps this helps you further diagnose what's going
    on, if you have additional information that could
    help, let me know. And if you could stage this on
    apex.oracle.com, I'd be happy to take a look.
    Regards,
    MarcMarc,
    Thanks for looking at this issue. Below find my remarks to your questions..
    Re: your query needs
    to be parseable at design-time, when exporting the
    XML, so that you get the XML file with the proper
    column names derived from your query.At the start of this process, the query code was a function in a package. The function was returning an SQL select statement, for a report region on a page. I took the select statement, built an application query to build a sample of the xml for BI Publisher desktop (Add-on for Word). The code was producing the usual Col01, Col02.. since at design time that is were the column names.
    When I then took the xml from this and built the rtf for loading into my APEX application.
    When testing the Application Query with this RTF report layout, I am getting PDF's. When using it with the report region sending an xml feed to BI Publisher I am getting nothing back.
    I have since taken the sql code and moved it back into the report region, and set the region to have a type of straight SQL Query. I have even tried to hard-code the parameters I was getting from the page to limit data returned.
    Is it possible to see the xml being produced by the APEX page?
    Re: Stage this on apex.oracle.com.. I would love to, but we would have HIPPA issues if I posted the data on a public website.
    Can I send you the RTF file and the xml file that the application query is creating to see if there something weird about them?
    Thank you,
    Tony Miller
    UTMB/EHN

  • SQL Query returns question marks

    I am seeing a SQL Query, executed via ADODB in VB, from a 10G client (don't know exact version) to a Sun Solaris based 9.2.0.5.0 Server return all question marks...Table queried consists of 3 columns, 2 varchar2, one long: Here query:
    SELECT SETTINGVALUE FROM EWORKFLO.CONFIG WHERE SETTINGGROUP='New test' AND SETTINGNAME='Single Page'
    The query results in 2576 question marks...(????? etc).
    Any idea what may be going on here?
    Thanks...
    Leendert

    Hello Tak,
    Thanks for replying. When this query is run from SQLPLUS we get a proper result back, that is the actual values from the SETTINGVALUE column. This is the LONG column and contains data like this:
    [Scan Section]
    DeviceTimeout=15
    Display=1
    hDCCreate=0
    Unit=0
    DialogTitle=
    IniFileName=c:\winnt\temp\kf.ini
    IniSectionName=Scan Section
    DeviceCache=1
    etc....etc....
    Depending on the settings created, the return string may vary in length.
    Leen

  • Query returns data from previous month. Need to have it return data for the entire year

    This is the part of the query that returns data by month:
    (YEAR(`rereport`.`market_reports_5`.start_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)AND MONTH(`rereport`.`market_reports_5`.start_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH))
    How can I get it to return data for the year.
    TIY

    How about omitting the MONTH part:
    (YEAR(`rereport`.`market_reports_5`.start_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH)
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • SQL Query returns values like "---" and "NA"

    Hi
              When I execute a sql query in MII it returns values like "---" and "NA" for empty Char and numeric fields respectively.
    I have checked the database and made sure that these fields does not have any value. This happens only when I run the query through MII. Can any one know how can we get rid of these values?
    Thanks in advance
    Shaji

    Shaji,
    MII sets those values as a default if it discovers null values in a query result. You can change this default behaviour in several ways.
    First, have a look at the document [Setting custom null values in XML|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70628af0-8ec4-2c10-7da2-f451e412dd8f?quicklink=index&overridelayout=true]. Then you may also use SQL functions like [NVL|http://www.techonthenet.com/oracle/functions/nvl.php] to change the value directly in the SQL query. You can also change the value inside the MII BLT to whatever you need.
    Michael

  • Why Doesn't Query Return Date Values On Eval Table?

    Using Oracle 11.2.0.1 with XMLType Secure File Table named Eval.
    An interesting situation is occurring when attempting to query. A couple of things are going on.
    These queries do not have registered schemas.
    1. This query works fine
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact/ns7:defId' passing e.object_value AS "p" RETURNING CONTENT)
    AS varchar2(100)) "Definition ID"
    FROM eval e;When adding a condition in the query to get defId=52657, get all nulls - even though this record exists - see sample data below.
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact[/ns7:defId=888]/ns7:defId' passing e.object_value AS "p" RETURNING CONTENT)
    AS varchar2(100)) "Definition ID"
    FROM eval e;
    <?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?><eval createdById="1957" acmeMemberId="3df55bd8-b3a6-4ba3-85e7-e8a188b7b4ed" category="external" eval_dt="2012-02-11T23:45:10.266Z" evalId="876d4035-aaf9-4f09-ae40-43498ec4973b" xmlns="http://www.cigna.com/acme/domains/eval/2010/03" xmlns:ns2="http://www.cigna.com/acme/domains/derived/fact/2010/03" xmlns:ns3="http://www.cigna.com/acme/domains/common/2010/03">
       <derivedFacts>
          <ns2:derivedFact>
             <ns2:defId>52657</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52657:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52600</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52600:2</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>null</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52599</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52599:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>INT</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51400</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51400:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>integer</ns2:type>
                <ns2:value>34</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52177</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52177:3</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>null</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52075</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52075:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>string</ns2:type>
                <ns2:value>M</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51391</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51391:1</ns2:defUrn>
             <ns2:factSource>CCDR Member</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51473</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51473:1</ns2:defUrn>
             <ns2:factSource>CCDR Product</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>date</ns2:type>
                <ns2:value>2011-01-01</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51474</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51474:1</ns2:defUrn>
             <ns2:factSource>CCDR Product</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>date</ns2:type>
                <ns2:value>9999-12-31</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>52151</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:52151:3</ns2:defUrn>
             <ns2:factSource>CCDR Product</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>51048</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:51048:5</ns2:defUrn>
             <ns2:factSource>CCDR ProfileFact</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
          <ns2:derivedFact>
             <ns2:defId>60380</ns2:defId>
             <ns2:defUrn>urn:coderunner:Medical:Definition:DerivedFact:60380:1</ns2:defUrn>
             <ns2:factSource>CCDR ProfileFact</ns2:factSource>
             <ns2:origInferred_dt>2012-02-11T23:45:10.266Z</ns2:origInferred_dt>
             <ns2:factValue>
                <ns2:type>boolean</ns2:type>
                <ns2:value>true</ns2:value>
             </ns2:factValue>
          </ns2:derivedFact>
       </derivedFacts>
    </eval>Seem to be missing something conceptually, as to why this is not working.
    2. When replacing defId with origInferred_dt and adjust for the datatype; the query returns all nulls
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact/ns7:origInferred_dt' passing e.object_value AS "p" RETURNING CONTENT)
    AS TIMESTAMP WITH TIME ZONE) "Original Inferred Date"
    FROM croutreach.eval e;Same here, seem to be missing something conceptually...
    Ultimately hoping to get this query to correctly work:
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact[/ns7:defId=52657]/ns7:origInferred_dt' passing e.object_value AS "p" RETURNING CONTENT)
    AS TIMESTAMP WITH TIME ZONE) "Original Inferred Date"
    FROM croutreach.eval e;Any assistance would be much appreciated to say the least! :)
    Regards,
    Rick Blanchard

    Hi Rick,
    Ultimately hoping to get this query to correctly work:
    SELECT xmlcast(xmlquery('declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";
    declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03";
    $p/eval/derivedFacts/ns7:derivedFact[/ns7:defId=52657]/ns7:origInferred_dt' passing e.object_value AS "p" RETURNING CONTENT)
    AS TIMESTAMP WITH TIME ZONE) "Original Inferred Date"
    FROM croutreach.eval e;
    Remove the initial slash in the predicate [ns7:defId=...] :
    xmlcast(
      xmlquery(
        'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03"; (::)
         declare namespace ns7="http://www.cigna.com/acme/domains/derived/fact/2010/03"; (::)
         $p/eval/derivedFacts/ns7:derivedFact[ns7:defId=52657]/ns7:origInferred_dt'
         passing e.object_value AS "p"
         RETURNING CONTENT
      AS TIMESTAMP WITH TIME ZONE
    ) "Original Inferred Date"

Maybe you are looking for

  • Alv to excel output printing

    Hi All, I have developed a Report and now facing problem in exporting the same to excel sheet. When we click the "Local File" icon in the report layout, the system will pop up a window with radio buttons. I have opted for 'Spreadsheet'. When i save t

  • Split Valuation Error during GRN Creation

    Hi, I am getting an error 'Material 2000750015 F419 not subject to split valuation' while posting GRN. Actually, the Valuation Category was bymistakely updated in this material earlier. The same was later removed from the material & then a new line i

  • Printing problem with Photosmart C4180

    Hello, I'm trying to print invitations on my Photosmart C4180.  I have a custom size of 6.25" by 6.25".  The directions on the invitations say I should manually feed the paper.  I can't find out how to do that.  Do you have any suggestions?  thank yo

  • Movie Not Loaded Error In Firefox

    Good day When I try and view a video in Firefox on YouTube or other sites, right clicking the video gives me a "movie not loaded..." error and the video does not load. Examples include videos from You Tube and Digg video. My Specs: - Firefox version

  • Quick way to create Lower thirds from Spreadsheet

    Maybe everyone knows this already since it came out when I was away from the forums, but I searched the Premiere Pro forums for the word "spreadsheet" and got no related results, so here goes.... There is a way to type all of your information for low