SsIncludeXml does not return the expected output

Hi
In the context of SiteStudio 10gR4:
I want to emulate a simple key-value-map using a static list. The purpose is enable authors to reference frequently-changed text-variables and maintain them in a single file.
When I attempt to use the ssIncludeXml function to place the value on a page, I get no result outputted. I have checked (using the XML-features in Oracle JDeveloper 11g) that the XPath actually evaluates to the expected value (FLAF_VAL_1). When I call the ssGetXmlNodeCount function with the same arguments, I get the result "0".
What am I doing wrong? Is there any limitations on the kinds of XPath expressions that ssIncludeXml will evaluate?
Thanks!
I use this snippet to include the value:
[!--$ ssIncludeXml("KEYVAL_TEST", "//wcm:element[@name='Key'][text()='FLAF_KEY_1']/../wcm:element[@name='Value']/node()") --]And this is my test file in the document KEYVAL_TEST:
<?xml version="1.0" encoding="UTF-8"?>
<wcm:root xmlns:wcm="http://www.stellent.com/wcm-data/ns/8.0.0" version="8.0.0.0">
<wcm:list name="KeyValuePairs">
    <wcm:row>
      <wcm:element name="Key">FLAF_KEY_1</wcm:element>
      <wcm:element name="Value">FLAF_VAL_1</wcm:element>
    </wcm:row>
    <wcm:row>
      <wcm:element name="Key">FLAF_KEY_2</wcm:element>
      <wcm:element name="Value">FLAF_VAL_2</wcm:element>
    </wcm:row>
  </wcm:list>
</wcm:root>

Thank you for your reply!! It is great getting some helpful input to help me move forward on this issue!
2. What you are doing in the example is a bit simpler and not really sufficient to express the query, I need to perform.
I need to select the contents of a Value-element based on the value in corresponding Key-element in the row.
This can easily be formulated using XPath. I have already posted a few different XPath expressions that are equvalent for this XML-file. Each of the expressions works perfectly in JDeveloper when querying the XML-file, and yet fails in Site Studio.
The [Technical Reference|http://download.oracle.com/docs/cd/E10316_01/ouc.htm] states:
This script extension is a core Site Studio method that allows any element within managed XML file to be extracted and returned in an Idoc string variable, which be placed directly on a web page as an HTML snippet. The content of the XML node that is being extracted will be further evaluated in the scope of the current layout and therefore can include further server-side Idoc Script, if necessary.
The parameters are:
- dDocName of XML data file
- XPath expression (to identify a specific node or nodes of the XML data file)
Do you know what implementation of the XPath language is used in Site Studio?
Is it a subset of the language (the Technical Reference does not mention this at all)? Which subset?
Here is another XPath expression that works perfectly well in JDeveloper and fails in Site Studio:wcm:root/wcm:list/wcm:row[child::wcm:element[@name='Key']/text()[.='FLAF_KEY_1']]/wcm:element[@name='Value']/node()Any insights are appreciated! :-)

