APEX LOV

Application Express 4.0
I have a tabular form with a LOV and I would like for the form to check for duplicate records. I don't want a user to select the same value from the LOV more than once. a shuttle control is not available for use and the when I try to use the validations only 2 options are available IS NOT NULL and COLUMN STRING COMPARISON. Is there something else I can use for this?

Hi,
It may depend on your LOV, but you could try something like as the SQL query for it:
SELECT DNAME d, DEPTNO r
FROM DEPT
WHERE DEPTNO NOT IN (SELECT DEPTNO FROM EMP)It's a silly example, but shows that a DEPTNO value can not be picked if it already is used on the EMP table because it is no longer displayed in the LOV
Andy

Similar Messages

  • Sql problem in apex LOV

    I am not able to use this SQL statement for apex LOV, any ideas?
    select username, id
    from abusers
    order by decode(id,0, NULL ,username) NULLS FIRST ;
    I get the following error message:
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Re: How to concatenate two sql statements?

    Hi
    Remove the semi-colon at the end.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • How to change report query dynamically in Oracle APEX?

    Hi,
    I want to dynamically change the where condition in APEX report query. Can anyone help me solve my this problem?
    (Just want to change the query which we change in Oracle Reports using lexical parameter to change &Where, &Order by etc. dynamically!!)
    Thanks, Praful

    Hi
    I've been using flexible queries in APEX for a few years now, and your question just added a whole new dimension to the flexible and powerful nature or writing reports in APEX.
    While APEX Interactive reporting has almost completely removed the need the equivalent of Lexicals in Oracle Reports, I thought it might be fun to try and use lexicals in an APEX report.
    Before we start I should summarise the powerful capability of APEX reporting to have oprtional parameters (lots and lots of them if this is needed).
    For each parameter, you simply add a page item which will hold the value of the parameter.
    The item/parameter can be populated by typing in the value, defining an LOV, using a date-picker etc.
    To make the parameter optional simply use an OR in the where clause.
    So for a apge item P200_PARAM1.....include
    WHERE (:P200_PARAM1 IS NULL
    OR COLUMN1 = :P200_PARAM1)
    This way you can either leave the page item null or type in / select a value from a LOV.
    There is a small quirk in APEX LOV's which sometimes returns a value of '%' or '%null%' - depending on the version - when no value is selected.
    See Patrick Wolf's solution for this at Re: Null value handling in LOVs
    I include this Application Process in all my APEX applications ;)
    Now let's look at using the equivalent of Oracle Reports Lexicals......
    First-off - this is based on the APEX SQL report - NOT Interactive Report.
    It relies on the fact that you can let the query be parsed only at runtime.
    1. Define an SQL report entering the 'core' of your query.
    With a query like SELECT ENAME, JOB FROM EMP
    Select 'Generic Columns' option in the 'Column Headings' section
    Finish the report creation
    2. Define a page item - say P200_LEXICAL - type text on the page
    3. Edit the report and update the SQL query to include your lexical page item
    SELECT ENAME, JOB FROM EMP &P200_LEXICAL. (REMEMBER THE '.' AT THE END)
    Ensure that the option "Use Generic Column Names (parse query at runtime only)" is selected at the bottom of the query
    4. Add a button to the page -using 'Create a button displayed among this region's items' the will submit the page.
    5. Run the page - you will see all the employee names and job desdriptions
    6. Enter a where clause into the 'Lexical' textbox - say "WHERE ENAME LIKE 'K%'" and click the 'Go' button
    Voila! your where clause is magically applied.
    Try any variant you like adding an ORDER BY clause etc...... this is FUN!
    7. Clear the value of the LEXICAL and click go.
    Edit the report and move the &P200_LEXICAL. into the selected columns (or add another one)
    SELECT ENAME, JOB &P200_LEXICAL. FROM EMP
    8. Run the page
    Enter ",SAL" in the textbox and "Go"
    We can add as many columns as we like (subject to the "Maximum number of generic report columns:" set below the SQL query in the report edit section)
    Now because we have all the flexibility in APEX of setting page items using SQL or PLSQL you can set the value of the lexical programatically, or just pre-set a few values in an LOV - the options are limitless.
    While I've never had the need to use lexicals - you can see that APEX provides the most Flexible Lexicals in town.
    Eat your heart out "Oracle Reports"!!!
    Have fun
    Mike

  • Jquery in Apex!!

    Hi All,
    In my application i had implmented free text Jquery concept, in order to have a better performnace wise.
    After the implmentaion i am facing the follwoing issues.
    1. In Apex LOV we can use dipsplay value and return value.
    2.But in Jquery do we the feasibility to use display value and Return value.
    3.Since i am uisng the autocomplete functionality free text in jquery it will allow us only to have dsiplay value and how we can use the return value for the same.
    4. Please let me know so that i can post my source code which i had done for my implemantaion process!!
    Thanks,
    Anoo..

    Anoo wrote:
    the version i am uisng is 3.0 apex I can't see mention of this in your original question.
    See if one of these helps:
    http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:359800346619312
    http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:127800346959520

  • Using a variable db link for an interactive report

    I have a requirement where users will select an instance (db link) from an apex LOV and the data in an interactive report will query based on the db link selected.
    I can use a db link in an interactive report query but only if I provide the exact name of the link. If I do something link select * from foo@:P12_DBLINK it doesn't work.
    It seems my only option is to use something like apex_collection.create_collection_from_query and then I can build my query with dynamic sql and use a variable for the dblink name. Then I just create an IRR based on my collection.
    Does that sound like that correct approach and/or am I missing anything?
    Any suggestions are most appreciated,
    john

    I guess I have it working ok. I am able to create a region of type 'PL/SQL Dynamic Content' and do something like this and it works. As I change the dblink select list the report refreshes with data from that instance. Pretty cool! I just can't believe it's this much work to do this. This is just one column of data and I have about 10 columns that I need to display:
    declare
    type array_t is varray(100) of number;
    array array_t;
    l_sql varchar2(4000);
    begin
    l_sql := 'SELECT credit_card_trxn_id FROM EXM_CREDIT_CARD_TRXNS@'||:P4_DBLINK;
    execute immediate l_sql BULK COLLECT INTO array;
    for i IN 1..array.count
    LOOP
    HTP.p (array(i));
    HTP.br;
    END LOOP;
    end;

  • Popup to popup to main page?

    I don't know if this is possible or not so I thought I'd ask here.
    is it possible to create a popup lov that when you select the value you want it opens another popup lov to choose that is based on the return of the first lov. then when you choose what your looking for it returns the final selection back to the home page?
    the first lov popup would be a static list of values, when a user chooses it the new popup happens and uses the static value as the where clause in the next popup.
    its hard to explain but is it possible? and if its not clear let me know and I'll try to explain it better.

    Yes, it is possible, but probably not using the Apex LOV framework..
    If I were doing it, I would create a simple page with no or a custom page template.
    I would have two report regions on the page-
    The first report would be a basic list, your LOV as it were, and then make the column clickable (A link column).
    The second report would be driven by the first one, only displaying when one of the values in the first report is clicked on.
    Make the values on the second report clickable too, except they would execute a bit of javascript to populate the item on the calling page.

  • Can Autocomplete return different (PK) column

    hi @all,
    to achieve autocomplete / autosuggest i use denes great example [Ajax Autocomplete|http://htmldb.oracle.com/pls/otn/f?p=31517:53:5080202988387359::NO] (thanks for that denes)
    but, as usual, my customer wants an additional feature:
    after using autocomplete for the column ename on the table emp he/she wants the value of the column empno to be returned into another page item. quite similiar to the behavior of the standard APEX LOV
    i already looked through the functions of "textfield_autofilter.js"; but didn't find an easy solution.
    any ideas are welcome.
    regards
    peter

    no answers :-(

  • Popup LOV returns not found on this server after upgrading to APEX 3.2

    The Popup Key LOV (Displays description, returns key value) does not work after upgrading to APEX 3.2 from APEX 3.0.
    Don't now if the character set is relevant.
    The database character set on APEX 3.0 was:
    NLS_CHARACTERSET: WE8MSWIN1252
    DAD CHARACTERSET: WINDOWS-1252
    APEX 3.2:
    NLS_CHARACTERSET:     AL32UTF8
    DAD CHARACTERSET:     UTF-8
    When clicking on the popup the message is "The requested URL /pls/apex31mb/wwv_flow_utilities.gen_popup_list was not found on this server.".
    This error applies for both Firefox and IE.

    Can't reproduce the error on apex.oracle.com, the popup works fine.
    The only difference I notice on the environments is the database version (our: 10g, oracle.apex.com: 11g), but I can't see this have any influence.

  • How to Create a Page LOV Template and a Region LOV Report Template in APEX

    Hi All,
    Thanks in advance ..
    I am new to APEX , Currently working in APEX 3.2
    Can any one please guide me How to Create a Page LOV Template and a Region LOV Report Template in APEX
    So that I can create dynamic Multi column LOV in APEX
    Cheers
    Sachin

    Sachin,
    I think you are en-quiring about 'Custom pop-up page'. See this link. You will get all required info there.
    Regards,
    Hari

  • Cascade LOV in Apex 4.0

    Hello Apex Fun
    how can i make cascade list of value in Apex 4.0 ? i tried cascade which enabled in list of item properties but contain problems , please help me
    also when use that cascade the Arabic characters shown unclear ..
    Edited by: Moh Loay on Aug 24, 2010 2:46 PM

    Hi Moh Loay,
    I think you have to help me with that one, because I tried to reproduce that on apex.oracle.com and was not able to.
    1) I have created page http://apex.oracle.com/pls/apex/f?p=47158:22 which is a cascading LOV on the tables DEPARTMENTS and EMPLOYEES.
    2) For Department "Construction" I modified some of the employees to contain arabic and chinese characters
    3) I executed above page
    4) Changed the department to "Construction" which refreshed the employees select list
    5) Opened the Employees select list and everything shows up as I have entered it.
    Can you please verify with the above page that it looks good for you as well. Maybe it's an operating system/browser issue?
    If the above test case works for you, can you please create a test case with your failing data on apex.oracle.com so that I can have a look what's actually wrong. After you have done that, please provide the workspace, user and password so that I can access your application.
    Thanks
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Resetting a Form with Cascading LOVs (Apex 4)

    A standard reset button cannot reset cascading LOVs properly. Let's assume we have a parent LOV and a child LOV. When one changes the selection in the child LOV, reset can undo this. But when he changes the selection in the parent LOV, reset will undo only the parent LOV but not the child LOV. The child LOV remains unchanged (however the selection is lost) and therefore shows a list that does not correspond to the entry now shown in the parent LOV.
    Has anybody found a solution for this, a reset action that can reset cascading LOVs completely and properly?
    Regards
    Roland

    Roland,
    i didn't try this myself but maybe you succeed with triggering the onchange-event of your parent-select-list (this should cause the child select-list to be refreshed).
    Or you could try if a form region has a apex "refresh" event (i know that refresh works on reports).
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Apex 3.1 2 and popup lov

    I had Popup Key LOV (Displays description, returns key value) in older version of application (Apex 3.0) and it was working fine. Now, when I imported aplication in new version it is not working.
    In textbox where it is showing selected value is OK, but when I open POPup window there are no values in it.
    Best regards,
    Daniela

    Hi,
    you could create a second directory on the server and a matching alias in the dads.conf file and name it /i402/ (instead of the old /i/).
    Then you install APEX 4.0.2 and specify /i402/ as image directory name when calling the installation script. If you already installed APEX 4 you can use a script named reset_image_prefix.sql to change the images directory used by the APEX Builder Applications.
    For your created Applications simply set the image directory prefix in the Application Definition Page to /i402/ and you are good to go.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Apex 3.1.2, unable to use cascaded lovs

    Hi all,
    am using apex 3.1.2
    trying to use cascaded select lists.
    but when trying it, am not able to do it.
    it was working fine till two days back.
    two items,
    1) p14_soft
    select distinct SOFTWARE display_value, SOFTWARE return_value
    from REQUEST_TYPE
    order by 1
    display as : select list
    on changing soft need to populate problem type.
    2) p14_prob
    select REQUEST display_value, REQUEST return_value
    from REQUEST_TYPE
    where upper(software) = upper(:P14_SOFT)
    order by 1
    display as : select list
    i cannt use display as : select list with redirect.
    do i need to use any java scripts for the same ???
    any help..,
    regards,
    littlefoot
    Edited by: Little Foot on Jun 26, 2012 11:00 PM

    Welcome to Oracle Forums !
    Please acquaint yourself with the FAQs , if you have not done so already.
    When posting take care of the following:
    <ul>
    <li>Post you Apex version</li>
    <li>DB edition and version</li>
    <li>Webserver beng used</li>
    </ul>
    Other norms to follow:
    a. Never highjack someone else's thread. Start your own if you have a question
    b. Mark responses Helpful/ Correct, as the case may be
    Responding because this is your first post.
    >
    I followed the example at the link you've posted here but couldn't make it work for me. I would really appreciate if you could answer the following 2 questions regarding the same example.
    (1) In the cursors inside the 2 application processes, I'm not fetching anything that's of type number. In that case, what should I change the following line to:
    HTP.prn ('<option value="' || c.empno || '">' || c.ename || '</option>');
    From what I understand, the <b>"c.empname" in the above line has to be of type number</b>. However, the table I'm querying doesn't have anything of type number.
    >
    Not sure why you started thinking that c.empname has to be number. In fact, it is not a number but a string. And so is the attribute value. The value attribute is the return value while the text in the tag, c.ename, is the display value ,
    See http://www.w3schools.com/tags/att_option_value.asp
    >
    (2) Do the cursors in the 2 applications processes have to be the exact same replicas of the definitions of the 2 select lists? That's how it looks like from the example:
    Select List 2 Definition:
    SELECT ename d, empno r
    FROM (SELECT ename, empno, deptno
    FROM emp
    WHERE empno IN (SELECT mgr
    FROM emp))
    WHERE deptno = :p119_deptno
    Cursor in CASCADING_SELECT_LIST1:
    SELECT ename, empno
    FROM (SELECT ename, empno, deptno
    FROM emp
    WHERE empno IN (SELECT mgr
    FROM emp))
    WHERE deptno = :cascading_selectlist_item_1
    >
    The example has *3* select lists. The first, top level parent, is defined as a normal LoV on the Page. Only the child and grand child are created through application processes.
    The second select list, CASCADING_SELECT_LIST1, is related to the Dept LoV on the page (Top level).
    WHERE deptno = :cascading_selectlist_item_1The above line makes the second LoV dependent / child of Dept LoV.
    The use of empno and ename in this example occurs twice because and employee and the manager are both in the same table. This is just incidental in the example and must not be construed to mean anything more. The only relevant thing for cascading is
    WHERE mgr = :cascading_selectlist_item_2The above makes the 3rd LoV the Child of the 2nd LoV.

  • How to prevent apex 4.0 shuttle cleared by cascading LOV setting?

    I have a shuttle control for choosing a list of database users populated from a child table by an On Load - After Header process, which then repopulates the child table in an On Submit - After Computations and Validations process. Work fine.
    I then set the shuttle's Cascading LOV Parent Item(s) to a text item that could be used for filtering the shuttle's LOV, and revised the LOV SQL to a) use the filter and b) include items stored in the child table, i.e.:
    select username as dv, username as rv
    from all_users
    where username like upper(:P5_USERSFILTER) || '%'
    union
    select username, username
    from user_grouping_users
    where groupid = :P5_GROUPID
    order by 1
    Unfortunately, when the filter value changes (P5_USERSFILTER), the state of shuttle (as set in my On Load - After Header process) is cleared. The values from the child table are properly included in the LOV, but they are no longer selected -- so the appear in the left-hand list as candidate values but not in the right-hand list as selected values. Additionally, any items selected in the shuttle before changing the value of the LOV Parent (:P5_USERSFILTER) are no longer selected.
    Is there a way to prevent the selections of a Cascading LOV item from being cleared when the parent item is reset?
    Note, I've specified 'No' for Optimize Refresh, and 'P5_USERS' for Page Items to Submit and 'Yes' for Display Extra Values (which in general does not seem to have any affect on a shuttle LOV)

    Hallo all!
    I got a similar situation: a text item that filters the left side of an shuttle item (P11_IAG_ENUM), but the right side should stay the same - independet from the text item, where search-phrases are entered.
    So I tired with your example - thanks for that - but I changed the code that I only have one collection 'P11_IAG_VALUES' ... but right side seems to be still dependend from the search item. I also deleted the "set value" action of the "save current selection"-dynamic-action, because I supposed it's not needed.
    Here is my "save current selection"-dynamic-action:
    DECLARE
    c_collection CONSTANT VARCHAR2(30) := 'P11_IAG_VALUES';
    l_seq_id NUMBER;
    BEGIN
    IF NOT apex_collection.collection_exists(c_collection) THEN
    apex_collection.create_collection(c_collection);
    END IF;
    SELECT MIN(seq_id)
    INTO l_seq_id
    FROM apex_collections
    WHERE collection_name = c_collection
    IF l_seq_id IS NULL THEN
    apex_collection.add_member (
    p_collection_name => c_collection,
    p_c001 => :P11_IAG_ENUM );
    ELSE
    apex_collection.update_member (
    p_collection_name => c_collection,
    p_seq => l_seq_id,
    p_c001 => :P11_IAG_ENUM );
    END IF;
    COMMIT;
    END;
    ... and the "restore old selection"-dynamic-action:
    DECLARE
    l_selected_iag VARCHAR2(32767);
    BEGIN
    SELECT c001
    INTO l_selected_iag
    FROM apex_collections
    WHERE collection_name='P11_IAG_VALUES'
    RETURN l_selected_iag;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
    RETURN NULL;
    END;
    Where is my error in reasoning?
    (Meanwhile I try to create an example application...)
    [Edit: I got problems to acces my workspace, try to reset my password --> error, even try to find my workspace -->error .... everytime the same; I'll try it later again, but hoping that anyone can help me without example application]
    Edited by: kc7 on 10.09.2010 09:20
    [Edit II: I finally created a example-application: *http://apex.oracle.com/pls/apex/f?p=30216*
    workspace: kc7
    user: dummy
    pwd: doll
    Edited by: kc7 on 10.09.2010 12:28

  • LOV with PL/SQL in APEX 4.0

    I want to create a LOV in APEX 4.0 with the help of PL/SQL block,but when I am pasting my PL/SQL block code in the List Of Values area and try to run it, it is showing me error "Rendering Page ITEM F300_P1510_PROJECT_TASK raised the following error: ORA-20001: Query must begin with SELECT or WITH" where F300_P1510_PROJECT_TASK is my LOV name.
    Please help me how to fix this.

    Hi,
    The way to do this that comes to mind, and I know it works because I have done it, is rather long and uses Ajax
    1. Create an On Demand Application Process that returns this as a string
    <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    </optgroup>
    <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
    </optgroup>2. Write a javascript function (HTML Header) that will
    a. Make an Ajax call to the Application Process in step 1
    b. replace the options in the select tag with the result of the ajax call
    3. Call the js function in step 2 using onload from HTML Body Attribute.
    The pure SQL PL/SQL way would be as follows:
    a. Create a PIPELINED function that returns the display, return pairs of values
    b. Use the above function in SELECT in the LOV
    Maybe there is a simpler way, but it eludes me.
    Regards,
    Edited by: Prabodh on Aug 20, 2010 4:23 PM

Maybe you are looking for

  • Why does my Safari, Chrome, and Firefox crash?

    Hi everyone, I have been searching through the forums trying to find a problem like this that has been solved but I've been without luck so I'll try posting instead. Sorry if I don't provide all the correct data, I'm trying to do this on my desktop b

  • Can I have multiple iTunes accounts sharing the one library?

    And if so how?

  • Error on Setup of Reader XI

    While downloading Reader XI, I received an error: Setup has detected that you already have a more functional product installed. Setup terminated. What is happening that it does not installed??

  • ALE DEBMAS Tax Jurisdiction

    Hi experts, We are in the process of ALEing some ~10,000 customers from one system to another, using the standard DEBMAS messaging type.  When doing so, we find some IDOCs failing to process on the inbound side due to the tax jurisdiction not being s

  • Why do i need a recovery pass to sync my bookmarks??????

    I need to use my bookmarks, even if i don't have my PC close to me. It's totally pointless to impose to all users the recovery key system. I don't need full encrypted data, i need fast and easy access!!!!!! I need my bookmarks accessible to me everyw