Split up cfquery results

Hello. I am querying my database and usually the resultset
contains about 100 records. I want to split up my results
dynamically into three columns instead of just listing them out
like I currently do. I am not sure how to do this. This is pretty
generic but is the format I'm currently using...
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<!--- Get and return related waters --->
<cfquery name="query" datasource="myds">
SELECT id FROM my_db WHERE state = '#state#'
</cfquery>
<cfoutput query="query">
#id#<br>
</cfoutput>
</td>
</tr>
</table>
I want to have it so when the result row is 40, create a new
column and display the next 40 results, and so on.
Can someone please help?
Thanks!

do something like:
<!--- Get and return related waters --->
<cfquery name="query" datasource="myds">
SELECT id FROM my_db WHERE state = '#state#'
</cfquery>
<cfset maxRow = 40> <!--- set the maximum row of
table to be displayed --->
<!--- Get the number of columns(noOfCol) to accomodate all
data --->
<cfset noOfCol = query.recordcount\maxRow>
<cfif query.recordcount Mod maxRow neq 0>
<cfset noOfCol = noOfCol + 1>
</cfif>
<table width="100%" cellpadding="0" cellspacing="0"
border="1">
<cfloop from="1" to="#maxRow#" index="nRow">
<cfset nDataRow = nRow> <!--- initialize to current
row --->
<tr>
<cfloop from="1" to="#noOfCol#" index="i">
<td><cfoutput>#query.id[nDataRow]#</cfoutput></td>
<cfset nDataRow = nDataRow + maxRow>
</cfloop>
</tr>
</cfloop>
</table>

