Dynamic record group not working when apostrophes are used

Hi Everyone,
I have developed a Form for the most part everything is working as expected. However, there is a search functionality that is giving me problems. The issue is that when the user enters search criteria for last_name that has an apostrophe (O'brian) the search lov doesn't get populated because the dynamic record group is not getting created when the string has an apostrophe (ie O'brian). I have a dynamic record group that takes the user's search criteria and populates an LOV on the screen with the records that matched their criteria.
Here is the code that is behind my search button where the dynamic RG gets created. It works fine for all searches that don't contain an apostrophe. Btw, the Oracle Forms version is 10g.
DECLARE
p_where_debtor varchar2(2000);
p_where_liab varchar2(2000);
rg_id RecordGroup;
v_query varchar2(2000) := null;
rg_name varchar2(2000):= 'RG_LIAB_LST';
errcode NUMBER;
BEGIN
IF :SEARCH.cd_nb is null and
:SEARCH.cd_seq is null and
:SEARCH.f_name is null and
:SEARCH.l_name is null and
:SEARCH.mi_name is null
then
display_message ('Search criteria must be entered');
raise form_trigger_failure;
END IF;
v_query := 'SELECT last_name, first_name, middle_name, c_no, c_seq
FROM TABLE_VW2 WHERE 1=1';
/*Search criteria entered by user*/
IF :SEARCH.l_name_srch IS NOT NULL THEN
v_query := v_query||' AND UPPER(last_name) LIKE '''||UPPER(:SEARCH.l_name)||'%''';
END IF;
IF :SEARCH.f_name_srch IS NOT NULL THEN
v_query := v_query||' AND UPPER(first_name) LIKE '''||UPPER(:SEARCH.f_name)||'%''';
END IF;
IF :SEARCH.mi_srch IS NOT NULL THEN
v_query := v_query||' AND UPPER(middle_name) LIKE '''||UPPER(:SEARCH.mi_name)||'%''';
END IF;
IF :SEARCH.cdcs_nbr_srch IS NOT NULL THEN
v_query := v_query||' AND UPPER(c_no) LIKE '''||UPPER(:SEARCH.cd_nb)||'%''';
END IF;
IF :SEARCH.cdcs_seq_srch IS NOT NULL THEN
v_query := v_query||' AND UPPER(c_seq) LIKE '''||UPPER(:SEARCH.cd_seq)||'%''';
END IF;
/*Make sure record group doesn't exisit*/
rg_id := Find_Group(rg_name);
/*If it doesn't exist then create record group*/
IF id_null(rg_id) THEN
rg_id:= create_group_from_query(rg_name,v_query);
END IF;
IF NOT id_null (rg_id) THEN
delete_group (rg_id);
rg_id:= create_group_from_query(rg_name, v_query);
END IF;
errcode := Populate_Group(rg_id);
Any help would be greatly appreciated.
Thanks,
Adrian

For every item where an apostroph can occur, do a
REPLACE(:BLOCK.ITEM, '''', '''''');

Similar Messages

  • Why Dynamic Parameter is not working, when i create report using stored procedure ?

    Post Author: Shashi Kant
    CA Forum: General
    Hi all
    Why Dynamic Parameter is not working, when i create report XI using stored procedure ?
    Only i shaw those parameters which i used in my stored procedure, the parameter which i create dynamic using stored procedure
    is not shown to me when i referesh the report for viewing the results.
    I have used the same procedure which i mention below but can not seen the last screen which is shown in this .
    ============================================================================================
    1. Select View > Field Explorer2. Right-click on Parameter Fields and select New from the right-click menu.3. Enter u201CCustomer Nameu201D as the name for your parameter4. Under u201CList of Valuesu201D select u201CDynamicu201D5. Under the Value column, click where is says u201Cclick here to add itemu201D and select Customer Name from the drop-down list. The dialog shown now look like the one shown below in Figure 1. Click OK to return to your report design.
    Dynamic Parameter Setup6. Next, select Report > Select Expert, select the Customer Name field and click OK.7. Using the drop-down list beside select u201CIs Equal Tou201D and using the drop-down list, select your parameter field (it should be the first field). 8. Click OK to return to your report design and see the parameter dialog.The parameter dialog will appear and show you a dynamic list of values that is updated each time your run your report. It couldnu2019t be easier! In our next tutorial, we will be looking at how to use this feature to create cascading parameter fields, where the values are filtered by the preceding selection.
    Dynamic Parameters in Action
    My question is that whether dynamic parameter is working with storedprocedure or not.
    When i added one table and try to fetch records using dyanmic prameters. after that i am not be able to find the dynamic parameter option when i referesh my report.
    One more thing when i try the static parameter for my report, the option i see when i referesh the screen.
    Please reply soon , it's urgent
    Regards
    shashi kant

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Form in Dynamic page not working when checkbox is used.

    I have created a form using dynamic page. The form most have display fields and a checkbox field. When I check a box, it assigns 'Y' value and when unclick, it assign 'N' to the database field.
    When I submit the form, the procedure which is supposed to save the form data never gets executed. Well, at least it says, page not found HTTP 404 error.
    Interestingly if I make this field a text box and manually enter 'Y' or 'N', and then submit the form, the procedure is executed. Data gets saved.
    Is the checkbox not supposed to be used for a database field because checkbox value can be assigned only using javascript and the procedure never get that value ?
    Can you please tell me how to use a checkbox for a database field using dynamic page ?
    thanks,
    Mainak

    Sharmila,
    When I said, the form does not get submitted, I meant that the procedure does not work. The form gets submitted but the procedure does not work. It gives HTTP 404 error. That is what perplexes me. I am unable to understand why the procedure does not work when I click a checkbox.
    May be you can make this work. I am hopeless about this.
    Here is the code for the procedure sumbit_form:
    NOTE: I ADDED TWO FIELDS CALLED PROMOT VARCHAR2(1), PROMOTID NUMBER(4) TO THE EMP TABLE AND CREATED A NEW TABLE CALLED PROMOTEMP. THIS IS A TEST CASE.
    create or replace procedure sumbit_form
    (p_empno IN portal30.wwv_utl_api_types.vc_arr, p_promot IN portal30.wwv_utl_api_types.vc_arr, p_action IN VARCHAR2)
    is
    begin
    if p_action = 'save' then
    for i in 1..p_empno.count LOOP
    update scott.promotemp
    set promot = p_promot(i)
    where empno = p_empno(i);
    END LOOP;
    end if;
    commit;
    htp.p('<b>Saved Successfully</b>');
    htp.p('<table border=1 bordercolor="red">');
    for c1 in (select * from promotemp where promot='Y')
    LOOP
    htp.p('<tr><td>');
    htp.p(c1.ename);
    htp.p('</td><td>');
    htp.p(c1.job);
    htp.p('</td><td>');
    htp.p(c1.mgr);
    htp.p('</td><td>');
    htp.p(c1.sal);
    htp.p('</td><td>');
    htp.p(c1.deptno);
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    EXCEPTION
    when others then
    raise;
    end;
    Here is the code for the dynamic page.
    <HTML>
    <HEAD>
    <TITLE>Promot Emp</TITLE>
    <script language="JavaScript1.1">
    function include(form) {
    var thisform = form;
    for (var i=0; i<thisform.length; i++) {
         if (thisform.elements.type == 'checkbox') {
              if (thisform.elements[i].checked) {
                   thisform.elements[i].value = 'Y'; }
              else { thisform.elements[i].value = 'N'; }
    form.submit();
    function show(form) {
    var thisform = form;
    for (var i=0; i<thisform.length; i++) {
         if (thisform.elements[i].type == 'checkbox') {
              if (thisform.elements[i].value = 'Y') {
                   thisform.elements[i].checked = true; }
              else { thisform.elements[i].checked = false; }
    </script>
    </HEAD>
    <BODY>
    <FORM action="scott.sumbit_form" method="post">
    <table border=1 bordercolor="red">
    <tr>
    <td> </td>
    <td>Name</td>
    <td>Job</td>
    <td>Manager</td>
    <td>Hire Date</td>
    <td>Commission</td>
    <td>Department#</td>
    <td>Include</td>
    </tr>
    <ORACLE>declare
    i number;
    begin
    i := 0;
    for c1 in (select * from scott.promotemp where promotid = :promotid)
    loop
    htp.p('<tr><td>');
    htp.p('<input type="hidden" name="p_empno" value='||c1.empno||'>');
    htp.p('</td><td>');
    htp.p(c1.ename);
    htp.p('</td><td>');
    htp.p(c1.job);
    htp.p('</td><td>');
    htp.p(c1.mgr);
    htp.p('</td><td>');
    htp.p(c1.hiredate);
    htp.p('</td><td>');
    htp.p(c1.comm);
    htp.p('</td><td>');
    htp.p(c1.deptno);
    htp.p('</td><td>');
    if (c1.promot = 'Y') then
    htp.p('<SELECT NAME="p_promot" SIZE="1">
    <OPTION SELECTED VALUE="'||c1.promot||'">Yes
    <OPTION VALUE="N">No
    </SELECT>');
    else
    htp.p('<SELECT NAME="p_promot" SIZE="1">
    <OPTION SELECTED VALUE="'||c1.promot||'">No
    <OPTION VALUE="Y">Yes
    </SELECT>');
    end if;
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    htp.p('<input type="submit" value="save" name="p_action">');
    end;
    </ORACLE>
    </form>
    </BODY>
    </HTML>
    thanks,
    Mainak

  • Youtube does not work when i am using wifi on iphone 4

    the youtube does not work when i use wifi. it works perfectly when i use 3 g network ..

    At home when i use my Wi-Fi it work normal, but as soon as i go out, for example on the bus or at work it keeps saying "Cannot connect to Youtube".

  • Server Group not working when one of Job Servers is down

    I have a Server Group of two job servers. They have the same version 12.2.2.3 and are attached to the same Local Repository of version 12.2.2.0.
    When I execute a batch job (from the Designer) and explicitly specify on which job server it should run, it works fine for either job server. Also, when I specify Batch Job execution on Server Group, it works fine.
    However, when I shutdown one of the Job Servers, and then try to execute the job on Server Group, I'm getting two error messages, BODI-1111011 that one Job Server is down, and BODI-1111009 that another Job Server has failed.
    At the same time, when I check the Server Group in the Management Console, it shows that the allegedly failed Job Server is in the status green.
    That error is not reflected in a job server eveng log, nor there is anything written to webadmin log, not in the job trace (the latter isn't created at all).
    Is there anything I can do at this point except raise a support message?

    The issue was with different users for Local Repository in Admin and Job Server config. I discovered it when trying to run the job from Admin Console. Designer is probably not the best diagnostic tool for such kind of issues.

  • Browser not working when apps are in use.

    Although my browser works normally if I use any app which requires an internet connection and try to use the browser simultaneously the browser says connection not available and I'm unable to connect. Any ideas what's wrong?

    That's weird
    Are you using SmartConnect or Psiloc Connect?
    Also, can you check in the browser settings if you have set-up a default connection? (a destination group, or a single access point, or "always ask", or nothing?)
    Maybe you could also check the connection settings for one of the other applications from which you can open the browser (just to make sure that the settings of the application do not conflict with the settings of the browser..)

  • Outer join not working when filters are applied from Prompts

    Hi,
    Without values being selected from the dashboard prompts, my outer join is working fine with all the rows and all the columns showing up( as per requirement). But as soon as I select values in the prompts, only certain rows and columns show up.
    BTW, I have 2 prompts Year and Quarter. I put Year is Prompted or is null in the criteria. It works. BUT as soon as I also put in quarter numbers, it does not work.
    Is there a workaround for this?
    Thanks,
    Dan
    Edited by: Danny on Apr 26, 2013 12:10 PM

    I just experimented by adding is null to not only the year and quarter but to the row and column too and it worked!
    Thanks,
    Dan

  • Lookup expression is not working when I am using with in the rectangle box in SSRS

    I have two datasets with common member is ProgramID.
    I have followed the below steps,
    1. Added one table  (2x2) and mapped this table to dataset1. After that I have removed top row.                                               
    That means I am maintaing only  data row.
    2. Added group to the table (ProgramID). Now the programid is sitting at cell#(1,1) and  cell#(1,2) is blank
    3. I have verified the report with preview and able to see the data for my all programs. I have 5 programs
    4. my plan is adding chart and matrix reports to cell# (1,2). If I am adding chart/matrix to the cell#(1,2) then we can't contol the  cell alignments in terms of height x width.
     To resolve that problem, I have added one rectangle control to the cell#(1,2) then I have added my chart and matrix report
    5. After completing the report, I have verified with preview and able to see the reports (chart/matrix) for all my 5 programs by page wise (note: I have provided page break before for my rectangle)
    6. Till this point, I have no issues
    7. Now, I have added one more row under the group. so, we have our main table (2x2). Becuase of programId group we can only see 3 cells in total table  (cell# (1,1) =ProgramId  cell#(1,2)=chart and matix reports under rectangle box; cell#(2,1)=already
    merged with ProgramID group; cell#(2,2)= planned to add one more rectanlge and add two reports (chart and matrix)
    8. Now, i have added rectangle to cell#(2,2) then added chart and matrix reports within the rectangle.
    9. cell#(2,2) reports are needs to extract the data from dataset-2. Here we have common member is ProgramID (ds-1,ds-2)
    10. First I have tested for matrix report by adding lookup expression
          Matrix report (2x2)
         row-1: Cell(1,1)= Gender report heading ; cell(1,2)=Month  (column group)
         Note: month is also common member in both the datasets. 
         row-2: cell(2,1)--  =Lookup(Programid.value, Programid.value,Gender.value,"Dataset2")  (Gender data is Male and Female)
                    Cell(2,2) -- empty for now
     11. I have tried to preview the report and able to see the report without any issues and below are observations
            main Table (2 x2)
             Cell# (1,1)  = ProgramID --Returning all 5 programs properly
             Cell# (1,2)  = Dataset1 related report (chart and matrix reports under rectangle) -- able to see without any issues
             Cell#(2,1)  = We already know this is merged cell. i.e menas ProgramID dispalying
              Cell#(2,2)= Only Male record is dispalying in the matrix report which is under rectanlge (here we have applied Lookup expression.
    Note: male is the first record from the database and Female is the second record
    Also, observed that Cell#(2,2) matrix report is unable to display the gender count information when I have provided count value expression in the cell(2,2) within the matrix and the expression I have uses is
      = sum(Lookup(ProgramId.value,ProgramId.value,GenderCOunt.value,"Dataset2"))
    Please ask me if I am unable to explain or lengthy explain.
    Point : Why the lookup expression is giving the first record only (in case of gender #(male, female) and why it is unable to give the gendercount.  Gendercount cell is totally blank.
    Please help me.
    Kishore.

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Alerts not working when "reply" is used

    When I get a reply to a sms text, there is no alert, only the led flashes.  I do not have alerts turned off.  They work fine, when the message originates from the sender.

    Can u give us the details like which component you are using for alerts.

  • Dynamic Distribution Groups not working with Office365 Mailboxes

    Ok so my problem is this. I am creating new dynamic distribution lists based on office location with the option to look at the notes section in AD and add an additional office if a user needs to be on both lists.
    We have recently started using Office365 for some users and they need to get the emails too.
    When I create the group initially using:
    New-DynamicDistributionGroup -Name "Location-London UK" -OrganizationalUnit "domain.net/Groups/Email Groups/Locations" -RecipientContainer "domain.net/Our Users" -RecipientFilter {(RecipientType -eq 'MailUser') -or (RecipientType
    -eq 'UserMailbox') -and (Office -eq 'London') -or (Notes -eq 'London')}
    It creates the group limiting to the Accounts with London as their office but it includes every Office365 mailbox we have also.
    There is a DDG in our EMC for an office in Hong Kong but I am not aware of who created it.
    Its filter says:
    ((((((RecipientType -eq 'MailUser') -or (RecipientType -eq 'UserMailbox'))) -and (Office -eq 'HongKong'))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue
    -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
    This group includes only the users with Hong Kong as well as Office365 users with Hong Kong as their office location
    Ive tried to recreate this DG but cant as using Powershell still makes groups with the Office265 users in them.
    The only way ive successfully created a London DG is by using ADSIedit to copy the msExchQueryFilter from Hong Kong to London and change the Office Name to London
    Any help would be appreciated

    For your recipient filter, use the following:
    {((RecipientType -eq 'MailUser') -or (RecipientType -eq 'UserMailbox')) -and
    ((Office -eq 'London') -or (Notes -eq 'London'))}
    See if that works ... that's effectively how the Hong Kong one is built.  Make sure you get the extra parentheses (I bolded them), they should make the difference.

  • Smart Group not working when assigning Card "is not member of"

    I'm trying to create a smart group in Address Book, that seems to be failing.
    What I'd like is a Smart Group where Cards NOT assigned to a certain other group are included in the Smart Group. However, the Smart Group isn't so smart ... in fact, it's coming up with completely the wrong cards. Any idea how I can make this function work?

    yes, there seems to be a bug with such smart groups. they often either don't work or make address book crash. there were a number of posts about it. I don't have a workaround for this, sorry. but I suggest you don't use such smart groups.

  • ClariFit IR Column Grouping not work when Control Break

    Dear,
    i am using ClariFit IR Column Grouping plugin for grouping column heading. Plugin is working fine. But when user use the Actions --> Format ---> Control Break option, the grouping column
    disappears,
    Can some body provide help on this issue or any alternate.
    Regards,

    Regardless of the limitations of IR, having quick access to controls significantly improves the experience.
    Having used the Remote app more than usual in the last few days with my new speakers, I'm reminded of how terrible an app it is if you just want to get in and out quickly -- the Library must load every time you open the app, and then once it does load, you can only use it for a few seconds until it inexplicitly kicks you to the "Now Playing" screen. And this happens every single time you open the app or unlock your phone.  So tasks that should be quick such as pausing, skipping tracks, or adjusting the volume take 15-20 seconds.
    With an IR remote, those tasks are instantaneous.  It doesn't excuse the fact that the iPhone app needs an overhaul, which is a separate issue.

  • Syncronize Camera RAW not working when Auto is used

    I have a problem with settings not being updated in Camera RAW when using the 'Auto' function.
    I have to equalize exposure on a large number of RAW files (often 500+). The Auto function would be great, if it would only apply to the Exposure and not the other settings like contrast.
    To reproduce:
    Open 20 RAW files
    Select all images
    Click 'auto' under the 'tint slider'
    Observe that settings change on all images
    Now change any of the following settings (but NOT the Exposure slider!):
    - Contrast
    - Highlights
    - Shadows
    - Whites
    - Blacks
    Problem: only the settings on the first image are updated, the other images are not edited.
    When you change the Exposure slider, the other settings are updated (probably because the 'auto' mode is disabled).
    I have uploaded a small screen recording of this problem here https://www.youtube.com/watch?v=jGx6wV5v774&feature=youtu.be
    Using 'Synchronize' it is also not possible to copy over the settings to all images.
    I contacted Adobe over the phone, but they can only give the usual nonsense (reset your preferences, reinstall Photoshop, etc).
    I see other people with the same problem, did anybody find a solution or a workaround?

    You now slide it up to open the camera instead of tapping.

  • Drag and drop not working when uploading file using safari

    why i cannot drag and drop any file when using safari , and what happens the file auotmatically open while i need to upload it only , extra for that , i cannot write  any remark or fill a space while using website related to my work.
    my work is to upload drawing files using dwf file to a website so the other parties can review and give me review , and then i reply to the remark at the same place and make meeting through the same site.
    please any body can give any way to correct my mac.
    latelly i installed win7 only to use it for that website , and iam now changing from mac to win whenever i want to work , this not acceptable to me because it is waste of time beside i like the mac and it working with other application but not for safari.

    why ?
    I'm sorry, but every OS is different.  You cannot expect all features of one to be in another.  Or alternatively, for similar features, be done it the exact same way. 
    It looks to me after a quick google search that winexplorer is basically the moral equivalent of the mac's finder to present the file system in different ways.  The OSX Finder also has alternative views of the file system, i.e., icons, list, columns.  Experiment with the list and column views and see if one of them are more to your liking.
    As for winexplorer on the mac.  I don't know if this simulates it or not but there is a program called Macintosh Explorer so check that out as well.
    And finally, in the end, as I said in my earlier post, no matter what, nothing on the mac is going to change what I believe you think you can do and drop a file on a browser window and expect it to upload.

  • SPARQL query through Jena adaptor not work when string literals used

    Hi,
    When I executed the following SPARQL query through Oracle Jena adaptor:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName ?name . }
    I got the expected results.
    However it won't return anything when I narrowed the query to match a particular name like below:
    SELECT ?personHasFirstName WHERE
    {?personHasFirstName foaf:firstName \"Julie\" . }
    I also tried the Filter approach:
    SELECT ?personHasFirstName WHERE {?personHasFirstName foaf:firstName ?name . FILTER (?name =\"Julie\") }
    It still doesn't return any results.
    I saw from the release notes about the bug dealing with "\". My guess is that the above behavior is caused by that bug. What is the suggested way to walk-around this? Thanks,
    Weihua

    Could you please try this? It works as expected on my machine.
    GraphOracleSem graph = new GraphOracleSem( oracle, modelName);
    ModelOracleSem model = new ModelOracleSem(graph);
    Node sub = Node.createURI("http://test.com/employee123");
    Node pre = Node.createURI("http://xmlns.com/foaf/0.1/firstName");
    Node obj = Node.createLiteral("Julie");
    graph.add(Triple.create(sub, pre, obj));
    String queryString =
    " PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
    "SELECT ?person WHERE { ?person foaf:firstName \"Julie\" . } ";
    QueryExecution qexec = QueryExecutionFactory.create(
    QueryFactory.create(queryString), model);
    try {
    ResultSet results = qexec.execSelect();
    while (results.hasNext()) {
    QuerySolution soln = results.nextSolution();
    psOut.println("runQuery: soln " + soln);
    finally {
    if (qexec != null)
    qexec.close();
    output snippet:
    runQuery: soln ( ?person = <http://test.com/employee123> )

Maybe you are looking for