Querying LOV ....

Hi,
I am working on some screen in which there is Item Lov.Fot this I created VO and AM.Problem is in LovVO my query is like this:
Select * from xxxxxxx where vendor_id=yy.
So where do i need to mention where clause? I tried creating Controller on LOVRN but it doesn't work.
Normally in my previous LOV quiries i used give select * from ......
But in some screens i do have "where" clause also.
Please help me if one come across this type of .....
Thks.

public void initQuery()
StringBuffer whereClause = new StringBuffer();
Vector parameters = new Vector();
String strVendorID = "";
OADBTransaction oadbtransaction = (OADBTransaction)getDBTransaction();
VendorID vid = new VendorID();
strVendorID = vid.getVendorID(oadbtransaction);
setWhereClauseParams(null);
whereClause.append(" Vendor_id=:1" );
parameters.addElement(strVendorID);
setWhereClause(whereClause.toString());
Object[] params = new Object[1];
parameters.copyInto(params);
setWhereClauseParams(params);
}

Similar Messages

  • Need help in Bind variable in AF Query LOV

    Hi,
    i have one problem with bind variable, if i use bind variable in the LOV VO Query then my result is not coming, if there is not bind variable it's working fine and if i use the bind variable in the LOV search option then it's working fine but if i hide the bind variable and set the value in AM prepareSesstion method the LOV is not returning any value. I try to return the values also all values are also coming but those values are not setting to AF Query Attribute.
    Query is:
    select substr(d.description,0,40) description
    from cm_system_users a,
    cm_user_responsibilities b,
    cm_responsibility_processes c,
    cm_processes d
    where a.nt_login =:B_NT_LOGIN
    and a.user_id = b.user_id
    and trunc(sysdate) between b.eff_date and nvl(b.exp_date,sysdate + 1)
    and b.RESPONSIBILITY_ID = c.RESPONSIBILITY_ID
    and c.process_type = d.process_type
    and d.enabled_flag = 'Y' order by d.arguments_flag
    AM Method:
    CmProcessViewImpl vo = getCmProcessView();
    String nt_login = getUserPrincipalName();
    vo.setNamedWhereClauseParam("B_NT_LOGIN", nt_login.toUpperCase());
    vo.executeQuery();
    Can any one help me in this. it's urgent for me.

    This is a little underdescribed. IIUC, the view object in question is being used as a target for a view accessor, correct? (Otherwise you'll have to be more explicit about what you mean by "Query LOV".
    If I'm right, there are two possibilities:
    1) You are using a VO instance in a shared application module instance. If so, make sure your code is in the prepareSession() for that application module class if it's session dependent (as it seems to be below), you need to make sure the application module instance is shared at session scope.
    2) You've based the view accessor directly on the VO definition. This basically creates an anonymous VO instance; I don't think there's any way to use prepareSession() to set a bind variable on such an instance (which won't be created until the accessor is first used). You might be able to get by with putting similar code into the view object class' create() method, but I haven't tested this.
    If your code is in your primary application module class (as opposed to the class for a shared AM instance), the problem here is that getCmProcessView() returns the VO instance from that application module instance's design-time data model, which is never used by view accessors.
    By the way, why do you need to do this in prepareSession() instead of at the view accessor level? I believe you can get the logged in user name (for the view accessor) in with the groovy expression
    viewObject.DBTransaction.session.userPrincipalName
    or possibly just
    DBTransaction.session.userPrincipalName
    (despite this involving DBTransaction, it returns the web app user name, not the DB username).
    That's a 100% declarative solution, if you don't count the Groovy expression as non-declarative.
    If you're afraid of a user executing the LOV (somehow) before the bind variable value gets set, just ensure that the bind variable is marked "required".

  • Query LOV and how to display the LOV back in the Text item.

    Hi All,
    I have got a big time problem in getting back my LOV value after Querying it.
    Am using a Tabular Canvas having 10 rows and two columns, one having "Type"(as LOV) and corresponding "Type identifier".
    My LOV is an non data block item, having the correct return type. When ever i search for a value in the LOV, its should give out all the "Type Identifier" list and the "Type".
    But what i am facing is, am not able to get back the selected LOV after querying it and am getting the entire "Type Identifier' with out any filter.
    In short my requirement is,
    - I need to search an LOV,
    - Display the LOV value in the "TYPE" field.
    - Display the corresponding "Type Identifiers'
    Pls note: Since am new to Oracle Forms, if in your replies, if you specify to use any code in trigger, pls specify which trigger to use.
    Thanks a lot in Advance... its bit urgent
    Arun

    Hi Dave
    The requirement is suppose i have an Lov called OrgName is atatched to a column in which user will select the Ou Name from the list and internally the respective org_id will store into the database where the OU Name is available in the same data block but it is not database item . (Only org_id is database item)
    Now if you query the same block i would expect the Ou Name should display .
    Right now in my case it is not displaying anything into that column.
    Hope u understood this time..Please let me know is there any trick?

  • Af:query LOV selection is not retained.

    I have created a programmatic View object and created a view criteria based on three attributes.
    In af:query panel these attributes are displayed as LOVs.  When I click the LOV search icon,
    a Search and Select popup window opens.  When I select one of the rows by double clicking on it the popup
    is closed and instead of the selected value, first value in the table is selected always.
    Also, popup window occupies the entire width of the browser and the table, inside the popup, displaying the LOV attribute value list is rendered with
    horizontal scroll bar because of which the table has to be scrolled all the way till the end and then only OK button is displayed.
    Is there a way to control LOV popup window dimensions?
    Version: JDEV 11g Release 1

    Check that you defined "Key Attributes" in you VO and also in LOV VO.
    To control the width of the input parameters, in VO definition, click on the bind variable and in UI hints tab set the "display width"

  • Querying LOV schedule information

    Is there any way to query the LOV schedule information using the Business Objects Query Builder?  We are able to pull data about Crystal reports and their schedules into a database to do more thorough auditing and we would like to do the same with LOVs.  I know these are treated as reports themselves so I'm wondering how we can get at the backend data of those LOVs that are scheduled.

    I didn't think about the query tool restricting the number of rows returned.  I'm sure that is what is happening with Query Analyzer.
    Executing "select count(*) from jobrun" will give you an accurate count of the number of rows in the table since it only returns one row.
    "Trigger History Retention" does not determine how many days "Job History" will be retained.  Click on the Help Icon (?) for a description of the "Trigger History Retention" setting.
    The Defaults tab has the default value for "Job History Retention".  This determines how long Job Activity is retained.  If this is 30 days, then, if a job has not run in the last 30 days, the job may not have entries in the jobrun table.
    When a job is created, the "Job History Retention" value is used to set the "History Retention" of the job (found on the Job Definition, Options tab).  If you have never changed the value in the Defaults tab, then it is likely all your jobs have this value.  But if the Default value was changed at some point, then the jobs created before the value was changed will have one value, the jobs created after the change will have another value.  To determine the History Retention value for a single job, you can check the Options tab of the Job Definition.  To find out if all your jobs have the same value, you can run this query.
    select distinct jobdtl.jobdtl_retnsn
    from jobdtl
    If your default for "Job History Retention" was never changed, this will return a single value.
    If you know a job that runs infrequently, you can look at the History tab of the job.  I'm not sure what to expect.  If the job only runs quarterly, for example, will there be no history shown if your Job History Retention is set to 30 days?
    It may be possible to determine the last time a job ran by querying the msglog table.  This table can be quite large, so you have to be careful constructing your queries.  The Logging tab of the System Configuration specifies how long these records are retained.
    Tracy

  • When Press "Execute Query" LOV return Item not showing

    I created a LOV and defined return items.
    In the form I created display items, database property NO and assign variable name which is in LOV.
    When I enter a new record LOV shows the return item but when I am executing query only database record is showing and I want to show the all item even they are in database or not.
    Message was edited by:
    Kamran

    execute query populates only database items. To populate non database items after execute query, use post query trigger.

  • Auto query LOV when window pop's up

    Hi,
    I have external LOV and I'm trying to auto query all raws when user opens LOV window.
    The thing is that user is too lazy to put % in criteria item and since its in Advanced table I can't initialize value there.
    Any idea?
    I putted this in my lov CO ProcessREquest
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObjectImpl vo = (OAViewObjectImpl)am.findViewObject("otItemsVO1");
    vo.executeQuery();
    but it is not working.
    I do not know why

    Hi.
    Thank you for your help.
    I tried your code and here is the result.
    the first time that I open the LOV printed query is the one below
    select distinct pll.inventory_item_id,
    pll.item_description,
    pll.list_price,
    lv.lookup_code
    from qp_price_list_lines_V pll,
    fnd_lookup_values lv
    where pll.price_list_id = lv.attribute5
    and lv.lookup_type = 'XXA_ASN_QT_TYPES'
    order by pll.item_description asc
    the second time I open the LOV the query is this one with bind variables
    SELECT * FROM (select distinct pll.inventory_item_id,
    pll.item_description,
    pll.list_price,
    lv.lookup_code
    from qp_price_list_lines_V pll,
    fnd_lookup_values lv
    where pll.price_list_id = lv.attribute5
    and lv.lookup_type = 'XXA_ASN_QT_TYPES'
    order by pll.item_description asc) QRSLT WHERE (( UPPER(LOOKUP_CODE) = :1 AND (LOOKUP_CODE like :2 OR LOOKUP_CODE like :3 OR LOOKUP_CODE like :4 OR LOOKUP_CODE like :5)))
    none of times I got the result queried.
    this is my LOV
    <oa:listOfValues version="10.1.3_1086" xml:lang="en-US" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:jrad="http://xmlns.oracle.com/jrad" xmlns:ui="http://xmlns.oracle.com/uix/ui" xmlns:user="http://xmlns.oracle.com/jrad/user" xmlns="http://xmlns.oracle.com/jrad" file-version="$Header$" amDefName="oracle.apps.xxa.qt.lov.server.qtLovAM" postDefault="false" controllerClass="oracle.apps.xxa.qt.lov.webui.qtOTItemsLOVCO">
    <ui:contents>
    <oa:table id="ssItemsTAB" serverUnvalidated="false" name="qtOTItemsLOV" blockSize="100">
    <ui:contents>
    <oa:formValue id="InventoryItemId" dataType="NUMBER" prompt="InventoryItemId" viewName="otItemsVO1" viewAttr="InventoryItemId"/>
    <oa:messageStyledText id="ItemDescription" dataType="VARCHAR2" prompt="Servicio" viewName="otItemsVO1" viewAttr="ItemDescription" maximumLength="240" queryable="true"/>
    <oa:messageStyledText id="ListPrice" dataType="NUMBER" prompt="Precio" viewName="otItemsVO1" viewAttr="ListPrice"/>
    <oa:messageStyledText id="qtType" viewName="otItemsVO1" viewAttr="LookupCode" selectiveSearchCriteria="false" rendered="false"/>
    </ui:contents>
    </oa:table>
    </ui:contents>
    </oa:listOfValues>
    and this part is my mapping
    <oa:messageLovInput id="itemDescription" externalListOfValues="/oracle/apps/xxa/qt/lov/webui/qtOTItemsLOV" viewAttr="Description" unvalidated="false" translatableDefaultValue="%">
    <lovMappings>
    <lovMap id="lovMap1" lovItem="InventoryItemId" resultTo="inventoryItemId"/>
    <lovMap id="lovMap2" lovItem="ItemDescription" resultTo="itemDescription"/>
    <lovMap id="lovMap3" lovItem="ListPrice" resultTo="grossAmount"/>
    <lovMap id="lovMap4" lovItem="ListPrice" resultTo="grossAmountDsp"/>
    <lovMap id="lovMap5" lovItem="ListPrice" resultTo="netAmount" useForValidation="no"/>
    <lovMap id="lovMap6" lovItem="qtType" requiredForLOV="true" criteriaFrom="Qttypecode"/>
    </lovMappings>
    </oa:messageLovInput>
    :(

  • Auto Query LOV

    Hi,
    Is there a way to automatically query the values without putting the '%' and click the Find button ?
    My requirement is when the user click on a LOV field and tab, it should bring up all the values available from the list without putting the '%' and find.
    Thanks in Advance!
    Ravi

    You dont need to enter the '%' sign if you want to do a blind query in the Lov. One way to get the Lov queried when you click on it is to enter partial values. There is a feature call autocomplete which gets invoked therein. The Lov shall try to find the exact match for the partial data you entered in the field. If it finds unique match, it shows that value otherwise opens the window with filtered records.
    This update doesn't solve your case, but may be you can set the expectations of the functionality in this way.
    Thanks

  • Query lov

    hii
    i have tabular block .
    it has two fields unit of measure id(uid) and unit of measure name (uname)
    on the form only Uname is displayed.
    when i query the field for a particular value i get a genralised result
    lke if i query the table for gallons ,the query is executed for all the unit of measurs and i get all the records . I want only those records whose Uname is Gallons
    what is going wrong with my code??
    is there anything else i need to do to do to get the right query
    I also have a lov for unit of measure from which i can select the Uom
    I have also asinged the look up items for Uname and Uid in the lov
    plzzz help me
    Mandar

    write down all blocks with their name and the items in the blocks with names.
    then write us, which triggers you use in that context

  • BI Hierachy node values not showing up in WebI LOV

    Hi Experts,
    We are on BI 7.0 Ehp1 and BOBJ ENTERPRISE XI 3.1.
    We have a Bex query with Hierarchy and Hierarchy node variable.
    In the Webi Query LOV only the Hierachies show up but not the values for nodes.
    Since these are not mandatory vairables the WeBI query runs fine and fetches the required data.
    The variables are in the Filter section of the Bex query and the refrence characteristic on which the hierarchy variable is based  is NOT in the free characteristic and the rows.
    There are 5 hierachies in BI with about 5300 nodes.
    Any help or leads will be highly appreciated!
    Thanks,
    Satyen
    Edited by: Satyen Popat on Feb 5, 2010 12:30 AM

    Hi Ingo,
    As always appreciate your response. Yes, both the variables (Hierarchy and hierarchy node variable) are part of the universe.
    When I hit refresh on the LOV screen for the node values  <No Values> is returned.
    These values show up properly on the Bex side.
    Thanks!
    Satyen
    Edited by: Satyen Popat on Feb 5, 2010 12:44 AM

  • Problem Use Query Bind Parameters with binding

    Hi Developers
    i use JHeadstart 11g TP2
    I want use Lov Group by Query Bind Parameters. when i use simple value like "P_PARENT_ID=10" , Query Lov view By this parameter right but when i use Binding like "P_PARENT_ID=#{bindings.inputtext1.inputValue}" and inputtext1 value is 10 but result is wrong and show me all record , my where clause of my view is (Acc.ID_FK =:P_PARENT_ID OR :P_PARENT_ID is null)
    this method work in Jheadstart 10g but not in 11g
    Regards,
    sanaei

    sanaei,
    Did this really work in 10.1.3 without custom templates?
    Assuming inputtext1 is in your base page, then #{bindings.inputtext1.inputValue} should return null when used as query bind var in the LOV, since the LOV page as its own binding container (stored under request attribute "bindings").
    In R11, we have a cleaner way to pass parameters to an LOV:
    - In the LOV group, define a parameter, for example "parentIdParam"
    - In the LOV group, use the following expression as Query Bind Parameters:
    P_PARENT_ID=#{pageFlowScope.parentIdParam}
    - In the lov item of the base group, add a parameter named "parentIdParam" and set the value to #{bindings.inputtext1.inputValue}
    That should work.
    Steven Davelaar,
    JHeadstart Team.

  • Number of items in LOV

    We have predefend LOVs in Shared Items, based on query.
    We would like to create some processing regarding number of items in that predefined LOV, but not to repeat Query that create it, but to call some htmldb_item or so function to retrieve number of items .
    THX!

    SUppose that LOV has null values and ... values from query.
    In a case that there query return only one value, we'd like to define that LOV is showing automatically first value...not to vait that user choose it...because user can choose only that value.
    Because our LOV's are defined in shared items, we do not want to re-query LOV's query to retrieve number of items but to use something that depend on LOV's real number of items.
    So we'd like to set the value for cases like that.
    P.S.
    This may be a nice request on wish list: LOV that have checkbox in design mode, which will make first item default in a case when LOV show null items and number of query items are two.
    Hope this was clear

  • How to set in LOV the username  by default?

    Hi everybody!
    I am trying to bind the userName in a LOV Query Attribute by default and I need the Blank item too.
    I followed this thread
    Need help in Bind variable in AF Query LOV
    and it works pretty well (Default: viewObject.DBTransaction.session.userPrincipalName) but when I select this "Blank item" get this error:
    oracle.jbo.JboException: JBO-29000: Unerwartete Exception abgefangen: java.lang.reflect.UndeclaredThrowableException, Meldung=null
         at oracle.adf.model.binding.DCIteratorBinding.reportException(DCIteratorBinding.java:363)
         at oracle.adf.model.binding.DCIteratorBinding.executeQuery(DCIteratorBinding.java:2097)
         at oracle.jbo.uicli.binding.JUSearchBindingCustomizer.applyAndExecuteViewCriteria(JUSearchBindingCustomizer.java:590)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:357)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    "Blank item" works if I use String value by default but i need the current user.
    Thanks

    Hi Krishna,
    You don't mention what platform you are running on, but I will presume it is a Windows platform. In the Windows architecture, the printer driver is the one that sets the default paper size/tray. Applications like Reports can override the default printer tray selection if they wish, but this is generally considered to be a bad practice, so Reports doesn't do this.
    There are two possible solutions that I know of: (1) if all the users of a given report always use the same printer or same printer model, then you can explicitly choose the desired printer tray to use by calling SRW.SET_PRINTER_TRAY in the Before Report Trigger, the Between Pages trigger, or in an appropriate format trigger. (2) you can create another printer queue in Windows against the same physical printer, choosing a different printer tray as the default tray. Then people wishing to print using a different paper size/orientation can choose the appropriate printer "name" to print with.
    regards,
    Stewart

  • Need advice on how to create report

    I'm not sure how to do this, so I'm asking advice from the apex gods...
    here is the issue, I have two tables that I need to combine info from. not an issue in its self. I can do that. but here is the issue. in Table A I have some data like disc_id, title, theids, etc.. Table B contains fullname, theid, emplid
    now in table A the column 'theids' is populated from apex as a multi select list. so the values in the column is something like 48;3;88
    it got these id numbers from the Table B query (lov popup) that returns theid of the person chosen.
    now I have to create a report that will be used in a excel download and what they want is one line per disc_id and they want the more useful 'emplid' in the field where 'theids' are at. that is instead of :
    disc_id Title theids
    101 Test 48;3;88
    they want:
    disc_id Title Theids
    101 test N33456,N3457,N43562
    so I'm kind of stuck, I can figure out how to write a sql using instr to get something like this:
    101 test N33456
    101 test N3457
    etc
    but that is not what they want. so I'm thinking I need to create a package to do this and return some sort of values. the problem is I can't figure out how I can substitute the 48;3;88 for N33456,N3457,N43562
    I'm still new at this pl/sql and apex stuff so sorry if this seems to have some obvious answer.

    I might be dense so forgive me on this, but I don't think that will solve it.
    your example uses field from apex, like :P3_SOME _VALUE
    this report screen has no fields. there are no :P#_ type values to pull. I'm writing a report screen using a report template.
    all the data I need for the report exists within the table. I just need to display it the way they want.
    I could do just a:
    select *
    from my_table
    and it would create the report just fine. the only issue is one of the columns would have 48:3:88 in the field. which to a person reading the report means little. so i have no apex fields to pull.
    I was trying to write a pl/sql function that would substitute those delimited values with meaningful data. but when I do I get multiple rows and I can't have that. so my choices so far I see are..
    1) create the report with a simple select leaving the data as is
    2) create report that has multiple rows of data where each instr value now has the correct names (some have 2 some have 5, big list to read of dups)
    3) create a package that populates a temporary table with the data I need then select on that table to get the report.
    right now I'm thinking #3 is the only way to get what I want. By the way your examples would be a great help in doing that I can already see that I can use some of them to create a temp table with that data.
    what I was hoping for was some option that I don't understand or missed that a more experienced person would know. but its looking grim.
    I thank you all the info you have given, its been a great deal of info that I can use at some point, but so far I don't think it will solve my issue.

  • 1 Conditional report based on 3 select lists/ 3 different select statements

    I have made 1 report based on the three select lists. The report is displayed in the center of the page. The user needs to fill them in order, the select lists are:
    Selectlist:
    1. P1_LOVPG - Null is allowed, but is only appearing at top with a label of Productgroup
    2. P1_LOVSG - Null is allowed, but is only appearing at top with a label of Subgroup
    3. P1_LOVMA - Null is allowed, but is only appearing at top with a label of Manufacturer
    LOVPG contains a distinct collect of the ProductGroups
    QUERY LOV = select distinct pg from X
    LOVSG contains a distinct collect of the SubGroups inside the selected PG.list
    QUERY LOV = select distinct sg from X where pg = :P1_LOVPG
    LOVMA contains a distinct collect of the Manufacturers inside the selected SG.lst
    QUERY LOV = select distinct ma from X where sg = :P_LOVSG
    Based on the the selected items the user would see the following:
    Table X
    PG SG MA ART
    A-----X----M---1
    A-----X----N---2
    A-----Y----M---3
    A-----X----M---4
    B-----X----M---5
    B-----Y----N---6
    B-----Z----O---7
    Seletion 1 PG = A -> selects PG A in select list result, User sees:
    Report A
    PG SG MA ART
    A-----X----M---1
    A-----X----N---2
    A-----Y----M---3
    A-----X----M---4
    Query would be: select * from X where PG = :P1_LOVPG
    Selection 2, user still sees the above, can only select from the SG select list NULL, X, Y. User needs to choose between X or Y value. He picks X, he sees:
    Report B
    PG SG MA ART
    A-----X----M---1
    A-----X----N---2
    A-----X----M---4
    Query would be: select * from X where PG = :P1_LOVPG and SG = :P_LOVSG
    Selection 3, user still sees selection 2 on his screen, can only select from the MA list bewteen NULL, M or N, user needs to choose between M or N. He picks M, he sees:
    Report C
    PG SG MA ART
    A-----X----M---1
    A-----X----M---4
    Query would be: select * from X where PG = :P1_LOVPG and SG = :P_LOVSG
    As you can see the query changes as the user goes deeper into the structure. It is a simple if then else system where the quey changes. How do I set this up in htmldb?
    (I've read something about Oracle's SQL and it's decode function, but can they be used with changing select statements?)

    are you sure your data meets the JOIN conditions?
    You can make a quick check.. only example...
    select single * from KONP into ls_konp
    where knumh = P_knumh.
    if sy-subrc eq 0.
    select * from from A905 into table lt_a905 where
         kappl in so_kappl
         and kschl in so_kschl
         and VKORG in so_vkorg
         and vtweg in so_vtweg
         and kondm in so_kondm
         and wkreg in so_wkreg
         and knumh = ls_konp-knumh.
    if sy-subrc eq 0.
    select * from A919 into table lt_a919
    for all entries in lt_a905
    where kappl = lt_a905-kappl
    and kschl = lt_905-kschl
    and knumh = lt_905-knumh.
    endif.
    endif.

Maybe you are looking for