Similar Messages

  • Can you resort a CFQUERY Result

    Is it possible to resort a CFquery result without hitting the
    DB again?
    Already the DB has about 12 million records. I am storing the
    output into a session var and passing through other pages. The
    problem is when the user wants to resort the output by price, state
    or any thing else. I am trying to find a way to resort the Query
    without hitting the DB again. Caching is out of the way

    You say you are storing the query results in a Session
    variable? Give this a try:
    <!--- convert session variable to local variable in
    <cflock> to ensure the integrity of shared data --->
    <cflock timeout="5" type="READONLY" scope="SESSION">
    <cfset Variables.QueryResults =
    Duplicate(Session.QueryResults)>
    </cflock>
    <!--- default sorting variables --->
    <cfparam name="SortColumn" default="ColumnOne">
    <cfparam name="SortOrder" default="ASC">
    <!--- validate the sort column is a column in the query
    object since users can alter it in the URL during a sort --->
    <cfif NOT
    ListFindNoCase(Variables.QueryResults.ColumnList, SortColumn)>
    <p>The column you wish to sort by:
    <cfoutput>#SortColumn#</cfoutput> is invalid in the
    query result set.</p>
    <cfabort>
    </cfif>
    <!--- validate the sort order is a valid sort type --->
    <cfif NOT ListFindNoCase("ASC,DESC", SortOrder)>
    <p>The order you wish to sort by:
    <cfoutput>#SortOrder#</cfoutput> is invalid.</p>
    <cfabort>
    </cfif>
    <!--- query of a query example (dbtype="query"), using our
    sort params --->
    <cfquery name="SortedQueryResults" dbtype="query">
    SELECT ColumnOne, ColumnTwo, ColumnThree
    FROM Variables.QueryResults
    ORDER BY #SortColumn# #SortOrder#
    </cfquery>
    <!--- form for sorting --->
    <form
    action="<cfoutput>#CGI.ScriptName#</cfoutput>"
    method="get">
    Sort by:
    <select name="SortColumn">
    <cfloop index="i"
    list="#SortedQueryResults.ColumnList#">
    <cfoutput><option value="#i#" <cfif SortColumn
    EQ
    i>selected="true"</cfif>>#i#</option></cfoutput>
    </cfloop>
    </select>
    <select name="SortOrder">
    <option value="ASC" <cfif SortOrder EQ
    "ASC">selected="true"</cfif>>ASC</option>
    <option value="DESC" <cfif SortOrder EQ
    "DESC">selected="true"</cfif>>DESC</option>
    </select>
    <input type="submit" value="Sort">
    </form>

  • Multiple clips + split + delete = wrong result

    Some time ago I encountered a rather weird problem in iMovie:
    I imported several (3 to be exact) HD clips from my camera (each about 60 minutes long) into a single iMovie project. As I wanted to discard several parts of the last clip, I split that clip into several parts and then deleted the unwanted parts. The result however was that some piece of footage of the length I was "removing" was removed somewhere else (I can't remember where exactly but can most probably reproduce it if someone needs to know) while the unwanted part was still shown on playback.
    Has anyone else experienced this problem in iMovie 6, and if so, is it solved in a later version ?

    Hi
    Only times my Mac starts to behave in an occult fashion is
    • when iMovie pref file get corrupt - trash it and eventually start a new account
    • or when free space on internal boot hard disk goes low eg under 10Gb. Then my Mac
    get's confused and does a lot of silly things.
    • Or when I try to do something even the program maker didn't think of. So easy to
    take things for granted. Then figuring out that it wasn't the way to do it.
    Else
    *Not knowing the origin to Your problem - General approach when in trouble is as follows:*
    • Free space on internal (start-up) hard disk if it is less than 10Gb should rather have 25Gb
    • Hard disk is untidy: Repair Permissions, Repair Hard disk (Apple Disc Util tool)
    • Garageband-fix. Start it and Close it. Re-try
    • Delete iMovie pref file - or rather start a new user/account - log into this and re-try
    iMovie pref file resides:
    Mac Hard Disk (start-up HD)/Users/"Your account"/Library/Preferences and is named: com.apple.iMovie.plist
    While iMovie is NOT RUNNING - move this file out to desk-top.
    Now restart iMovie.
    • Third party plug-ins that doesn't work OK (not relevant for iMovie’08)
    • Program miss-match: iMovie 5.0.2, up to Mac OS X.4.11 AND QuickTime 7.4.1 - is OK
    • Program miss-match: iMovie 6.0.3 or 6.0.4, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    • Program miss-match: iMovie’08 v. 7.0.1, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    • Screen must be set to Million-colors
    From LKN 1935: (in this case = iMovie HD (5), I tried it all, but nothing worked.
    Your answer (above) has been helpfull insofar as all the different trials led to the conclusion that
    there was something wrong with my iMovie software. I therefore threw everything away and reinstalled
    iMovie from the HD. After that the exportation of DV videos (there has not been any problem with HDV videos)
    to my Sony camcorders worked properly as it did before.

  • CFQUERY results return a null value for a varchar(MAX) field in SQL

    I'm using ColdFusion 9 and SQL Server 2008.
    One the fields in a table is defined as a varchar(MAX). Other fields in the table are ints, varchar(8000) varchar(256), etc.
    When doing a query for records in the table and displaying the results using the cfdump tag, I see values in all fields in a row EXCEPT for the data in the varchar(MAX) field. The varchar(MAX) field shows a null value.  Yet, I can verify through the SQL interface or through Microsoft Access querying the database that the varchar(MAX) fields have data.
    How can I retrieve data from this field type?
    Thanks in advance for your help.

    I'm wrong. I AM getting query results, but not what I expect. I had maxrows set as a variable in my original query, so when it returned 5 rows, the first row always showed as [empty string]. I've tried numerous queries now (where UID >100, where UID >200, where UID> 300, etc.) When I use <CFDUMP> to return the query, the first records always shows empty strings.
    Here's an example of some records retrieved from this simple query:
    <CFQUERY NAME="BuildBack" DATASOURCE="STORBASE">
    SELECT *
    FROM CallUnit
    WHERE CCU_ID>172
    </CFQUERY>
    Any ideas?
    173
    P
    tuse
    322
    340
    174
    E
    323
    340
    175
    P
    tuses.
    324
    341
    176
    E
    325
    341
    177
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupC
    326
    342
    178
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCa
    327
    343
    179
    E
    328
    344
    180
    E
    329
    345
    181
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_
    330
    346
    182
    P
    331
    347
    183
    E
    332
    348
    184
    P
    333
    349
    185
    P
    tuses.SCStat_ID)
    334
    350
    186
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Prior
    335
    352
    187
    E
    336
    353
    188
    P
    337
    354
    189
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Priorities.SCPriority_ID) LEFT JOIN SupCall_CommTypes ON SupCall_MetaData.CommunicationType = SupCall_CommTypes.SCComm_ID) INNER JOIN SupCall_CallStages ON SupCall_
    338
    355
    190
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Priorities.SCPriority_ID) LEFT JOIN SupCall_CommTypes ON SupCall_MetaData.CommunicationType = SupCall_CommTypes.SCComm_ID) INNER JOIN SupCall_CallStages ON SupCall_M
    339
    356
    191
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_
    340
    357
    192
    P
    tuses.SCStat_ID) á àh\  (9~ Hbb l_Products ON SupCall_MetaData.Product = SupCall_Products.SCPL_ID) LEFT JOIN SupCall_Priorities ON SupCall_MetaData.Priority = SupCall_Priorities.SCPriority_ID) LEFT JOIN SupCall_CommTypes ON SupCall_MetaData.CommunicationType = SupCall_CommTypes.SCComm_ID) INNER JOIN SupCall_CallSta
    341
    358
    193
    P
    tuses.SCStat_ID) á àh\

  • Using cfquery results in cfmail

    Hello
    I have implemented a blog using the blogcfm application. I
    want to mail the summary which consists of the blog topic and all
    the comments for a particular day to all the users of the blog once
    a day. I was trying somthing out using the cfquery and the cfmail
    tags but I am not able to select records just for the current day
    and mail those to the users. Can anyone suggest how do I go about
    doing that? Thanks in advance..

    Were you at least able to select records for the current
    day?

  • Splitting HL7 Lab Results (ORU) File. What Should MessageType Be?

    Hi.
    Thank you for reading this. 
    This is on BizTalk server 2010 for HL7 verson 2.3. 
    Trying to split a batch file in the Pipeline (Disassemble) . For the GetNext method.
    Can someone please tell me what should the messageType be?
    Have tried, but got suspended saying that there's no subscriber in the message box (for the message): 
      String messageType = "_http://microsoft.com/HealthCare/HL7/2X" + "#" + "ORU_R01_23_GLO_DEF";
      String messageType = "_http://microsoft.com/HealthCare/HL7/2X" + "#" + "MSH_25_GLO_DEF";            
            public IBaseMessage GetNext(IPipelineContext pContext) 
                if (myQ.Count > 0) 
    String messageType = "???"; 
                    IBaseMessage outMsg = pContext.GetMessageFactory().CreateMessage(); 
                    string systemPropertiesNamespace = @"http://schemas.microsoft.com/BizTalk/2003/system-properties";
                    for (int i = 0; i < myMsg.Context.CountProperties; i++)   
                        string Name, Namespace; 
                        object PropertyValue = myMsg.Context.ReadAt(i, out Name, out Namespace); 
                        if (myMsg.Context.IsPromoted(Name,
    Namespace)) 
                            outMsg.Context.Promote(Name, Namespace, PropertyValue); 
                    outMsg.AddPart("Body", pContext.GetMessageFactory().CreateMessagePart(),
    true); 
                    outMsg.Context.Promote("MessageType",
    systemPropertiesNamespace, messageType); 
                    string temp = myQ.Dequeue().ToString(); 
                    byte[] byteArray = Encoding.ASCII.GetBytes(temp); 
                    outMsg.BodyPart.Data = new MemoryStream(byteArray); 
                    return outMsg; 
                else 
                    return null; 
    Can you please help?? 
    Thank you so much! 
    Thanks

    Hi Daniel.
    Unfortunately, we're unable to get the HL7 Disassembler to debatch the files. Is there an expected format?
    The vendors are sending us sample files with the following repeating segments:
    MSH
    PID
    PV1
    ORC
    OBR
    OBX
    OBX
    Anyways, I looked at the messageType for the single file that worked and it's this:
    String messageType = @"_http://microsoft.com/HealthCare/HL7/2X" + "#" + "ORU_R01_23_GLO_DEF";
    The issue is that after it gets through the Receive location it gets suspended b/c there are no subscriber for the message. It turns out that during de-batching it did not promote the messageType with this line:
    outMsg.Context.Promote("MessageType",
    systemPropertiesNamespace, messageType); 
    Any idea what I'm doing wrong? 
    Thanks in advance for your help!
    Thanks

  • Cfquery results ordered by column added after query run

    I have a function that returns a recordset, adds a column
    using QueryAddColumn then loops through the recordset and reorders
    the items using QuerySetCell.
    Once the function has run, the output shows the items in
    their natural order and lists the new order as a table column.
    How would I then do the equivalent of ORDER BY myNewColumn
    since the query has already run.
    My code is attached.
    Thanks,
    Paul

    Never mind, sussed it!
    Added the following for query of query:

  • Message split via BPM Status stays TBDL

    Hi to all,
    I have a Scenario with a BPM.
    In the IntegrationProcess (IP_Split), is a mapping with message splitting.
    The result von the Mapping are serveral Proxymessages and a var count, that counts the new Messages.
    After, i have a loop over the messages an with the receiverdetermination i send the new messages to the SAP-System.
    the Scenario works fine. in SXI_MONITOR it looks great.
    There is only one Problem:
    When i go to the Integration Engine in the Message Monitoring (Runtime Workbench) there is a strange Message.
    There is a Message with SenderService and ReceiverService IP_Split. The Status is still TBDL.
    Can anybody help me?
    Thanks
    Chris

    Hi,
    Few months ago we had also problems with "locked user" in XI, in our case XIAPPLUSER was sometimes (b)locked.
    Perhaps note:
    721548 Changing the passwords of the XI 3.0 service users
    will help you.
    We removed and entered the service users again, with the password in CAPITALS and language blank.
    After that our problem was solved, I hope yours too.
    Regards
    Jack

  • Dynamic column name in cfquery

    I have a scenario in which database column names are in a
    format COLUMN1, COLUMN2, ...COLUMNn. Number of column is not known
    while coding. But usually the column names are hard code while
    accessing the cfquery result like
    cfqueryresult.COLUMN1.
    I want to get the column names from
    'cfqueryresult.ColumnList' and from that result i want to fetch the
    column values.
    Is it possible to achieve this in coldfusion?

    quote:
    Originally posted by:
    Dan Bracuk
    quote:
    Originally posted by:
    Newsgroup User
    And then start planing for the normalization of your database
    because that is a classic de-normalized pattern that just leads to
    more and more difficulties maintaining your application. Just like
    this one you have just experienced!
    That wasn't my interpretation. I have some reports where the
    contents of a select clause depend on user input. It results in a
    similar scenario to what was described in the OP.
    Or maybe the OP was trying to write generic code that could
    be applied to arbitrary tables.
    That was the situation which resulted in my question that you
    and Ian answered so helpfully: I use an Access template in which
    there are forms to facilitate entry of value lists (list-id, value,
    and label) and a metatable that describes each column of the actual
    working table , identifies any value-list that column references,
    and includes the prompt and (after processing) the HTML for that
    web page element. After I define the working table in the metatable
    I run a VB procedure that creates the working table and generates
    all the HTML in the metatable. Finally my generic ASP (and, coming
    soon, ColdFusion) references the metatable and the working table to
    generate an empty form, display a form populated from a DB row for
    editing, assign form values to a DB row, or delete a DB row. Same
    code, any table; all I have to do is define the table and the
    value-lists it needs.
    This is a wonderful tool for me in a Social Sciences
    department where the Professors are always designing surveys to
    gather data. I can deplay a web-based survey in a few hours, and,
    with your help and many hours poring over manuals, I have the first
    example working in ColdFusion. And, incidentally, the ColdFusion
    version is way tidier, more compact, and more readable than the ASP
    version.
    Dan, I'll be happy to answer other peoples' questions as soon
    as I am more confident in my knowlege of ColdFusion!
    -Richard
    Richard Hopley
    Research Associate
    Department of Social Science and Health Policy
    Wake Forest University Medical School
    Winston-Salem, NC

  • Copy Control for splitting items

    Here is my situation...  a single delivery will contain multiple truckloads.  The business process cannot avoid that, and transaction VLSP (subsequent delivery split) is not an option to avoid that.  However, we must split the Pro Forma invoices out by truckload.  At first glance, this doesn't seem difficult.  Simply use a Data Transfer Copy Control routine to put the truck's trailer number into VBRK.  That way, each item will align to the right truck, and the Pro Forma creation process will automatically split into multiple resulting billing documents.
    But what about the scenario where a single item on the delivery is shipped on multiple trucks?  Item 000010 has 25 units of Material A.  19 go on Truck 1 and 6 go on Truck 2.  How do I get Item 000010 to go onto two different Pro Formas, with 19 units on one and 6 on the other?
    My best options so far are to process VF01 multiple times, once per truck, and reduce the quantity via the data transfer routine appropriately each time (with something included to figure out which truck is being processed each time), or to do a core code modification to split the delivery item into two items in the ALIPS structure before the data transfer routine is called.
    Am I missing a cleaner wat to solve this?
    Thanks,
    Chris

    hi,
    surely new coding is required for item level Billing plan copying from order to order,
    you can copy the 402 requirement do the changes according to your requirement by the help of ABAPERS.

  • Changing the field names in a CFQUERY object

    Hello, I wonder whether you know the answer to this?
    I want to change the names of the fields in a CFQUERY result
    set after I have retrieved the results from the database (ie. I
    can't use "AS" in the original SQL statement). I can think of 2
    ways to do this - use the query-a-query (CFSQL) feature or just
    build and populate a new query object, as set out below:
    <cfquery name="CustList" datasource="name">
    SELECT CustId,CustName,CustAddress FROM Customers
    WHERE OrderStatus='P'
    </cfquery>
    OPTION#1:
    <cfqueryname="GenericList" type="query">
    SELECT CustId AS Id,CustName AS Name,CustAddress AS Address
    FROM CustList
    </cfquery>
    OPTION#2:
    <cfset GenericList = QueryNew("Id,Name,Address")>
    <cfloop query="CustList">
    <cfset unused = QueryAddRow(GenericList)>
    <cfset unused =
    QuerySetCell(GenericList,"Id",CustList.CustId)>
    <cfset unused =
    QuerySetCell(GenericList,"Name",CustList.CustName)>
    <cfset unused =
    QuerySetCell(GenericList,"Address",CustList.CustAddress)>
    </cfloop>
    Do you know which of these would be more efficient? And is
    there a better way, whereby I can maniplulate the names of the
    columns in the original query (ie. so that I can rename the
    "CustName" field to "Name" and then use "CustList.Name" directly)?
    Thanks!

    Thanks guys!
    If there is a close to zero overhead to the simple
    query-a-query then that seems like the way to go, with no need to
    look for a means of manipulating or modifying the original query.
    The reason I want to change the field names is so that the
    rest of my code can contain references to "CustList.Name" whereas
    otherwise I would have to do something like
    "Evaluate('CustList.#NameField#')" which is horribly messy. And the
    way the original query is generated means I can't use "AS" in it,
    but I still want to use the same code to work with that query
    result and other query results that share similar/related data with
    different field names.

  • The risk analysis results are different when choose report type as "summary" and "management" summary

    Hello experts,
    I found a expired user with SOD conflicts in "management summary" report format, but it doesn't exist in "Summary" report. You can find the screenshot in attached file. The user name is "YINPENG2_BK".
    What happened? The result of different report formats are from different data source?
    Sincerely yours,
    Lynn

    Hi Lynn,
    that's not an issue from the system. It's more a handling issue as the results are splitted into several result sets. In management summary view you have only one result set as it's grouped by user and risk, whereas you have more than one in summary view (as you have multple entries for each user and risk).
    Change to the second, third, etc. result set and you will see the user in the list:
    Regards,
    Alessandro

  • Select/option with cfquery - how to pass selected value to field downform

    I have a form that has a basic select/option dropdown using a cfquery result.  I would like to use the value that the user selects to pre-populate an editable 'title' field further along on the form.  For example:
    <form action="index.cfm?fuseaction=sendEmail" method="POST" name="email_approval" enctype="multipart/form-data">
    <table width="500" border="1" cellspacing="0" cellpadding="2" align="center">
    <tr>
      <td align="left">Request ID:</td>
      <td align="left" width="100"><b><cfoutput>#RequestId#</cfoutput></b></td>
      <td align="left">Application:</td>
      <td align="left" width="400"><b><cfoutput>#this_request.app_abbrev#</cfoutput></b></td>
      <td align="left">WR/RD#:</td>
      <td align="left" width="400"><b><cfoutput>#this_request.request_number#</cfoutput></b></td>
    </tr>
    <tr>
      <td align="left">Email Type:</td>
      <td align="left" colspan="2">
          <select name="approval_type" size="1" >
          <cfoutput query="approval_types">
             <option value="#approval_types.approval_descrip#" style="font-size:8pt">#approval_types.approval_descrip#</option>
           </cfoutput>
         </select>
      </td>
      <td align="left"> </td>
      <td align="left">Date Sent:</td>
      <td align="left"><b><cfoutput>#dateformat(Now(), "MM/DD/YYYY")#</cfoutput></b></td>
    </tr>
      <cfset subjectLine = "#RequestId#" & " " & "#approval_types.approval_descrip#" & " Approval Request" >
    <script  type="text/javascript" language="JavaScript">
    <cfoutput>
      var #toScript(subjectLine, "jsLine")#;
    </cfoutput>
    </script>
    <script  type="text/javascript" language="JavaScript">
    function setValue()
      document.getElementById('subject').value =jsLine;
    </script>
    <tr>
      <td align="left">Subject:</td>
      <td align="left" colspan="5">
       <b><input type="Text" name="subject"  required="Yes" size="70" maxlength="70" onClick="setValue();"></b>
    </td>
    </tr>
    When the user gets to the subject field,the onClick will pre-populate the field with the combined value using <cfset subjectLine = "#RequestId#" & " " & "#approval_types.approval_descrip#" & " Approval Request" >.  regardless of what is selected, it uses the first item in the query list because that is what is rendered when the form is loaded (got that).  I figure that I need a javascript onChange event for the select statement for the dropdown, but can't figure out how to pass this javascript variable back to the CF form.  Any ideas, or am I stuck?
    Thanks in advance for your thoughts!

    You will need to do it with JS as the values you want to access are not set until the form is submitted. This should give you what you want.
    It uses a hidden form field to hold the requestID, that is then accessed with JS. (I am assuming this value is available when the page loads)
    <form action="index.cfm?fuseaction=sendEmail" method="POST" name="email_approval" enctype="multipart/form-data">
    <input type="hidden" name="requestID" id="reqID" value="1234" />
    <table width="500" border="1" cellspacing="0" cellpadding="2" align="center">
    <tr>
      <td align="left">Email Type:</td>
      <td align="left" colspan="2">
          <select name="approval_type" id="approval_type" size="1" >
             <option value="test" style="font-size:8pt">test</option>
         </select>
      </td>
      <td align="left"> </td>
      <td align="left">Date Sent:</td>
      <td align="left"><b><cfoutput>#dateformat(Now(), "MM/DD/YYYY")#</cfoutput></b></td>
    </tr>
    <script  type="text/javascript" language="JavaScript">
    function setValue(){
        var e = document.getElementById("approval_type");
        var approval_type_value = e.options[e.selectedIndex].value;
        var subjectLine = document.getElementById('reqID').value + ' ' + approval_type_value + ' Approval Request';
        document.getElementById("subject").value = subjectLine;
        alert(subjectLine); 
    </script> 
    <tr>
      <td align="left">Subject:</td>
      <td align="left" colspan="5">
       <b><input type="Text" name="subject"  required="Yes" size="70" maxlength="70" onClick="setValue();"></b>
    </td>
    </tr>

  • Splitting a string when an integer is reached

    Hi,
    I'm trying to figure out how, if possible, to split a string when an integer comes in the strong. What I'm doing is reading from a web page and the output is "1930Stella" as an example. What I want to do is insert those into a table, so it's like this:
    String     |     Integer
    Stella           1930I'm not sure how I can go about doing this, please help!

    YoungWinston wrote:
    aeternaly wrote:
    I'm trying to figure out how, if possible, to split a string when an integer comes in the strong. What I'm doing is reading from a web page and the output is "1930Stella" as an example.Another wrinkle for you. Could it ever be "-1930Stella"?
    WinstonNo, it can't ever be anything other than "1930Stella" or "Stella1930", but it will always be integerString in the format that I'm reading from the site.
    almightywiz wrote:
    Just a thought...
    Why not make this function return something like this:
    >
    "1930Stella" -> parseString -> "1930|Stella"
    >
    You're obviously halfway there, but right now if you want to get both the number and the string out of the input, you have to loop over the input twice. Why not just loop over the input once, insert a delimiter between your 'fields', and call split on the resulting string later? Then again, you know the overall requirements for the issue at hand.
    Also, is the input string always a number followed by characters (i.e. 1930Stella), or can it be something ridiculous like "1234abc56d7e8"? I only ask because right now your method only handles the first case nicely, on the assumption that your result will always be "number followed by characters".As I said above, the method works for what I need (only integerString/stringInteger format). I was looking at the delimiter idea but couldn't quite fully understand it. I'll give it another go, though!

  • How to split this string(char1)char2(char3)char4 into (char1)char2 , .. etc

    how to split this string (char1)char2(char3)char4 into (char1)char2 , (char3)char4?
    String[] result = "(char1)char2(char3)char4".split("\\(");I want :
    result[0] = "(char1)char2" and
    result[0] = "(char3)char4"
    acutally char1,char2,char3, char4 ... is in the form of the below.
    (any charactors except round brace)any charactors except round brace(any charactors except round brace)any charactors except round brace
    I prefer String.split and Pattern.compile().split.
    Edited by: iamjhkang on Feb 5, 2009 3:37 PM
    Edited by: iamjhkang on Feb 5, 2009 3:41 PM

    iamjhkang wrote:
    especially on
    ?= and ?<
    Thanks.The following:
    (?=...)   // positive look ahead
    (?!...)   // negative look ahead
    (?<=...)  // positive look behind
    (?<!...)  // negative look behindare all "look-arounds". See: [http://www.regular-expressions.info/lookaround.html]

Maybe you are looking for

  • "Performance" problems with the File adapter on Plain J2SE Adapter Engine

    Hi, At the moment I'm on a customer side to solve some XI issues for a few days. One of the issues is the performance of the Plain J2SE Adapter Engine, using the file adapter to transfer XML messages(already XI message format) from the legacy system

  • SAP Report for Cash payment more than Rs 20000/ within a year

    Hi Friends, Is there any report which will help me to find out the cash payments more than INR 20,000 during the year? If not then please provide the logic to develop this report Thanks & Regards, Nainesh Moderator: Please, avoid asking basic questio

  • Need SRM BW Vendor Evaluation Report Names with format

    It would be really appreciable if someone can share the SRM BW Vendor Evaluation Report Names along with the format. Cheers, Sheetika

  • Can't access fonts in when composing a new email

    When I start a new message in mail, if I want to change the font I can't access the font tool either by selecting the font button in the outgoing message tool bar or by the drop down format menu ( or by "command T"). I can, however, go into preferenc

  • Com.sap.tc.webdynpro.services jar file

    Hi, I need to use the class IWDClientUser, but I don't have the jar file that includes it within my IDE. Does anyone know where I can download it from? Sorry found it in com.sap.tc.webdynpro.runtime_2.0.0 Thanks Edited by: Phillip Smith on Oct 27, 20