Similar Messages

  • When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card

    When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card. I have tested with both 1.0.3 and 1.0.5 clients with RabbitMQ 3.1.5.
    I was wondering if the community was aware of this problem and if there are any workarounds? If not what is the proper channel to file a bug report. An example code snippet is below. The test fails because the TextMessageMatcher expects the destination passed in on construction (second parameter) to equal the desination on the message received (aquired from getJMSDestination).
            Mockery context = new Mockery();
            final MessageListener messageListener = context.mock(MessageListener.class);
            final Latch latch = new LatchImpl();
            final String prefix = "test" + System.currentTimeMillis();
            context.checking(new Expectations() {
                    oneOf(messageListener).onMessage(with(new TextMessageMatcher("MSG1", prefix + ".1234")));
                    will(new CustomAction("release latch") {
                        @Override
                        public Object invoke(Invocation invocation) throws Throwable {
                            latch.unlatch();
                            return null;
            final Connection connection = createConnection(null, null);
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            connection.start();
            Topic wildcardTopic = (Topic) getInitialContext().lookup(prefix + "." + "#");
            Topic destination = (Topic) getInitialContext().lookup(prefix + ".1234");
            final MessageConsumer consumer = session.createConsumer(wildcardTopic);
            consumer.setMessageListener(messageListener);
            MessageProducer producer = session.createProducer(null);
            producer.send(destination, session.createTextMessage("MSG1"));
            latch.await(5000);
            connection.close();
            Thread.sleep(5);
            context.assertIsSatisfied();

    Check where your MDB sends the [response] messages to.

  • LOV does not return the value (2)

    PPR in general does not work correctly if invalid HTML is generated. One example of an invalid HTML is having an opening <TD> tag immediately following another opening <TD> tag.
    After checking everything else, if LOV still does not return the value, test whether it's not a problem with the invalid HTML by placing the messageLovInput outside of the complicated layout nestings you may have. If it works outside of the layout nestings, look for the possible problems in the layout nestings.

    Hi RamKumar,
    Thanks for your reply.. I have already done that but no luck :(
    Regards,
    Hemanth J

  • When the program gets terminated unexpectedly (power failure, UPS fails), when I reopen it, it usually does NOT return the previous pages, as I have checked in the 'options' box,

    # Question
    When the program gets terminated unexpectedly (power failure, UPS fails), when I reopen it, it usually does NOT return the previous pages, as I have checked in the 'options' box, but goes to some random collection of pages often from months ago. Very frustrating - can anything be done to COMMAND it to save current pages and re-open there? (As I said, I have this box checked in the options, but it does not work ..

    Very Important, how much Free Space is on your Hard Drive first of all? Click on the Macintosh HD on the Desktop, then do a Get Info on it.
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    Do they launch OK while in Safe Mode?

  • The declared package does not match the expected package

    I was given some Java code that I need to get working and then make some improvements on, but I'm still in the process of learning Java and the IDE Eclipse as well. There is a package called MyGUI and most of the files in that package had the error "The declared package MyGui does not match the expected package MyGUI" as a result of the inconsistent case, so I changed all of the first lines "package MyGui" to "package MyGUI" and this fixed all of those problems except for one.
    There is still one file where it gives this error message even though I changed the code the same way I did for the other files. I can't figure why this file is different. I saved it and I also refreshed everything, but it still gives me the error message "The declared package MyGui does not match the expected package MyGUI" although the package is clearly declared as "MyGUI".
    Does anyone have an idea of why this would be? I am very new to Eclipse and Java, so I don't really know how to go about solving errors yet.

    Forget the IDE until you get a handle on basic concepts like packages and classpath.
    The error you're talking about comes when a .java or .class file is not in a directory that matches its declared package.
    Let's say that CLASSPATH_ROOT is the only element in your classpath. If you have a class that is declared like so:
    package com.foo;
    class Bar {}Then, you must have CLASSPATH_ROOT/com/foo/Bar.java or CLASSPATH_ROOT/com/foo/Bar.class.
    The language rules for .java files are not as strict as those for .class files, but some compilers may expect them to be the same, and it's a good idea to do so even if it's not strictly necessary, for clarity's sake.
    Also, even though Windows' file system is not case sensitive--that is it considers FOO.class and foo.class the same file name--Java is. You probably can't directly rename FOO.java to Foo.java in Windows, as it will say it's the same name, so if you need to change the case, rename it to a different name, than back to Foo with the correct case.
    Edited by: jverd on Mar 29, 2009 12:07 PM

  • The publisher of the uploaded package does not match the expected publisher . The publisher for this app is expected

    I have a Windows Phone Silverlight 8.1 project that i am trying to publish
    The publisher in the uploaded package does not match the
    expected publisher. The expected publisher for this app is: "CN=00000000-8F5B-44B4-BFC6-F16FB18F2358"
    I have the same Publisher Id set in the WMAppManifest file
    help me 
    thank you 

    Hi kadir u,
    >>The publisher in the uploaded package does not match the expected publisher. The expected publisher for this app is: "CN=00000000-8F5B-44B4-BFC6-F16FB18F2358"
    Based on the error information, we can see that the publisher value does not have the correct one. So please try to open the Package.appxmanifest, then modify the Publisher as "CN=00000000-8F5B-44B4-BFC6-F16FB18F2358":
    <Identity Name="*******"
    Publisher="CN=00000000-8F5B-44B4-BFC6-F16FB18F2358"
    Version="1.0.0.0" />
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The publisher in the uploaded package does not match the expected publisher.

    I have an existing Windows Phone 8 application in which I wish to release an update to. This update includes new features as well as targets the 8.1 platform. Because of an unknown problem with the original Visual Studio project
    where the app stopped being able to be deployed to test devices, it was faster to create a new Visual Studio project and copy over the existing code and assets than try and find the issue in the original project. This lead to the publisher GUIDs being different
    between the new and original projects.  
    Now when I try and submit the updated package within the Windows Phone Online dashboard I get the following error message "The publisher in the uploaded package does not match the expected publisher. The expected publisher
    for this app is: "CN=0745C81D-D1ED-49ED-A219-C546B5F31DE5"".
    I have updated both the WMAppManifest and Package.appxmanifest so that they have the following attributes and information:
    Package.appxmanifest (PhonePublisherId="0745C81D-D1ED-49ED-A219-C546B5F31DE5")
    And
    WMAppManifest (PublisherID="{0745C81D-D1ED-49ED-A219-C546B5F31DE5})
     I have then recompiled the app and uploaded and attempted to resubmit the update but I still get the error that the Publisher does not match. What have I missed??

    This sounds tricky... perhaps you can do a search in the entire app for the GUIDs and replace them.
    Also, you could build the appx package, rename the .appx to .zip, and open it up to see if you can find the wrong publisher id anywhere and it might give you a clue to where to make the change.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Eclipse error : The declared package does not match the expected package

    I'm trying to setup an Eclipse project on some existing code but I can't get past this error. The source files are in the following directories:
    d:\mycompany\coolstuff
    d:\mycompany\neatstuff
    The source files in the coolstuff directory have a package statement:
    package mycompay.coolstuff
    The source files in the neatstuff directory have a package statement:
    package mycompany.neatstuff
    I create a new Eclipse Java project, specify the existing directoy of d:\mycompany. When Eclipse tries to build, it gives the following error:
    The declared package "mycompany.coolstuff" does not match the expected package "coolstuff"
    I've tried everything I can think of short of modifying every package statement since they seem correct based on the Java documentation. What am I missing?

    All the source builds just fine using a command
    nd line and a classpath=.\That's meaningless, since classpath=.\ is just setting the classpath to the current directory.
    d:\mycompany\coolstuff
    d:\mycompany\neatstuff
    The source files in the coolstuff directory have a
    package statement:
    package mycompay.coolstuff
    The source files in the neatstuff directory have a
    package statement:
    package mycompany.neatstuff
    I create a new Eclipse Java project, specify the
    existing directoy of d:\mycompany.When you use the package statement "package mycompay.coolstuff" Eclipse looks in the directory above mycompany for mycompay\coolstuff\<classname>, and that directory is d:\, not d:\mycompany.
    When Eclipse
    tries to build, it gives the following error:
    The declared package "mycompany.coolstuff" does not
    match the expected package "coolstuff"

  • RoadMap does not return the selected step on ESS 600 Record Time entry

    RoadMap does not return the selected step on Record Time entry application in ESS. Is it suppose to behave similar way or is it suppose to take user to the selected step. If yes , then is there a setting or customization that i have to take care of, as its a standard SAP delivered ESS Record working time application.
    Please let me know. I appreciate your help in advance.

    Check with administrator in the src configuration thing,
    Cheers,
    Apparao

  • DATE type returned from function does not return the time component

    Hi,
    I'm dealing with a strange problem. I have a PL/SQL function (running on Oracle 8.1.4.7) which returns a DATE value. Like we all know the DATE datatype includes a date component and a time component.
    The function I used for testing is like this:
    FUNCTION ReturnDate return Date is
    dReturn Date;
    Begin
    select sysdate into dReturn from dual;
    return dReturn;
    end ReturnDate;
    When I call this function from .NET using ODP.NET the date value I get does not have the time component included only the day-month-year components.
    This is a code-snippet that calls the function :
    command.CommandText="Schema.ReturnDate";
    command.CommandType=CommandType.StoredProcedure;
    command.Parameters.Add("Return_Value",
    OracleDbType.Date,0,ParameterDirection.ReturnValue);
    command.ExecuteNonQuery();
    I use the OracleDbType.Date type which I think is the most logical choice, because the type in the Database is after all DATE.
    However this does not include the time componet. But if I change the OracleDbType.Date to OracleDbType.TimeStamp I get the time component. I'm not happy with this "hack" because I'm not sure what will happen when we upgrade our version of the Database to Oracle 9i which uses the new TimeStamp datatype.
    Is this a bug that the OracleDbType.Date does not include the time component??

    How do you examine the output Date value?
    If it is from the string, then the time components will
    not show because the NLS_DATE format in the client
    machine does not contain the time components.
    In American, the Date format is 'DD-MON-RR' by default whereas, the TimeStamp format is 'DD-MON-RR HH.MI.SSXFF AM' by default.
    Can you take a look at the time components from the OracleDate by accessing the time properties, eg. OracleDate.Hour, OracleDate.Minute..etc to see if the time values are there?
    Thanks
    Martha

  • Not getting the expected output in report, run throughapps

    hi,
    when i run the report through apps, there are some records missing. But, i executed the same query in TOAD, which is used in the data model of the report, and i got the expected output. But, the same, when run through apps, not giving the result.
    Can anybody please help me in this regard?
    Thanks,
    maschender

    You should probably ask in
    PL/SQL
    Note: Make Sure you post your table structure, your sample query and expected output.

  • Integrations services error 4000 - integration services does not match the expected version

    I have a 2 node high availability cluster built on 2012r2 DataCentre. One VM continually fails to backup and gives the event log error
    "Hyper-V Volume Shadow Copy Requestor failed to connect to virtual machine 'QuadPro' because the version does not match the version expected by Hyper-V (Virtual machine ID 094B6B22-BBED-4D0B-8E47-D8D4D0D3F986). Framework version: Negotiated (0.0) -
    Expected (3.0); Message version: Negotiated (0.0) - Expected (5.0). To fix this problem, you must upgrade the integration services. To upgrade, connect to the virtual machine and select Insert Integration Services Setup Disk from the Action menu."
    When I do the suggested action I get a message stating
    "The computer is already running the current version of integration services (version 6.3.9600.16384)".
    This VM was built through the failover management console under 2012r2. The VM in question is a 2008r2 standard server running a single database application.
    Please advise.
    Matt

    Hi,
    I have run the command using both nodes and get the following error:
    PS C:\Users\*******> Get-VMIntegrationService -ComputerName node01 -VMName quadpro
    Get-VMIntegrationService : A parameter is invalid. Hyper-V was unable to find a virtual machine with name quadpro.
    At line:1 char:1
    + Get-VMIntegrationService -ComputerName node01 -VMName quadpro
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (quadpro:String) [Get-VMIntegrationService], VirtualizationInvalidArgum
       entException
        + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVMIntegrationServiceCommand
    However I tried one of the other VMs for testing purposes (and to check syntax etc) and got the following success message.
    PS C:\Users\******> Get-VMIntegrationService -ComputerName node02 -VMName appserver01
    VMName      Name                    Enabled PrimaryStatusDescription SecondaryStatusDescription
    Appserver01 Time Synchronization    True    OK
    Appserver01 Heartbeat               True    OK                      
    OK
    Appserver01 Key-Value Pair Exchange True    OK
    Appserver01 Shutdown                True    OK
    Appserver01 VSS                     True    OK
    Appserver01 Guest Service Interface False   OK

  • Comcast will not accept my spot because the  audio sampling value of 44100 does not match the expected rate of 48000. Any ideas how to fix?

    I am working with Final Cut Pro 10.1.4.  I created a 30 second spot with a music bed.  Comcast is rejecting the spot because the audio sampling rate does not match the actual audio values in the spot.  They expected 48000 and my spot is 44100.  This may be caused because I was forced to change the speed of the audio to work properly in the spot.  The audio was sped up to 101%.  First, is this what caused Comcast to reject and second, is there a way to restore the rate without slowing down the music bed?
    Thanks!

    FFirst check your project properties. The default is 48K.

  • Toplink does not return the object sometimes - VeryHigh Volume application

    Hi All,
    Toplink version: 10.1.3.4, OAS 10.1.3.4, Oracle 10g, RedHat linux 4.0
    We have a high volume application where toplink issues one of our queries like 25K times/hour.Query is a simple one querying the table based on the primary key(Id) that should return 1 object.
    This query is not returning the object sometimes I should say like 200 times/hour. What bothers me is that the same query on the same Id(primary-key) returns the object another time.
    I did enable the toplink logging level to FINE where I could see the SQL query getting issued to the DB, I was unsuccessful in changing the logging level to ALL to check if the object is getting returned by the toplink layer and being registered in the cache kind of details.
    This is not easily re-producable as this only occurs in our Pre-Prod environment where we can simulate high volume. This completely baffles me and I am running out of ideas.
    Thanks in advance.
    -Ram
    Edited by: Raam on Jun 4, 2009 7:41 PM

    If you are configured for an isolated cache then there should be no concurrency issues. Each thread will query the database directly and load the object into the UnitOfWork. Is there an Exception handler configured on TopLink? Are you getting a timeout exception or some other exception that is being ignored?
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • PLSQL function does not return the correct number of rows?

    Hey folks. I'm still green when it comes to writing PLSQL. It's fun, rewarding and very frustrating. Hence, I'm turning to the experts. If you folks can help me understand what I'm doing wrong here, I'd really appreciate it.
    The code is somewhat specific to my company's product, but I think it should be easy to read and understand what I'm doing. If not, please let me know what I can clarify.
    All i'm trying to do is determine if the most recent iteration of data available for a particular host is a full scan or not (level2). I go about this in the following manner:
    1. get the operatingsystem id, it's scandate (preferred), the most recent scandate and it's scan status from a table of where all operating systems data lives. Loop through all the Oses
    (from this I set v_osid, v_mostrecentscandate, v_scandate).
    2. Before doing the crazy logic, pick the low hanging fruit
    2a. if the the level2 status of the host is N, then v_level2 = 'N';
    2b. if the level2 = 'Y' and the mostrecentscandate and scandate are identical, then v_level2 = 'Y';
    2c. for all other cases, go to 3
    3. Using v_mostrecentscandate, find all table id that may hold the most recent instance of data for the host
    4. Loop through through the concatenation of that id + _base. If you find the id in those tables, then store the id for the next step.
    5. When you I find the right id, I now concatenate the id + attrdata. For the host id, I look for any rows where attribute_value in (..) and the corresponding number_value is not null.
    5b. set v_level2 = 'Y'
    5c. otherwise, set v_level2 = 'N'
    6 end the loop
    7 wash, rinse, repeat for each OS.
    create or replace package body mostrecentlevel2 as
    function getMostRecentL2 return bdna_mostrecent_level2 pipelined IS
    v_lsid NUMBER;
    v_sql VARCHAR2(5000);
    v_sql_baseid NUMBER;
    v_sql_numv NUMBER;
    v_lsidt VARCHAR2(5000);
    v_lsidt2 VARCHAR2(5000);
    v_sql_rec VARCHAR2(5000);
    v_osid NUMBER;
    v_anchor DATE;
    v_ls CHAR(2);
    v_level2 CHAR(1);
    v_mostrecentscandate DATE;
    v_scandate DATE;
    cursor getOSinfo_cur is select operatingsystem_id, scandate, mostrecentscandate, level2 from bdna_all_os;
    cursor getlsID_cur is select id from local_scan where
              ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60)
              and
              ((trunc(collect_end_time) - to_date(v_anchor))*24*60*60) >= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60);
    getOSinfo_rec getOSinfo_cur%rowtype;
    getlsID_rec getlsID_cur%rowtype;
    BEGIN
    v_ls := 'ls';
    v_anchor := '01-JAN-01';
    FOR getOSinfo_rec IN getOSinfo_cur LOOP
         v_osid := getOSinfo_rec.operatingsystem_id;
         v_mostrecentscandate := getOSinfo_rec.mostrecentscandate;
         v_scandate := getOSinfo_rec.scandate;
         IF getOSinfo_rec.level2 = 'N' THEN
              v_level2 := 'N';
         ELSIF getOSinfo_rec.level2 = 'Y' THEN
              IF v_mostrecentscandate != v_scandate THEN
                   FOR getlsID_rec IN getlsID_cur LOOP
                        v_lsid := getlsID_rec.id;
                        v_lsidt := v_ls||v_lsid;
                        v_sql := 'select id from '||v_lsidt||'_base where id = '||chr(39)||v_osid||chr(39);
                        EXECUTE IMMEDIATE v_sql into v_sql_baseid;
                        IF SQL%ROWCOUNT > 0 THEN
                             v_lsidt2 := v_lsidt;
                             v_sql := '';
                        END IF;
                   END LOOP;
                   v_sql := 'select number_value from '||v_lsidt2||'_attr_data where
                             lower(attribute_name) IN ('||chr(39)||'numcpus'||chr(39)||', '||chr(39)||'totalmemory'||chr(39)||', '||chr(39)||'cpuutilpercent'||chr(39)||', '||chr(39)||'numprocesses'||chr(39)||')
                             and
                             number_value is not NULL
                             and
                             element_id = '||chr(39)||v_osid||chr(39);
                   EXECUTE IMMEDIATE v_sql into v_sql_numv;
                   IF SQL%ROWCOUNT > 0 THEN
                        v_level2 := 'Y';
                   ELSE v_level2 := 'N';
                   END IF;
              END IF;
              v_level2 := 'Y';
         END IF;
         PIPE ROW (mostRecentLevel2Format(v_osid,v_mostrecentscandate,v_level2));
    END LOOP;
    END;
    END;
    /Now some will ask why I'm using pipelining? Again, I'm green.. I was reading around, looking for a way to make this code run as fast as possible (because it's potentially got to go through 56K records and perform the expensive work on).
    I also realize I'm not providing the type or package code, and that's because I think I'm good on that. The code above compiles just fine without errors and when it runs, it only returns 6 consecutive rows.. I'm expecting 70K lol. So I know I'm doing something wrong.
    Any thoughts?
    Oh forgot to add this is on 11g R1 Enterprise Edition
    Edited by: ErrolDC on Nov 14, 2011 4:52 PM
    Edited by: ErrolDC on Nov 14, 2011 5:07 PM

    ErrolDC wrote:
    Hey folks. I'm still green when it comes to writing PLSQL. It's fun, rewarding and very frustrating. Hence, I'm turning to the experts. If you folks can help me understand what I'm doing wrong here, I'd really appreciate it.
    The code is somewhat specific to my company's product, but I think it should be easy to read and understand what I'm doing. If not, please let me know what I can clarify.Post a complete script that peoople who aren't as familiar with the application as you are can run to re-create the problem and test their ideas. In this case, that includes CREATE TABLE and INSERT statements for the tables used (just the columns needed for this job), a query that uses the function, and the results you want from that query given the data you posted.
    All i'm trying to do is determine if the most recent iteration of data available for a particular host is a full scan or not (level2). I go about this in the following manner:
    1. get the operatingsystem id, it's scandate (preferred), the most recent scandate and it's scan status from a table of where all operating systems data lives. Loop through all the Oses
    (from this I set v_osid, v_mostrecentscandate, v_scandate).
    2. Before doing the crazy logic, pick the low hanging fruit
    2a. if the the level2 status of the host is N, then v_level2 = 'N';
    2b. if the level2 = 'Y' and the mostrecentscandate and scandate are identical, then v_level2 = 'Y';
    2c. for all other cases, go to 3
    3. Using v_mostrecentscandate, find all table id that may hold the most recent instance of data for the host
    4. Loop through through the concatenation of that id + _base. If you find the id in those tables, then store the id for the next step.
    5. When you I find the right id, I now concatenate the id + attrdata. For the host id, I look for any rows where attribute_value in (..) and the corresponding number_value is not null.
    5b. set v_level2 = 'Y'
    5c. otherwise, set v_level2 = 'N'
    6 end the loop
    7 wash, rinse, repeat for each OS.
    create or replace package body mostrecentlevel2 as
    function getMostRecentL2 return bdna_mostrecent_level2 pipelined IS
    v_lsid NUMBER;
    v_sql VARCHAR2(5000);
    v_sql_baseid NUMBER;
    v_sql_numv NUMBER;
    v_lsidt VARCHAR2(5000);
    v_lsidt2 VARCHAR2(5000);
    v_sql_rec VARCHAR2(5000);
    v_osid NUMBER;
    v_anchor DATE;
    v_ls CHAR(2);
    v_level2 CHAR(1);
    v_mostrecentscandate DATE;
    v_scandate DATE;
    cursor getOSinfo_cur is select operatingsystem_id, scandate, mostrecentscandate, level2 from bdna_all_os;
    cursor getlsID_cur is select id from local_scan where
              ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60)
              and
              ((trunc(collect_end_time) - to_date(v_anchor))*24*60*60) >= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60);
    getOSinfo_rec getOSinfo_cur%rowtype;
    getlsID_rec getlsID_cur%rowtype;
    BEGIN
    v_ls := 'ls';
    v_anchor := '01-JAN-01';
    FOR getOSinfo_rec IN getOSinfo_cur LOOP
         v_osid := getOSinfo_rec.operatingsystem_id;
         v_mostrecentscandate := getOSinfo_rec.mostrecentscandate;
         v_scandate := getOSinfo_rec.scandate;
         IF getOSinfo_rec.level2 = 'N' THEN
              v_level2 := 'N';
         ELSIF getOSinfo_rec.level2 = 'Y' THEN
              IF v_mostrecentscandate != v_scandate THEN
                   FOR getlsID_rec IN getlsID_cur LOOP
                        v_lsid := getlsID_rec.id;
                        v_lsidt := v_ls||v_lsid;
                        v_sql := 'select id from '||v_lsidt||'_base where id = '||chr(39)||v_osid||chr(39);
                        EXECUTE IMMEDIATE v_sql into v_sql_baseid;
                        IF SQL%ROWCOUNT > 0 THEN
                             v_lsidt2 := v_lsidt;
                             v_sql := '';
                        END IF;
                   END LOOP;
                   v_sql := 'select number_value from '||v_lsidt2||'_attr_data where
                             lower(attribute_name) IN ('||chr(39)||'numcpus'||chr(39)||', '||chr(39)||'totalmemory'||chr(39)||', '||chr(39)||'cpuutilpercent'||chr(39)||', '||chr(39)||'numprocesses'||chr(39)||')
                             and
                             number_value is not NULL
                             and
                             element_id = '||chr(39)||v_osid||chr(39);
                   EXECUTE IMMEDIATE v_sql into v_sql_numv;
                   IF SQL%ROWCOUNT > 0 THEN
                        v_level2 := 'Y';
                   ELSE v_level2 := 'N';
                   END IF;
              END IF;
              v_level2 := 'Y';
         END IF;
         PIPE ROW (mostRecentLevel2Format(v_osid,v_mostrecentscandate,v_level2));
    END LOOP;
    END;
    END;
    /Now some will ask why I'm using pipelining? Again, I'm green.. I was reading around, looking for a way to make this code run as fast as possible (because it's potentially got to go through 56K records and perform the expensive work on).
    I also realize I'm not providing the type or package code, and that's because I think I'm good on that. The code above compiles just fine without errors and when it runs, it only returns 6 consecutive rows.. I'm expecting 70K lol. So I know I'm doing something wrong. You're calling TO_DATE with a DATE argument. Why are you calling TO_DATE at all?
    It seems like this condition:
    ((trunc(collect_start_time) - to_date(v_anchor))*24*60*60) <= ((to_date(v_mostrecentscandate) - to_date(v_anchor))*24*60*60) is equivalent to
    TRUNC (collect_start_time) <= v_mostrecentscandateThat probably has nothing to do with why you're only getting 6 rows.

Maybe you are looking for