Output 2 Extra Records That Are Sorted

I want to map a repeating group to a similar output repeating group and also add 2 extra records to the output with the output sorted on the first element.
Here's my input...
<Request>
<Records>
<OrderType>4</OrderType>
<OrderValue>01</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>01</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>02</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>03</OrderValue>
</Records>
</Request>
Here is my desired output...
<Request>
<Records>
<OrderType>1</OrderType>
<OrderValue>05</OrderValue>
</Records>
<Records>
<OrderType>2</OrderType>
<OrderValue>00</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>01</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>01</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>02</OrderValue>
</Records>
<Records>
<OrderType>4</OrderType>
<OrderValue>03</OrderValue>
</Records>
</Request>
I know I need to use Inline XSLT but cannot work out how to output the 2 extra records and ensure Order Type is in sequence.
Both input and output use the same schema.

Hi Stewart,
If you use the following XSLT this add two extra nodes and sort the existing (input) nodes by OrderType. For sorting the existing node by OrderType, I am using
Muenchian here. This XSLT outputs as you have wanted. I have given comments for your understanding.
<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
<xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
<xsl:key name="groups" match="Records" use="OrderType"/>
<xsl:template match="/">
<xsl:apply-templates select="/Request" />
</xsl:template>
<xsl:template match="/Request">
<Request>
<!--Add two extract node-->
<Records>
<OrderType>1</OrderType>
<OrderValue>05</OrderValue>
</Records>
<Records>
<OrderType>2</OrderType>
<OrderValue>00</OrderValue>
</Records>
<!--Sort the existing node by Order Type-->
<xsl:for-each select="Records[generate-id(.)=generate-id(key('groups',OrderType))]">
<xsl:sort select="OrderType" order="ascending"/>
<xsl:for-each select="key('groups',OrderType)">
<Records>
<OrderType>
<xsl:value-of select="OrderType/text()" />
</OrderType>
<OrderValue>
<xsl:value-of select="OrderValue/text()" />
</OrderValue>
</Records>
</xsl:for-each>
</xsl:for-each>
</Request>
</xsl:template>
</xsl:stylesheet>
Note: You may need to change the namespace as per your schema definition.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Similar Messages

  • Deleting the Records that are in odd position

    Hi,
       How to delete the records that are in the odd position.
    This is my program. Plz correct me. Iam not able to delete the records.
    REPORT  ZMTSHPRG19                              .
    TYPES:
    BEGIN OF TY_EMP,
    EMPID(4) TYPE N,
    ENAME(30) TYPE C,
    DEPT(4) TYPE C,
    SALARY TYPE I,
    END OF TY_EMP.
    DATA:
    FS_EMP TYPE TY_EMP,
    IT_EMP TYPE TABLE OF TY_EMP.
    FS_EMP-EMPID = '1009'.
    FS_EMP-ENAME = 'XX'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = 10000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = '1007'.
    FS_EMP-ENAME = 'YY'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = '11000'.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1008.
    FS_EMP-ENAME = 'ZZ'.
    FS_EMP-DEPT = 'D200'.
    FS_EMP-SALARY = 12000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1001.
    FS_EMP-ENAME = 'XY'.
    FS_EMP-DEPT = 'D200'.
    FS_EMP-SALARY = 10000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1003.
    FS_EMP-ENAME = 'XZ'.
    FS_EMP-DEPT = 'D300'.
    FS_EMP-SALARY = 8000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1002.
    FS_EMP-ENAME = 'YX'.
    FS_EMP-DEPT = 'D300'.
    FS_EMP-SALARY = 9500.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1004.
    FS_EMP-ENAME = 'YZ'.
    FS_EMP-DEPT = 'D300'.
    FS_EMP-SALARY = 9500.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1005.
    FS_EMP-ENAME = 'AA'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = 10500.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1006.
    FS_EMP-ENAME = 'BB'.
    FS_EMP-DEPT = 'D200'.
    FS_EMP-SALARY = 12000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1010.
    FS_EMP-ENAME = 'CC'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = 15000.
    APPEND FS_EMP TO IT_EMP.
    LOOP AT IT_EMP INTO FS_EMP.
    WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.
    ENDLOOP.
    ULINE.
    DATA:
    LINE_COUNT TYPE I,
    W_REM TYPE I.
    W_REM = LINE_COUNT MOD 2.
    DESCRIBE TABLE IT_EMP LINES LINE_COUNT.
    SORT IT_EMP BY EMPID.
    IF W_REM = 0.
    LOOP AT IT_EMP INTO FS_EMP.
    WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY..
    ENDLOOP.
    ENDIF.
    Thanks.

    TYPES:
    BEGIN OF TY_EMP,
    EMPID(4) TYPE N,
    ENAME(30) TYPE C,
    DEPT(4) TYPE C,
    SALARY TYPE I,
    END OF TY_EMP.
    DATA:
    FS_EMP TYPE TY_EMP,
    IT_EMP TYPE TABLE OF TY_EMP.
    FS_EMP-EMPID = '1009'.
    FS_EMP-ENAME = 'XX'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = 10000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = '1007'.
    FS_EMP-ENAME = 'YY'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = '11000'.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1008.
    FS_EMP-ENAME = 'ZZ'.
    FS_EMP-DEPT = 'D200'.
    FS_EMP-SALARY = 12000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1001.
    FS_EMP-ENAME = 'XY'.
    FS_EMP-DEPT = 'D200'.
    FS_EMP-SALARY = 10000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1003.
    FS_EMP-ENAME = 'XZ'.
    FS_EMP-DEPT = 'D300'.
    FS_EMP-SALARY = 8000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1002.
    FS_EMP-ENAME = 'YX'.
    FS_EMP-DEPT = 'D300'.
    FS_EMP-SALARY = 9500.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1004.
    FS_EMP-ENAME = 'YZ'.
    FS_EMP-DEPT = 'D300'.
    FS_EMP-SALARY = 9500.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1005.
    FS_EMP-ENAME = 'AA'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = 10500.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1006.
    FS_EMP-ENAME = 'BB'.
    FS_EMP-DEPT = 'D200'.
    FS_EMP-SALARY = 12000.
    APPEND FS_EMP TO IT_EMP.
    FS_EMP-EMPID = 1010.
    FS_EMP-ENAME = 'CC'.
    FS_EMP-DEPT = 'D100'.
    FS_EMP-SALARY = 15000.
    APPEND FS_EMP TO IT_EMP.
    LOOP AT IT_EMP INTO FS_EMP.
    WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.
    ENDLOOP.
    ULINE.
    DATA:
    LINE_COUNT TYPE I,
    W_REM TYPE I,
    n type i value 1.
    DESCRIBE TABLE IT_EMP LINES LINE_COUNT.
    SORT IT_EMP BY EMPID.
    LOOP AT IT_EMP INTO FS_EMP.
    w_rem = n mod 2 .
    if w_rem = 0 .
    WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.
    endif.
    n = n + 1.
    ENDLOOP.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:34 PM

  • Merging two linked lists of integers that are sorted

    hey guys,
    i need to write a method to merge two linked lists of integers that are sorted into ascending order. the results should be a third linked list that is the sorted combination of the original lists.
    can someone help me start this? Basically, the method will be taking in two sorted linked lists of integers and merge them into one big sorted linked list.
    Im just looking to get some algorithm ideas and maybe one or two lines of pseudocode to get me started.
    thanks

    i can't destroy the original lists so im gonna need
    to create a new sorted list. then since both of the
    lists im using are sorted, i'll just have to copy one
    of them into the new list i created. Then i will get
    an item from the unused list and search that node in
    the new copied list and insert in appropriate
    position using the two Nodes...example(prev and
    curr).That can work. I'd probably do it by initializing a new list and compare the first items in each of the original lists, inserting the smaller in my new list and advancing to the next element in the original list from which I took the item, repeating the process until I copied each item from both original lists. Don't forget to take into account that you will reach the end of one list before the other.

  • I want to create stored procedure which will give output rows from "values that are passed as one parameter (comma seperated) to store procedure".

    Hello,
    I want to create stored procedure which will give output rows from "values that are passed as one parameter (comma seperated) to store procedure".
    Suppose , 
    Parameter value : person 1,person2,person3 
    table structure : 
    Project Name | officers 1 | officers 2
    here, officers 1 or officers 2 may contain names of multiple people.
    expected OUTPUT : distinct list(rows) of projects where person 1 or person 2 or person 3 is either officer1 or officer 2. 
    please explain or provide solution in detail 
    - Thanks

    Hi Visakh,
    Thanks for reply.
    But the solution you provided giving me right output only if officer 1 or officer 2 contains single value , not with comma seperated value.
    Your solution is working fine for following scenario : 
    Project 
    Officers 1
    Officers 2
    p1
    of11
    off21
    p2
    of12
    off22
    with parameter : of11,off22 : it will give expected output
    And its not working in case of :
    Project 
    Officers 1
    Officers 2
    p1
    of11,of12
    off21,off23
    p2
    of12,of13
    off22,off24
    with parameter : of11,off22 : it will not give any row in output
    I need patten matching not exact match :) 
    ok
    if thats the case use this modified logic
    CREATE PROC GetProjectDetails
    @PersonList varchar(5000)
    AS
    SELECT p.*
    FROM ProjectTable p
    INNER JOIN dbo.ParseValues(@PersonList,',')f
    ON ',' + p.[officers 1] + ',' LIKE '%,' + f.val + ',%'
    OR ',' + p.[officers 2] + ',' LIKE '%,' + f.val + ',%'
    GO
    Keep in mind that what you've done is a wrong design approach
    You should not be storing multiples values like this as comma separated list in a single column. Learn about normalization . This is in violation of 1st Normal Form
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to store records that are entered in the fields?

    Hi friends can any one help me how to store the records that are given as input.
    Say if Empid - 123456, this 123456 has to be stored in table it will be stored but can any one help me with procedure?
    Thanks

    Hi,
    If the records are from an input file, you will have to first create a structure for the Employee id ....
    then, read the input file data into the internal table you have defined in the earlier step...
    then, loop at the records one after the other and update the records directly into the table....( typically this is a direct update of data and will be done when you were dealing with the data relating to a "Z" table )
    please follow the procedure and let me know how it worked for you or if you are still having issues on this.
    Thanks,
    Vishnu.

  • Need to process the records that are selected using checkbox in an ALV

    Hi ..
    I am displaying some data in an ALV using the Parent-child relation, the parent records has a check box which is input enabled.
    On click of a button on the toolbar, i need the checked records to be fetched and processed.
    Please help me on how to fetch the records that are checked..
    Thanks,
    Derek

    Hello Derek,
    Is ALV created using OOPS or using conventional FM?
    If you are making use of OOPS technique, then call this method:
    CALL METHOD <grid_name>->get_selected_rows.
    BR,
    Vishal.

  • Best way to obtain records that are NOT in another table

    I have two rather large tables in oracle. An Account table that has millions of rows. Each account may be enrolled into a particular program and therefore can also be in an Enrollment table, also with millions of rows. I'm trying to find the most optimal way to find any accounts in ACCOUNT that are NOT in the Enrollment table.
    I was doing something like this:
    select /*+ index(ACCOUNT idx_acct_no) */
    a.acct_no
    from ACCOUNT a
    where a.acct_no not in (Select e.acct_no from ENROLLMENT e);
    This takes a VERY long time to execute, even though I am using the index.
    I even tried to use the PK on the ACCOUNT table, as it is also a FK on the ENROLLMENT table as such:
    select a.acct_no
    from ACCOUNT a
    where a.id not in (Select e.id from ENROLLMENT e);
    this too takes too long to get back (if at all).
    Is there a better way to do this selection please?

    Well if you have the energy to type in the whole list, the syntax you've given will work, unless you blow the permitted number of elements.
    But a practical solution would be to turn the list into a table. You still haven't got the hang of this "giving us enough information" concept, so let's presume:
    (1) you're on a version of the databasse whoch is 9i or higher
    (2) you have this list in a file of some sort.
    In which case use an external table or perhaps a pipelined function to generate output which can be used in a SQL statement.
    If neither of these solutions works for you please provide sufficient information for us to answer your question correctly. Your future co-operation is appreciated.
    cheers, APC

  • How to create an XSD for file adaptor which will ignore the records that are not required.

    Hi All,
       I have a requirement, the Fixed Length file contains
    30013742387462382938742      82347023984623087   
    30037348237  983743  9837423098  98347 
    10108472398   98034702398409238 9838472398   09823409238
    300163527 387462398746 38746293874693746324763
    101037642873643 37438724683746837648 873648736
    200138743986493874398
    2002738469837246
    10003784629837469283746937463987469387
    I need to select only the records that startswith 3001 and 3003 which are of different types and ignore the remaining records like 1010,2001,2002,1000.
    Can any one help me on this.

    You can make use of "conditionValue" or "startsWith" attributes while designing you native XSD.
    Check this example - Native Format Builder Wizard - 11g Release 1 (11.1.1.6.3) for better understanding.

  • Best approach to delete records that are not in the source table anymore.

    I have a situation where I need to remove records from dimensions that are not in the source data anymore. Right now we are not maintaing history, i.e. not using SCD but planning for the next release. If we did that it would be easy to figure the latest records. The load is nightly and records are updated and new added.
    The approach that I am considering is to join the dimension tables the the sources on keys and delete what doesn't join. However, is there perhaps some function in OWB that would allow to do this automatically on import so it can be also in place for the future?
    Thanks!

    Bear in mind that deleting dimension records becomes problematic if you have facts attached to them. Just because this record is no longer in the active set doesn't mean that it wasn't used historically, and so have foreign key constraints on it in your database. IF this is the case, a short-term solution would be to add an expiry_date field to the dimension and update the load to set this value when the record disappears rather than to delete it.
    And to do that, use the target dimension as a source table, outer join it to the actual source table on the natural key, and so your update will set expiry_date=nvl(expiry_date,sysdate) to set to sysdate if this record has not already been expired on all records where the outer join fails.
    Further consideration: what do you do if the record is re-inserted into the source table? create a new dimension key? Or remove the expiry date?
    But I will say that I am not a fan of deleting records in most circumstances. What do you do if you discover a calculation error and need to fix that and republish historical cubes? Without the historical data, you lose the ability to do things like that.

  • Omit notes during MIDI recording that are not in defined scale

    I'm looking for a way to do the following in Logic, but am not sure how to set this up. I want to be able to:
    1. Create a new midi track
    2. In selected midi track, select a scale (for example, Pentatonic Minor)
    3. Press record
    4. During recording, only notes played from Pentatonic Minor scale would "register" (make a sound) and be recorded. All other notes pressed on midi controller that are not in Pentatonic Minor would not "register" nor be recorded in the sequencer.
    Additionally helpful would be that in the piano roll sequencer after recording, I could only drag notes up or down along the Pentatonic Minor scale. In other words, I would not be allowed to drag a recorded note to another note that is not in Pentatonic Minor. If a note was dragged onto a "disabled" note, it would automatically snap to its nearest neighbor note in the Pentatonic Minor scale. Additionally useful would be to have all disabled notes (notes that are not in the Pentatonic Minor scale) appear to be disabled (grayed out) in the piano roll sequencer.
    If this is not possible, is there any feature in Logic that will get me close to doing what I want? If not, is there any other sequencer that does this? I know this is something I could probably do in Max, but I was hoping to be able to do it in Logic. Thanks.

    Patch this between the PhysicalIn and the SequencerIn in the Environment:
    !http://home.arcor.de/fuzzfilth/Other/mod.png!
    Get it here:
    http://home.arcor.de/fuzzfilth/Other/Modulator.zip
    Christian

  • Best way to create output with only topics that are not finalized

    I'm nearing the end of a project and I need to isolate the topics that still have questions. I keep trying things, but nothing gives me what I need. Any suggestions? Here's what I tried.
    I'm using RoboHelp 9 (RH9).
    Status
    I can get a report of the topic names and their status using Tools > Reports > Topic Properties and then setting the Options to include only Topic Status, but this isn't useful; that gives me a list of 396 topics, in alphabetical order.
    For each topic, you end up with 3 lines. For example:
    Adding Customers - Adding_Customers.htm
    Status:
    Status: Ready for Review
    I saved the report as TXT and opened it in Word and did a global replace of Status:^p (that is, Status, colon, new line) and then Status, colon, tab. That reduced it to 2 lines for each topic:
    Adding Customers - Adding_Customers.htm
    Ready for Review
    So that's still not very useful. I would have to write a macro or something in either the Word file or once I got it into Excel to concatentate those two lines.
    And even then, I could sort the data and get rid of the lines that show Complete (using an Excel formula), but how would I print out just those topics? If there are only a few, that's no problem, but there are at least 30. (Things changed and topics changed and now some need re-review, and some still have questions.)  Could I make an index out of those lines? No, that would involve a lot of work to write out the XML.
    Okay, so I tried another approach...
    Conditional Text
    I created a duplicate Table of Contents and applied my Questions condition to three topics. I then created a Printed Doc output and specified an Advanced condition saying to include only Questions. That gave me more than the three topics, but not all of the topics. The help says that you can use an Advanced Conditional Build Tag Expressions, and that if you want just those topics with a specific tag ("All topics to which one tag has been applied"), just include that tag.
    BUT it also says: "Topics and topic text to which you have applied no conditional build tag are included in the output."
    So, if I want only those topics to which I've applied a TOC condition of Questions, I need to create another condtion (for example, DONE), and apply that to all the topics that I don't want to print.
    So, assuming I have 30 topics with the condition Questions, I would have to apply my new DONE condition to 366 topics. Yes, I know you can apply a tag to more than one at a time, but I would be wary of doing more than 5-10 at once.
    Still, that looks like the best solution so far. I'm going to back up my project and then start doing that. In the meantime, does anyone have any other way of doing it?
    I'm using RoboHelp 9 (RH9).

    First, no reason to be concerned about applying a tag in the topic list to many topics.
    Before my time the company had an author who wrote in a topic "This is ****" intending to return to it later. He did when a customer phoned asking if the statement was true!
    What I have done is institute a simple method that also helps with reviewing. We add three hash marks ### to any topic at the top or at the point where it is incomplete. We do that using a character style rather than a paragraph so that the text can be within a paragraph. The style is called AuthorComment and we also apply a tag called AuthorComment. Both have a vivid colour applied. EXAMPLE ### Let me know if you have a problem with this.
    When we generate for internal review, we leave that stuff in as it grabs the attention of reviewers so they respond to the comment / question.
    When we generate for external use we add the tag to the build expression but we also do a search of all topics for ### using a third party find and replace tool. TextCrawler for example.
    It's simple and it works beautifully.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How to calculate Sum of records that are not Suppressed

    Hi All Experts,
    I have Created A layout for SAP B1 in crystal report.Because of Some Condition I have  to Suppress Detail Section.
    The Suppress Condition is As Follows
    {ExcisePur.ItemCode}=Previous({ExcisePur.ItemCode}) And {ExcisePur.Batchnum}=Previous({ExcisePur.Batchnum})
    And it is Working Fine,the Desired Detail Section is Suppressed.
    Now I Have to take Sum of Records ,But that records are also Calculated which are Suppressed.
    For these I have Read Several post where someone had same problem,
    there they have Asked to Create A Running Total And use the Formula in evaluate section same as in Suppress Condition but opposite of it.
    I did the same thing using these Formula
    {ExcisePur.ItemCode}<>Previous({ExcisePur.ItemCode}) And {ExcisePur.Batchnum}<>Previous({ExcisePur.Batchnum})
    But it is Calculating only the Suppressed Record But Not the Record which is to be Calculated.
    Please help me to Accomplish this.
    I am very Much blank where I am  going wrong.
    Regards,
    Gayatri Shukla

    Hi Gayatri,
    I'm not too sure why this isn't working as the logic seems correct.
    Here's another way to do this:
    1) Create another formula and place this on the Details Section:
    whileprintingrecords;
    numbervar x;
    if onfirstrecord then
    x := {Field_to_summarize}
    else if {ExcisePur.ItemCode} <> Previous({ExcisePur.ItemCode}) And {ExcisePur.Batchnum} <> Previous({ExcisePur.Batchnum}) then
    x := x + {Field_to_summarize};
    2) Create another formula and place this on the Report Footer:
    whileprintingrecords;
    numbervar x;
    -Abhilash

  • Re : How many Records that are transfer once I.P is shedule

    Hi
    Once one Info package is schedule what is the database that store how much records are transfer to data targets (Info package ,O.D.S)
    Can any one provide the information on SAP BW Database tables

    Solved

  • Print VI Documentat​ion always generates extra pages that are blank/empt​y.

    I am using the Print ->VI Documentation to generate a document that contains my block diagram.  However, I notice in the preview (and in the final printout) that there are always extra pages at the end.  My block diagram takes up about 40 to 50 pages, and there are always anywhere from 10 to 40 extra blank pages generated.
    My guess is that the blank pages are being generated because my block diagram has a width to height ratio that does not correspond to the width to height ratio of a letter sized page.  Is this the reason?  Is there any way around this other than to reorganize my block diagram to have a ratio of 8.5/11? 
    S G
    Certified LabVIEW Architect, Certified TestStand Developer, Certified Professional Instructor

    The only 3 options that I have selected are Block Diagram, Hidden Frames & Front Panel.  My block diagram uses a state machine and has about 50 different states (cases).  About half of these show up in the print.  The remaining don't show up even though the number of pages in my print preview seems to be right.
    S G
    Certified LabVIEW Architect, Certified TestStand Developer, Certified Professional Instructor

  • IR Report to update filtered records that are checked - How To

    Hi,
    (APEX 4.0 on 10g)
    Simply stated, I have a IR Report with the followng
    select
    APEX_ITEM.CHECKBOX(1,empid,DECODE(selected_flag,'Y','CHECKED','') AS SELECTED,
    ename,
    job,
    selected_flag
    FROM emp
    ORDER BY 1
    The Interactive Report returns a 1000 records and none of the rows are selected (i.e. selected_flag is not 'Y'; I filter the report for last name = 'SMITH' which returns 100 rows.
    How do I refer to those or updated the SELECTED_FLAG of the 100 rows with the last name of 'SMITH' to 'Y'?
    Thanks in advance for your response.

    Hi,
    I don't know... it might be too late... but I came across this Problem too.
    The trick is to select the the value of the primary key instead of the checkbox value...
    something like this ...
    select apex_item.checkbox(1, pn_modulid, decode
    (V_SOMEVALUE 'J', 'checked', 'unchecked')) as "V_SOMEVALUE"
    and...
    apex_item.hidden(9,pn_modulid||',1:'||nvl(V_VALUE,'N')||',.... as checks
    in the IR.
    And then in the Process one can do something like this....
    nid NUMBER;
    nanz NUMBER;
    ncount NUMBER;
    vsql VARCHAR2 (32676);
    vvar VARCHAR2 (100);
    vvarray VARCHAR2 (1000);
    TYPE reccheckboxen IS RECORD (
    n_id NUMBER,
    v_varray VARCHAR2 (1000),
    v_varrayneu VARCHAR2 (1000)
    TYPE tapcheckboxen IS TABLE OF reccheckboxen
    INDEX BY BINARY_INTEGER;
    tcheckboxen tapcheckboxen;
    begin
    --this is the value of my array from the hidden select...
    FOR ds IN 1 .. apex_application.g_f09.COUNT
    LOOP
    vvarray := apex_application.g_f09 (ds);
    nid := SUBSTR (vvarray, 1, INSTR (vvarray, ',') - 1);
    tcheckboxen (nid).n_id := nid;
    tcheckboxen (nid).v_varray :=
    SUBSTR (vvarray, INSTR (vvarray, ',') + 1);
    tcheckboxen (nid).v_varrayneu :=
    REPLACE (tcheckboxen (nid).v_varray, 'J', 'N');
    END LOOP;
    FOR c IN 1 .. 7
    LOOP
    vsql :=
    'begin :ncount := '
    || 'apex_application.g_f'
    || LPAD (c, 2, '0')
    || '.count; END;';
    EXECUTE IMMEDIATE vsql
    USING OUT ncount;
    FOR v IN 1 .. ncount
    LOOP
    vsql :=
    'begin :vvar := '
    || 'apex_application.g_f'
    || LPAD (c, 2, '0')
    || '('
    || v
    || '); END;';
    EXECUTE IMMEDIATE vsql
    USING OUT vvar;
    tcheckboxen (vvar).v_varrayneu :=
    REPLACE (tcheckboxen (vvar).v_varrayneu,
    c || ':N',
    c || ':J'
    END LOOP;
    END LOOP;
    IF tcheckboxen.COUNT > 0
    THEN
    FOR verg IN tcheckboxen.FIRST .. tcheckboxen.LAST
    LOOP
    IF tcheckboxen.EXISTS (verg)
    THEN
    IF tcheckboxen (verg).v_varray <>
    tcheckboxen (verg).v_varrayneu
    THEN
    vsql :=
    'Update Table
    set value = :01 where pn_modulid = :id';
    EXECUTE IMMEDIATE vsql
    USING vvalue, id;
    END IF;
    END IF;
    END LOOP;
    END IF;
    end;
    I had 7 Checkboxes to check in my report.
    Works fine.... ;-)

Maybe you are looking for