Looping through a list to create a url string

Hi all

This should be easy for someone with a little experience, but for some reason I have problems with it.  I need to create a url string based on the results of the query.  The results of the query are essentially:

agenda Prix
125542.00
238853.50
125545.00
885442.47

I need to create a url like www.something.com/index.cfm string? item1 = 122554 & item1price = 2 & item2 = 23885 & item2price = 3.50 etc etc (I'm actually trying to create the channel and then add it to a url.)  The index must be included also, like item1, item2 but there will be a different result for each order number if that makes sense - this person bought 4 items but someone else could buy 2).

Can someone give me a good way to do this?  I tried to loop through the query sort, but it does not work for me.  I also tried making a list but no dice.  It seems that it should be so simple.

Thank you

Red

It seems that you overwrite rather than allow adding to your string variable.

Take one resembles the quick example below.  Note that I have not tested this code.

http://www.example.com/page.cfm? » >

Tags: ColdFusion

Similar Questions

  • Loop through the list in flex 4 conclusion d buttons

    Anyone know how to completely recursively loops through the list in flex 4 by pulling the bodies of buttons.  This way I can apply my effects for buttons on the screen at the same time?

    You just create a subclass of button that has the desired effect and use it throughout your application.

    Gordon Smith

    Adobe Flex SDK team

  • loop through the list in flex 4

    I want to loop through the list and apply the following code to each button, the checkbox and the descent down in my application

    mouseOver = "animateHover ('theComponentID').

    How is that possible?

    Hello

    This should do what you want, you must add the eventlistener now your animated can be run from the th event handler.

    protected function button1_clickHandler(event:MouseEvent):void

    {

    for (var i: Number = 0; i<>

    {

    var obj:Object = this.getElementAt (i);

    If (flash.utils.getQualifiedClassName (obj) is 'spark.components::Button')

    {

    (obj as Button) .addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    }

    If (flash.utils.getQualifiedClassName (obj) is 'spark.components::CheckBox')

    {

    (obj as CheckBox) .addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);

    }

    }

    }

    private void onMouseOver(event:MouseEvent):void

    {

    animateHover (event.currentTarget);

    }

  • Looping through a list...

    Hi all

    In ColdFusion, we have what we call 'a loop on a list '. We do this by using the following syntax:

    < CFLOOP INDEX = 'index_name' = 'list_items"DELIMITERS LIST ="item_delimiter">
    < / CFLOOP >

    MS SQL Server, basically in SQL, do we have something like that? I used the WHILE loop, for example,

    While (SELECT somethingFROM Table) = 'something'
    BEGIN
    -Do something here
    END

    The question is: in SQL, how can browse through us a list of values, like for example '12, 35, 47, 102, 55, 87', and for each value in a loop, I want to do something?

    I thank very you much in advance!



    OK, see the attachment.

    Race listing 2 times to install two UDF.

    Then, you can use a query like listing 1.

  • Loop through the list, search for text

    If I'm a loop in a list and try to find the text that I am looking to make a selection, how could it achieve that?

    < cfif = text "TheTextI'mLookingFor > < / cfif >?"

    you would use the function find of FindNoCase.

    http://help.Adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7E 7c.html

  • How to make a loop through a list to get all the SelectedItems?

    Here is my code, but the loop is to return all items (items selected and deselected no)

    lstMarks in my ListBox.
    var markslist:String;

    for (var i: int = 0; i < marks.length; i ++) {}
    markslist = & markslist = ', ' + lstMarks.selectedItem.mymarks;
    Text1. Text = markslist;
    }

    If anyone can help. I need to get only the selecteditems in the comma delimited by the string.

    THX

    The forum feeds Media table unless you put spaces around them. Try:
    marksList is marksList + selectedMarks [i] .mymarks;.

    Tracy

  • database loops through query?

    access to a field in a table inidcates that rows in 2 related tables and it must be in a query.

    all the 3 tables share a field: pgID. It is the primary key of the first table and a field in the other 2.

    the first query finds the lines linked by a variable: pgfeat

    < cfquery name = "gtpgsfeat" datasource = "mydb" >
    SELECT pgID
    Pages
    WHERE pgfeat = 1
    < / cfquery >

    I then loop through the query to create a list of all the rows that are returned by the query

    < cfoutput >
    < cfloop query = "gtpgsfeat" >
    < ISDefined ('catz') cfif >
    < cfset catz = "#catz #, #gtpgsfeat.pgID # ' >
    < cfelse >
    < cfset catz = ' #gtpgsfeat.pgID # ' >
    < / cfif >
    < / cfloop >
    < / cfoutput >

    I then apply to a query to the linked tables

    < cfquery name = "gtpgsfeat1" datasource = "mydb" dbtype = "ODBC" >
    SELECT pages.*, pg_cont.*, pg_text.*
    PAGES, pg_cont, pg_text
    WHERE (pages.pgID IN (#catz #)) AND (pg_cont.pgID (#catz #)) AND (pg_text.pgID (#catz #));
    < / cfquery >

    the problem. the second query loops itself - times the recordcount of first request - and I get the same time data the recordcount of the first query.

    with a recordcount of 3 for the first query, I get a recordcout of 27 (3 X 3 X 3) for the second query...

    example:

    Abe

    Cathy

    John

    Abe

    Cathy

    John

    Abe

    Cathy

    John

    ? what I'm missing here

    TNX in advance

    Ranger says:

    ? what I'm missing here

    A basic understanding of programming to relational database better than I can tell from your post.  I heard good things about the "Teach yourself SQL in 10 minutes" book by Ben Forta and "Database Design for mere mortals" by Michael Hernandez.  They show you basic JOIN syntax as in this example where you combine all the tables in one record without multiplying all the lines as the code you attempts where made.

    
         SELECT
              pages.*,
              pg_cont.*,
              pg_text.*
         FROM
              pages INNER JOIN
              pg_cont ON (pages.pgID = pg_contID) INNER JOIN
              pg_text ON (pages.pgID = pg_test.pgID)
         WHERE
              pgfeat = 1
    
    

    P.S. using the * shortcut in your clause SELECT can cause hard to debug problems if your database table designs are never changed.

  • creating a procedure loops through a table to see if the item exists

    I have the following table_one created

    TYPE_ID descriptiom used_value
    CBX 0 Red
    Boo Green 5
    AAA yellow 0

    Okay, I don't know how possible it is but I'm doing the following

    procedure recent_change (type_required in varchar2, varchar2, value_required in description varchar2) IS

    type_required varchar2 (30);
    Description varchar2 (30);
    value_requiredid: = to_number (value_required);

    slider c3 is
    Select used_value from table_one
    When type_id = type_required;

    Begin
    Open c3;
    extract the c3 in value_requiredid;
    Close c3

    If
    <... .This is where I'm stuck >
    < however, what I'm trying to do is loops through all the rows of the table to check if the description passed as parameter exist in the table (table_one) and if so, I should be able to do the following command below

    Update table_one
    Set used_value = value_requiredid
    When type_id = type_required;

    ElseIf <... . If there is no such thing as the description passed as a generally >
    can do

    insert into table_one (type_required, description, value_requiredid) values;

    commit;

    End recent_change;

    I'm still a beginner so I need a little help. Thank you.

    I still don't know if it's possible in sql or not.

    Sure. You just need to change the MERGER a little so that it matches on type_id AND description. However, you can only change the used_value now. It is not valid to change the columns that you are matching.

    SQL> select * from table_one;
    
    TYPE_ID    DESCRIPTIO           USED_VALUE
    ---------- ---------- --------------------
    cbx        red                           0
    boo        green                         5
    boo        red                           0
    boo        yellow                        0
    cbx        green                         3
    cbx        yellow                        0
    aaa        yellow                        0
    
    SQL> create or replace
      2  procedure recent_change (p_type_id     in varchar2
      3                          ,p_description in varchar2
      4                          ,p_used_value  in number) IS
      5  begin
      6
      7     merge into table_one t
      8     using (select p_type_id      type_id
      9                  ,p_description  description
     10                  ,p_used_value   used_value
     11            from   dual
     12           ) p
     13     on    (t.type_id     = p.type_id
     14            and t.description = p.description)
     15     when  matched then update set
     16              used_value = p.used_value
     17     when  not matched then insert
     18             (type_id, description, used_value)
     19             values
     20             (p.type_id, p.description, p.used_value);
     21  end;
     22  /
    
    Procedure created.
    
    SQL> exec recent_change('boo','red',1);
    
    PL/SQL procedure successfully completed.
    
    SQL> exec recent_change('cxx','green',6);
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from table_one;
    
    TYPE_ID    DESCRIPTIO           USED_VALUE
    ---------- ---------- --------------------
    cbx        red                           0
    boo        green                         5
    boo        red                           1
    boo        yellow                        0
    cbx        green                         3
    cbx        yellow                        0
    aaa        yellow                        0
    cxx        green                         6
    
  • To loop through the structure of table - using xpath

    Hello

    My logic to BPEL process is as follows:
    a. extract the data in the variable - receiveMessageInputVariable
    The variable 'receiveMessageInputVariable' has in turn of the data in the table structure. (a set of elements)
    b. to transform the data to the target structure
    c. call the target of the link partner to store data in variable 'ServiceInputVariable '.
    The variable "ServiceInputVariable" structure is similar to "receiveMessageInputVariable".

    In the BPEL process "in the process of" level - I have catch-all exception handler - which must send the list of "elements" that failed in a BPEL proceeding.

    i. If my body of the email has the following code as below:
    < % bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER') % >

    It recovers only the first record in the table item_number structure successfully. But don't get the other records in the table.

    II. Similarly, I want to print all the elements (such as received) to be available in the body of the email in the following model:

    < % ' Save a "% >
    < % bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[1]/ITEM_NUMBER') % >
    < % ' < br / > "% >".
    < % 'Save two -' % >
    < % bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[2]/ITEM_NUMBER') % >
    ....
    ..
    < % "Nth record" - % >
    < % bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[N]/ITEM_NUMBER') % >

    Please suggest a syntax suitable in my body of the email - which can loop through all the itemline_item table and print all item_numbers.
    (pseudocode below)

    because me in 1... ORA: countNodes (bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER'))
    loop
    < % ' article number-"% > < % bpws:getVariableData('i') % >".
    < % APO: getVariableData ('receiveMessageInputVariable', 'XXINV_ITEM_PAY_ROW_TYPE','/ ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')% >)
    end loop;


    Thank you
    Shakur

    Hi Shema

    Try the following approach. It can work for you

    1. create an XSD for HTML content








    2. create a XSL, can be that you must do manually, as JDev will not support transformations to HTML. This XSL will map your input XML to HTML file.
    3. create a variable in BPEL type in the XSD above
    4. use assign activity to assign the XSL transformation to the variable set to step #3


    5 copy the variable in the variable of email body



    Query = "" / EmailPayload/ns8: Content / ns8:ContentBody "/ >"

    Basically, the approach described above converts your entry to a value of string whose content is a complete HTML, and you'll use only one value to be assigned to the body of the email.

    Note: Please change the names of Variable/XPATH Expressions / / the name element from the XSL names etc. According to your BPEL file

    Hope this helps you

    Concerning
    LOC.

  • Error in the loop on the list

    Looping on a series of lists created from form fields generates an error in one of the fields on the form was left blank. The form is a list of the dates of the event start and end times. An event can have a number of times.

    When the end time is uncertain, we leave the field blank. However, this therefore reduces the list created from #form.endtime # for lists do not match and there is an error message:

    "Invalid list index 2.
    In the function ListGetAt (list, index [, delimiters]), the index value, 2, is not valid as the first argument (this list has 1 elements). Valid indexes are in the range 1 through the number of elements in the list. »

    How do you get around this problem? TX.

    yoman,

    No need for separate forms. Use a meter to number each group of domain names



    Then loop through the fields in form on your action page




    ... other fields


    UPDATE EventDates
    EventDate SET = "#EventDate #",...

    WHERE EventDateID = #EventDateID #.

    You must validate the values or use cfqueryparam

  • How can I get a list of all links/URLS used in all emails Eloqua?

    I try to have a report, list, or the export of all links/URLS never used in e-mail Eloqua (about 250) assets. Is there a quicker, more precise and perhaps automated to do this other than to pick up manually?

    Basically the desired result is a list of all links/URLS used in an Excel worksheet, additional information is a plus.

    If there are ways through the API, it is also welcomed.

    The Web site is subject to a few changes and we would like to keep all links living in them the remapping to the end server.

    Hi all

    First two ideas come to mind:

    1. go to Insight and run the Email clicks link ventilation report to see the links and clicks used in various emails. This will allow you to search for links to the last 730 days. However, note that if you have an abundance of links, the report may timeout. This is why the guests page, you may need to search specifically for a range of dates (month or two at a time) until you have all the expected results.

    2. using other APIs. The live docs for Rest API include the ability to search hyperlinks in emails. For instructions to access the direct documentation, see the Oracle Support Document 2078514.1 (how access rest and bulk API Live Docs) to: https://support.oracle.com/epmos/faces/DocumentDisplay?id=2078514.1. Once inside the live docs do the following:

    • Click on liabilities
    • Click/assets/hyperlinks
    • Expand the Hypertext GET/assets/links
    • Entry 'Complete' in depth to make sure that you check out the URL for each hyperlink

    Let me know if it helps!

    Best regards

    Matt Goodman

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • Looping through the operator stored in the table

    I have a table test

    oprtrop_val
    > =.100
    =50
    < =.10
    <5

    create table test (oprtr varchar2 (5), op_val number);

    Insert test values (' > =', 100);

    Insert into test values ('=', 50);

    insert into test values ("< =', 10");

    Insert test values (' < ', 5);

    I tried to loop through all the conditions of this table, this table is configurable, and there are cases where the new terms will be added and the old conditions can be modified or deleted,

    I wanted to do something like that, is there a way to do it or I have to write manually if condition to test all these cases by taking all the considerartion operator.

    Val: = 500;

    I'm in (select * from test)

    loop

    If val i.oprtr i.op_val then

    dbms_output.put_line ('True Condition is' |: o PRTR);

    end if;

    end loop;

    Please help me if there is a way to do it.

    Hello raj4tech

    Here's an example how you can solve this problem:

    DECLARE

    Val the NUMBER: = 500;

    v_statement VARCHAR2 (500);

    v_result VARCHAR2 (10);

    BEGIN

    FOR I IN (SELECT oprtr, op_val

    OF THE TEST

    )

    LOOP

    BEGIN

    v_statement: = 'SELECT BOX WHEN "| To_char (Val). ' ' || i.oprtr | ' ' || To_char (i.op_val) | "THEN" TRUE"OTHER"FALSE"END AS A RESULT OF THE DOUBLE."

    V_statement EXECUTE IMMEDIATE

    IN v_result;

    DBMS_OUTPUT. PUT_LINE (' "' |") To_char (Val). ' ' || i.oprtr | ' ' || To_char (i.op_val) | ""--> Result: ' | v_result);

    END;

    END LOOP;

    END;

    /

    "500 > = 100 '--> result: TRUE

    '500 = 50'--> result: FALSE

    ' 500 <= 10" ="" --="">result: FALSE ".

    ' 500 < 5"   ="" --=""> result: FALSE ".

    I hope it helps.

    Best regards, David

  • ÖAF - loop through a vo and get values of attribute associated with line

    HI people,

    I need code of the OPS to loop through a VO and retrieve the values of attribute associated with each line.

    I use following code in AM after - vo.invokeMethod ("initQuery", params, classes) - line.

    for (loop = 0 int; loop < vo.getRowCount (); loop ++) {}

    Line resultRow = vo.getCurrentRow ();

    If (resultRow! = null)

    System.out.println ("" + (String) resultRow.GetAttribute ("PARTYID"));

    }

    -resultRow - is done with the null value.

    Please share the code to achieve this.

    Thank you

    NGO

    You must call vo.next () to move to the next row, but this isn't a good method.

    You can browse the lines of the vo in two aspects.

    First one uses an iterator that is more reliable because it does not change the current line. You must create the java vo RowImpl file to do this.

    int fetchRowCount = vo.getFetchRowCount();
    voRowImpl row = null;
    if (fetchRowCount  > 0) {
        RowSetIterator iter = vo.createRowSetIterator("Iter");
            iter.setRangeStart(0);
            iter.setRangeSize(fetchBidderRowCount);
            for (int i = 0; i < fetchBidderRowCount; i++) {
                row = voRowImpl iter.getRowAtRangeIndex(i);
                 //use RowImpl getters
                 Number personId = row.getPersonId();
        }
        iter.closeRowSetIterator();
    }
    

    Second, one is your method proper form:

    for (Row row = rowsVo.first(); row != null; row = rowsVo.next()) {
         Number personId = (Number)row.getAttribute("PersonId");
    }
    

    Kind regards

    Anil.

  • Work Dbma_scheduler execution of procedure which loops through all the customer drawings in the rear rollers database transaction in case of exception

    Hello

    Need your contributions on the approach to implement a work using dbms_scheduler.

    We have about 2000 drawings. Each schema has a package with 2 procedures.

    The requirement is to create a single job in SYS that loop over each schema and run the procedures specific to a time (once a day) and send a notification by e-mail on success or failure.

    Working script:

    BEGIN

    dbms_scheduler.create_job (job_name = > 'LOAD_EACH_SCHEMA_AUDIT_DATA',)

    job_type = > 'PLSQL_BLOCK ',.

    job_action = > ' BEGIN sys.p_loadaudit;

    END;',

    start_date = > systimestamp,

    repeat_interval = > ' FREQ = MINUTELY; RANGE = 1',

    number_of_arguments = > 0,

    enabled = > true,

    Comments = > "Use repeat interval is every five minutes");

    END;

    /

    Note: to test the end I put him repeat interval to carefully.

    Use of procedure must be running:

    Procedure sys.p_loadaudit:

    CREATE OR REPLACE

    PROCEDURE p_loadaudit

    AS

    v_count NUMBER: = 0;

    lv_error_message VARCHAR2 (4000);

    vstmt VARCHAR2 (4000);

    BEGIN

    I'm IN

    (SELECT username FROM dba_users WHERE username LIKE '% ABCFIRM')

    )

    LOOP

    vstmt: = "begin" | i.UserName | '. pkg_audit_info.p_load_coa; end;';

    EXECUTE immediate vstmt;

    vstmt: = "begin" | i.UserName | '. pkg_audit_info.p_load_am; end;';

    EXECUTE immediate vstmt;

    END LOOP;

    EXCEPTION

    WHILE OTHERS THEN

    lv_error_message: = ' error in procedure p_loadaudit: ' | SQLCODE. "- ERROR -" | SUBSTR)

    SQLERRM, 1, 300). '*' || dbms_utility.format_error_backtrace;

    raise_application_error(-20002,lv_error_message);

    END p_loadaudit;

    /

    Example of a scheme: SCHEMA_01

    create or replace

    PACKAGE pkg_audit_info

    AS

    CursorType type

    IS

    REF

    CURSOR;

    PROCEDURE p_load_COA;

    PROCEDURE p_load_AM;

    END pkg_audit_info;

    /

    create or replace

    Pkg_audit_info body PACKAGE

    AS

    PROCEDURE p_load_COA

    AS

    BEGIN

    INSERT INTO TABLE1();

    EXCEPTION

    WHILE OTHERS THEN

    lv_error_message: = ' error in procedure pkg_audit_info.p_load_COA: ' | SQLCODE

    || "- ERROR -" | SUBSTR (SQLERRM, 1, 300). '*' || dbms_utility.format_error_backtrace;

    RAISE_application_error(-20002,lv_error_message);

    END p_load_COA;

    PROCEDURE p_load_AM

    AS

    BEGIN

    INSERT INTO TABLE2();

    EXCEPTION

    WHILE OTHERS THEN

    lv_error_message: = ' error in procedure pkg_audit_info.p_load_AM: ' | SQLCODE.

    "- ERROR -" | SUBSTR (SQLERRM, 1, 300). '*' || dbms_utility.format_error_backtrace;

    RAISE_application_error(-20002,lv_error_message);

    END p_load_AM;

    END pkg_audit_info;

    /

    Table1 and table1 exist in schema_01.

    All 2000 patterns have same package.procedures.

    For security reasons, I removed the actual code.

    I was able to complete the task successfully. However, when a scheme procedure (SCHEMA_01.pkg_audit_info.p_load_COA) throws an exception, the job fails, and any transaction is rolled back.

    Is it possible to loop through each schema and run the corresponding procedures. Even if the exception occurs, it must restore only for this scheme and continue other patterns in the loop?

    Please let me know if there is a better way to do this. Is the way I'm handling exceptions in the work or the correct procedure?

    Thank you

    Hello

    RAISE_APPLICATION_ERROR will cause the program to exit to the appellant, even if you put it inside a block in the loop, so the statement RAISE or RAISE_APPLICATION_ERROR must be placed in your procedures 'pkg_audit_info.p_load_AM' and 'pkg_audit_info.p_load_coa '. In this way, you can use a block inside the loop and the error in the log.

    I'm IN

    (SELECT username FROM dba_users WHERE username LIKE '% ABCFIRM')

    )

    LOOP

    BEGIN

    vstmt: = "begin" | i.UserName | '. pkg_audit_info.p_load_coa; end;';

    EXECUTE immediate vstmt;

    vstmt: = "begin" | i.UserName | '. pkg_audit_info.p_load_am; end;';

    EXECUTE immediate vstmt;

    EXCEPTION

    WHILE OTHERS THEN

    --> Set the error in a table of otherwise custom event log you won't know what happened for this scheme: don't forget the user name

    END;

    END LOOP;

Maybe you are looking for