Using 'like' in record group query

Hi ,
(Forms 6i)
I'm creating a record group dynamically.
So in when new item trigger for a list item,
i want to list all names from a table like 'a%';
query : select name, to_char(id) id from test_name where name like 'a%';
but i'm not able give single quote(') in the query.
Is there a way to do that?
Edited by: Tuts009 on May 9, 2010 1:38 AM

Hi Arif,
i'm not giving a% directly in the query, this i'm getiing from what we type in the list , so :list4
i'm storing it in another string say str and then the query will be
str := :list4||'%';
rg_id := Create_Group_From_Query( rg_name,
                           'SELECT name,to_char(id) id from test_name where name like '||str); Now any help?

Similar Messages

  • ORA-00904 when use column alias in Record Group Query

    Is it possible to use column aliases in Record Group Queries?
    I have a query that runs fine in SQL*Developer, but gives me runtime errors when I use it as a Record Group Query.
    When I use it as a Record Group Query, the Form compiles, but at runtime I receive the following errors:
    FRM-40502: ORACLE error: unable to read list of values
    when I use Help - Display Error, I see:
    ORA-00904:"CHILDNAME":invalid identifier
    The query is something like this
    select decode(complex stuff here) as "childname" ....
    I've tried it with and without the double quotes surrounding the alias name, and have also tried it without using the "as" keyword.
    I would appreciate any suggestions or insights. I'm using Forms 9.0.4.
    Thanks.

    It looks like this is caused by bug 725059:
    "FILTER BEFORE DISPLAY" DOESN'T WORK IF LOV HAS COLUMN ALIASES (TRIAGE1098)
    My LOV does have the Filter Before Display turned on. Here's the text of the bug:
    IF an LOV is created with column aliases in the select statement, (eg: select ename emp_name from emp) and the LOV property "Filter Before Display" is "Yes", THEN when you attempt to filter the LOV at runtime, (eg: type '%' then press the 'Find' button) the internal WHERE clause that forms sends to the database is: WHERE column_alias LIKE '%%' This is incorrect syntax. A client-side sqlnet trace shows this. The correct syntax should be: WHERE column LIKE '%%' . The incorrect syntax results in no rows returned. However no error is displayed by forms to the user.

  • Record Group Query

    When i click the LOV it is giving Error Frm-40502 ORACLE error: unable to read list of values.
    I have written the following query in the Record Group
    Select uua_cd_company, uua_cd_dept, uua_id_proc_cntr from v_user_user_area where uua_id_users = user
    I have used the user keyword in my query. When i run my form connecting to 11g database i get the LOV error
    But when i run the form in 10g Database the LOV works.
    Is there any restirction in using "User" in record group in LOV

    Seems like the select does not work for some reason against your 11g database. Try to execute the query using SQL*Plus with the same user youuse to connect in forms.

  • Record group query question

    Just wondering if we need to check :system.mode = query or normal in the query for record groups or oracle forms handles it automatically
    Thanks

    No, you should not check System.Mode in a record group query. But then, Forms does not do that either.
    Your question makes me wonder what you are doing... Record groups are usually populated only when you need to see a list of values, or use an LOV to perform an edit.

  • List item - Record Group Query - Alignment improper Order

    Dear All,
    When am trying to concatenate two columns using record group query and displaying in the list item, the alignment is not in proper order.
    E.g; Below is the columns and data's used in process:
    CODE_VALUE     SHORT_DESC     DESCRIPTION
    ROLL1     Customer - Non accidental     Production, booking with other carrier, bad projection.
    ROLL2     Customer - Accidental     L/C, B/L draft, Customs, Samples, AMS, LAR.
    ROLL3     ABC - Lack of empty     Lack of empty units.
    ROLL4     ABC CDE - Roll over     AGR RRR decision.
    ROLL5     ABC XXX - Accidental     IMO or OOG refused, operational problems, Cut & Run.
    ROLL6     ABC YYY - Fictive booking     Equipment buffer, dummy booking.
    Below is the record group query used in forms:
    PROCEDURE p_when_new_form_instance
    IS
    GROUP_ID recordgroup;
    list_id item := FIND_ITEM ('BLK_CONTROL.LI_ROLL_REASON');
    rg_name VARCHAR2 (20) := 'LI_ROLL_REASONS';
    status NUMBER;
    l_query VARCHAR2 (4000);
    BEGIN
    l_query :=
    'SELECT rpad(short_desc,50,'' '')||'' | ''||description description, code_value code_value FROM codes WHERE code_value IN (''ROLL1'', ''ROLL2'', ''ROLL3'',''ROLL4'',''ROLL5'',''ROLL6'')';
    GROUP_ID := CREATE_GROUP_FROM_QUERY (rg_name, l_query);
    status := POPULATE_GROUP (GROUP_ID);
    POPULATE_LIST (list_id, GROUP_ID);
    EXCEPTION
    WHEN OTHERS
    THEN
    pl_common.when_others;
    END;
    Moreover i have my list item font property by default as ""MS SANS SERIF" and when i run in Forms Builder am getting the alignment as below.
    Result:
    ====
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    Above order is not the expected result as all the |(pipe) symbol should display in proper order as below.
    Expected Result:
    ==========
    DESCRIPTION     CODE_VALUE
    Customer - Non accidental | Production, booking with other carrier, bad projection.     ROLL1
    Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR.     ROLL2
    ABC - Lack of empty | Lack of empty units.     ROLL3
    ABC CDE - Roll over | AGR RRR decision.     ROLL4
    ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run.     ROLL5
    ABC YYY - Fictive booking | Equipment buffer, dummy booking.      ROLL6
    I tried with RPAD and LPAD still the alignment issue is there; i know the issue is because of invariable length of the font.
    But is there any solution to override this it will be of great help.
    So please help!!!!!!!!!!!!!!!!!
    Thanks..................
    Regards,
    Sunil.G

    Hi Francois,
    Thanks for your reply. I have tried changing the font to "Courier(Western)" it is working fine.
    But as per the standards defined, it should be "Ms Sans Serif" nothing apart from that.So that is where the problem lies. :(
    Regards,
    Sunil.G

  • Record Group Query - item block

    I need to calculate a Record Group Query using a block item value, but when a use the query below the query didn't return rows:
    SELECT OID_SIIB_FINALIDADE_TED
         , F.COD_FINALIDADE || ' - ' || F.DES_FINALIDADE DES_FINALIDADE
      FROM SIIB_FINALIDADE_TED F
          , ( SELECT P.TP_PARAMETRO
                FROM SIIB_PARAMETROS_GERAIS P  
              WHERE P.NM_PARAMETRO = 'TIPO_' || :BLOCK.ITEMX ) PAR -- using the :BLOCK.ITEMX the query did'nt return data
    WHERE PAR.TP_PARAMETRO = F.TPO_FINALIDADEBut if a use a static query the Record Group( changing :BLOCK.ITEMX for 'STR0005' ) return the desired values.
    This Record Group is used to pupulate a LOV.
    Edited by: user5914526 on Feb 15, 2012 9:26 AM
    Edited by: user5914526 on Feb 15, 2012 9:26 AM
    Edited by: user5914526 on Feb 15, 2012 9:29 AM

    No, it doesn't .
    And return the message: "There aren't data in the List of Values"
    And the block item is not empty or null.
    Edited by: user5914526 on Feb 15, 2012 10:13 AM

  • Changing the record group query in seeded forms

    Hi all,
    I need to change the record group query in one seeded form.
    Can it be done through custom pll or what is the correct approach to do that..
    Thanks,
    Devang

    you want to do that at runtime?

  • RECORD GROUP QUERY PROPERTY

    Hi:
    Is there any way you can get at runtime the query of a record group?.
    I can't find any property for this.
    Can I use a tree to put there the record group and after this get it with
    Ftree.GET_TREE_PROPERTY( htree, 'QUERY_TEXT')
    Thanx

    I don't think that it will work with a tree, but you could try to keep the query in a parameter and assign it to the recordgroup at runtime. At least you can read the parameter.

  • Using "LIKE" in J2EE SQL Query Window

    Whats the syntax to define a finder method using the SQL "LIKE" clause in J2EE in the deployment settings of an CMP entity bean...for example lets say I have an entity bean with a primary ket called "PK" and a String data member called "Titile", I've tried:
    SELECT "PK" FROM "EntityBeanTable" WHERE "Title" LIKE
    %?1%
    but that doesn't work...any suggestions?

    I believe the solution may be vendor specific. i am using weblogic5.1 and i use CMP entity beans.
    Now the if i want a sql with like clause, then i give in the following entries in my
    weblogic-cmp-rdbms-jar.xml
    <finder>
    <method-name>findByPrimaryKey</method-name>
    <method-params>
    <method-param>java.lang.Long</method-param>
    </method-params>
    <finder-query><![CDATA[ (like acctCode $0)]]></finder-query>
    </finder>
    for more options please refer u r vendor documentations.
    regards
    rajesh

  • Help with poplist record group query

    Hi, I want to populate a poplist based on the following query:
    SELECT value
    FROM table.value
    WHERE code_parent IS NULL
    UNION ALL
    SELECT 'ALL'
    FROM dual
    ORDER
    BY code
    Now I know that you need 2 columns in the record group to populate a poplist, but I cannot seem to modify the query to have 2 columns. I am basically adding the 'ALL' value, which will have a label of 'ALL' and a value of 'ALL'.
    The first select I can easily modify to be an acceptable record group for a dynamic poplist, Its the union that im having problems with. The following select does not work. Help would be appreciated.
    SELECT table.value, table.value
    FROM table.value
    WHERE code_parent IS NULL
    UNION ALL
    SELECT 'ALL', 'ALL'
    FROM dual
    ORDER
    BY table.value

    Based on the error I'd guess that one of your columns are defined as a number and the union columns are both varchar2. Match the datatype with the column it corresponds to:
    UNION
    SELECT 'ALL', 0
    FROM DUAL
    ORDER BY 1
    The order by clause also needs to reference the column number instead of the column name since the union clause does not have a column name.

  • How to use LIKE Operator with my query requriment

    HI all,
    I have a requirement as follows
    EMPID ENAME JOB SAL
    10 RAJ KAMAL MANAGER 25000
    20 KAMAL RAJ NAYAK CLERK 4000
    30 NARENDAR GUPTA ANALYST 20000
    40 ASHUTOSH GUPTA DEVELOPER 10000
    50 ASHUTOSH NAYAR PROGRAMMER 15000
    i am searching enames such that i need to get the whole name even if i search with just a single LETTER/WORD immaterial of the order they exist in the name for which i need to get the whole name.(INFACT WORD comparision)
    ex:
    1) select * from emp where ename like '%ka%'
    i am getting:
    10 RAJ KAMAL MANAGER 25000
    20 KAMAL RAJ NAYAK CLERK 4000
    This is not what i need i need just word camparision not letters comparision let me tell you...
    select * from emp where ename like '%amal%'
    Even for this query ill get the same output.. this is not my option to go..
    I need just word comparision with starting letter and immaterial of the word position in the name
    If it is possible to do with query please let me know..
    Thanking you
    Narendar Vishwanatham

    Full example:
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select 10 as empid, 'RAJ KAMAL' as ename, 'MANAGER' as job, 25000 as sal from dual union all
      2             select 20, 'KAMAL RAJ NAYAK', 'CLERK', 4000 from dual union all
      3             select 30, 'NARENDAR GUPTA', 'ANALYST', 20000 from dual union all
      4             select 40, 'ASHUTOSH GUPTA', 'DEVELOPER', 10000 from dual union all
      5             select 50, 'ASHUTOSH NAYAR', 'PROGRAMMER', 15000 from dual)
      6  -- END OF TEST DATA
      7  select *
      8  from e
      9* where regexp_like(ename,'(^| )KA( |$)')
    SQL> /
    no rows selected
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select 10 as empid, 'RAJ KAMAL' as ename, 'MANAGER' as job, 25000 as sal from dual union all
      2             select 20, 'KAMAL RAJ NAYAK', 'CLERK', 4000 from dual union all
      3             select 30, 'NARENDAR GUPTA', 'ANALYST', 20000 from dual union all
      4             select 40, 'ASHUTOSH GUPTA', 'DEVELOPER', 10000 from dual union all
      5             select 50, 'ASHUTOSH NAYAR', 'PROGRAMMER', 15000 from dual)
      6  -- END OF TEST DATA
      7  select *
      8  from e
      9* where regexp_like(ename,'(^| )KAMAL( |$)')
    SQL> /
         EMPID ENAME           JOB               SAL
            10 RAJ KAMAL       MANAGER         25000
            20 KAMAL RAJ NAYAK CLERK            4000
    SQL>

  • Error message:FRM-12001: Cannot Create the record group(check your query)

    Requirement: Need to get employee name and number in the LOV in search criteria.
    So I created LOV "full_name" and Record group Query under Employee Name property palette with
    select papf.title||' '||papf.last_name||', '||papf.first_name||' '||papf.middle_names emp_full_name
    ,papf.employee_number
    from apps.per_all_people_f papf, apps.per_person_types ppt
    where sysdate between papf.effective_start_date and papf.effective_end_date AND papf.person_type_id=ppt.person_type_id AND ppt.system_person_type IN ('EMP', 'OTHER', 'CWK','EMP_APL')
    AND PPT.default_flag='Y' and papf.BUSINESS_GROUP_ID=1
    order by papf.full_name
    I was unable to save and getting error message "FRM-12001: Cannot Create the record group(check your query)".
    I cant use PER_ALL_PEOPLE_F.FULL_NAME since full name here is last_name||title||middle_names||firstname.
    But my requiremnet is papf.title||' '||papf.last_name||', '||papf.first_name||' '||papf.middle_names emp_full_name .
    Can any one of you help me.

    First, Magoo wrote:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy">create or replace function emp_full_name ( p_title in varchar2,
    p_last_name in varchar2,
    p_first_name in varchar2,
    p_mid_names in varchar2 ) return varchar2 is
    begin
    for l_rec in ( select decode ( p_title, null, null, p_title || ' ' ) ||
    p_last_name || ', ' || p_first_name ||
    decode ( p_mid_names, null, null, ' ' || p_mid_names ) full_name
    from dual ) loop
    return ( l_rec.full_name );
    end loop;
    end;</font></pre>
    Magoo, you don't ever need to use Select from Dual. And the loop is completely unnecessary, since Dual always returns only one record. This would be much simpler:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy">create or replace function emp_full_name
    ( p_title in varchar2,
    p_last_name in varchar2,
    p_first_name in varchar2,
    p_mid_names in varchar2 ) return varchar2 is
    begin
    Return ( Ltrim( Rtrim ( p_title
    ||' ' ||p_last_name
    ||', '||p_first_name
    ||' ' ||p_middle_names )));
    end;</font></pre>
    And second:
    user606106, you did not mention how you got your record group working. However, you DO have an issue with spaces. If you change this:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy">select papf.title||' '||papf.last_name||', '||papf.first_name||' '||papf.middle_names emp_full_name
    ,papf.employee_number </font></pre>
    to this:
    <pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy">select Ltrim(Rtrim(papf.title||' '||papf.last_name||', '
    ||papf.first_name||' '||papf.middle_names)) AS emp_full_name,
    papf.employee_number</font></pre>
    it should work. The Ltrim(Rtrim()) removes leading and trailing spaces from the resulting full name.

  • About Record Group

    Hi Sirs,
    I am unable to get char data type number data type and date data type information from a record group.
    How will i come to know about data type as like i have a record group as select id,name from mytable.
    now if i have id as number then i may use get_number_group and if id is character then get_character_group but if i changed the number to character
    in the background from table data structure then it will give error. how to skip from such errors.

    you may get error in get_number property if you receive a character filed in your query.
    so you may use select to_char(number_field),to_char(date_field,'dd-mon-yyyy') .... etc in your record group query.

  • Dynamically  populate  a  record  group  on  the  fly uisng LOV

    Hi,
    I want to create dynamically populate a record group on the fly uisng LOV.
    1. This is how the RG_BANKNAME Record Group object look like
    Object : Record Group
    Name : RG_BANKNAME
    Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
    2. I create the Push Button and when user click it will popup the LOV.
    DECLARE
         rg_id RecordGroup;
         errcode NUMBER;
         status BOOLEAN;
    BEGIN
         rg_id := Find_Group('RG_BANKNAME');
         IF Id_Null(rg_id) THEN
              Message('No such group: ',ACKNOWLEDGE);
              RAISE Form_Trigger_Failure;
         ELSE
              errcode :=POPULATE_GROUP(rg_id);     
              SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
              SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);     
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);     
              status := Show_LOV('LV_NAME',10,20);
              IF NOT status THEN
                   Message('You have not selected a value.');
                   Bell;
              END IF;
         END IF;
    END;
    My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
    create on my design times, because I thought it can be done dynamically on the fly.
    The problem is compliant that the Lov Id is not valid.
    Thanks
    David
    Edited by: user445990 on May 24, 2011 9:19 PM

    Hello,
    You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
    Francois

  • URGENT : Record Group Problem

    hello all
    i have a problem regarding record group.
    i want to populate my record group with a dynamic clause which is
    "and main_code not in ('02725','02868')"
    and my record group query is
    "select mt.main_number from main_table mt,main_parent mp
    where mt.main_code = mp.main_code
    and mt.main_code not in (:parameter.param_main_code)"
    now i am adopting the following method for populating the
    LOV(list of values) which is attached to a text item:
    assigning values i.e. '02725','02868' to my parameter object i.e. :parameter.param_main_code but the record group is not giving changd results according to my criteria i.e.'02725','02868'...
    does any body knows the solution for this problem..kindly help him with it..logically the record group query should work and return a changed results for the LOV..
    please help me with this.....
    thank you.

    I thing you can't able to do what you are trying to do, but you can achive this by using dynamic record group.
    Create the dynamic record as same struncture of design time then populate it by the coding.
    Sample Code is
    declare
         l_rec_name RecordGroup;
         l_rec_col GroupColumn;
         l_rec_col1 GroupColumn;     
         cursor l_ename is select ename from emp;
         l_row number(12):= 1;
    begin
         l_rec_name := create_group('rg_dynamic',Form_scope, 100);
         l_rec_col := add_group_column(l_rec_name,'ENAME',char_column,30);
         l_rec_col1 := add_group_column(l_rec_name,'EMPNO',number_column,6);     
         for i in l_ename
         loop
              add_group_row(l_rec_name, end_of_group);
    set_group_char_cell(l_rec_col,l_row, i.ename);
    set_group_number_cell(l_rec_col1,l_row, l_row);
    l_row := l_row+1;
         end loop;
         :parameter.num_rows := l_row -1;
         set_lov_property('LOV5',group_name,'RG_DYNAMIC');
    end;
    I hope this will help you to solve this problem.
    [email protected]

Maybe you are looking for

  • 11.5.9 Payables User Guide

    11.5.9 Payables User Guide pdf cannot be downloaded. I could download other manuals such as ADI User Guide. Is it because of the size of file? Thanks, CiC

  • Basic form with external data

    I am not sure if I am overcomplicating something I am trying to do with designer/Acrobat. I am trying to create an interactive work order. Much of the basic layout has been done, and most of the fields are doing what I want them to do, though I still

  • Tab opens in new window by itself

    I have several tabs open that I switch between, one of them being Facebook, and that is the only one that ever gives me issues. Sometimes when switching between tabs, the Facebook tab pulls itself out of the group, and into it's own new window, and I

  • Mail problem with receiving

    Hello , Since I have installed Lion , gradually my received mails are disappearing and since today I cannot receive mails at all. Sending mails is no problem ! Any idea's ? vissc636

  • Hi gurus in calltansaction

    hi gurus in calltansaction there r totally 10 records , while processing it, ifsystem craches after 5th record , is it possible to start again from 6th record. explin me plz.