Period overlaps code not working in apex page

Hi there,
Employees have a schedule with a begin and end date. Schedule periodes may not overlap each other for the same employee.
I have a function returning error text validation as follow:
declare
l_dummy number;
begin
select  count(*)
into    l_dummy
from    fus_medewerker_roosters
where   mdr_code = :p61_mdr_code
and     id <> :p61_id
and     to_date(:p61_begin_periode,'DD-MON-YY') <= eind_periode
and     to_date(:p61_eind_periode,'DD-MOn-YY')>= begin_periode
+;+
if l_dummy > 0
then
return 'This employee already has a schedule in this periode.';
else
return null;
end if;
end;
But the code is not working. It does save data for an employee even if the periodes overlaps.
But the code works fine in workshop:
declare
l_dummy number;
begin
select  count(*)
into    l_dummy
from    fus_medewerker_roosters
where   mdr_code = :p61_mdr_code
and     id <> :p61_id
and     to_date(:p61_begin_periode,'DD-MON-YY') <= eind_periode
and     to_date(:p61_eind_periode,'DD-MOn-YY')>= begin_periode
+;+
if l_dummy > 0
then
DBMS_OUTPUT.PUT_LINE ('This employee already has a schedule in this periode.');end if;
end;
What is going wrong. Why is it working fine in workshop but not in my page?
Regards,
Diana
Edited by: dianap on Sep 4, 2009 8:31 AM

Hi Andy,
I left out the id is not :p11_id
and the code is working fine now.
I have another problem now.
The user can make a choice between a department or an employee.
The validation works fine when a schedule is given to a employee (choossing a department from the department list and a employee from the employee list)
But if the user wants to give a schedule to a department(one or more employee depending on the employees of that department) then he chooses the department from the department select list, leaving the employee select list empty. When i want to save these changes, i get a invalid number error. I tried making the validation conditional for when the employee item is null.
But still i get invalid number.
Any suggestions how i could solve this problem?
Thanks,
Diana

Similar Messages

  • Java code not working in Jsp page....

    I like to say to myself "there is no magic" when I come to a perplexing situation, today is one of those times.
    The following code when executed from the java class retrieves all the specified objects from the database and displays the requested attributes without issue:
    try {
    DBBody dbb = new DBBody();
    Entity[] allbods = dbb.retrieveAll(true);
    for(int k=0;k < allbods.length;k++) {
    Body body = (Body)allbods[k];
    System.out.println("From the dbase index position: " + k +" : " + "\n" + "Id: " + body.getId() + "\n" + "Type: " + body.getType() + "\n" + "Load: " + body.getLoad() + "\n XML:" + body.toXml() + "\n");
    dbb.close();
    } catch (Exception adb) {
    adb.printStackTrace();
    : the **exact same** code as displayed above when run in a Jsp only lists the values for the "body.getId()" and "body.getType()" methods...for a reason I can't discern, "body.getLoad()" and "body.toXml()" return empty strings in the Jsp. Everything else returns as when the code is run from the class. Both "getLoad()" and "toXml()" return strings but behind the scenes use StringBuffer objects that are converted to Strings...getId() returns an int and "getType()" returns a String also, but for whatever reason (to repeat) only those two attributes come through IN THE JSP, in the class ALL attributes are retrieved without a problem...so, what is wrong with Jsp? Java? I get no error message what so ever, just empty strings for the two specified method returns...what am I overlooking. I am running the embedded Jsp engine of the Jetty Http Server that I've incorporated into my application, which uses the latest Jsp version.
    Any help on this issue would be greatly appreciated.

    If you dont want to paste your code, then you will
    certainly not get any responses from the so called
    Java Engineers rest is left to you. We can get dukes
    elsewhere instead.
    SwarajSwaraj, I apologize if I was taken to be abrassive with my last comment, I myself am a java engineer so I have no animosity, as for your request to copy the entire code it is no longer needed I have solved the problem and the solution follows just incase anyone else runs into similar issues. It indeed had nothing to do with StringBuffer working improperly but rather it was how I was getting my dbase connection.
    As many of you who have developed applications with jdbc support to popular dbase vendors may already know, a connection must be established to the database by specifying various parameters, namely the name of the jdbc connection driver classes for the desired vendor (eg. "com.microsoft.jdbc.sqlserver.SQLServerDriver" for MS Sql Server instances) and the driver specific db connection url. Of course the driver classes must be available on the class path so that they can be accessed. Without these parameters the connection will not be initialized..well it turns out my "bug" was caused by my inadvertently ommitting the connection parameters in my Jsp, you might wonder "but you said it executed fine in the jsp except for the missing "getBody()" and "toXml()" results..how could it even execute at all if you didn't establish a connection?"
    The answer is I designed the application to use a default connection driver class (the jdbc odbc bridge driver) and a default connection url (one that is tied to my testing instance of MsSqlServer2000) it turns out that the jdbc odbc bridge is very light weight...it lacks support for certain very useful MsSql datatypes namely "ntext", I use the "ntext" type for fields that can grow to any size (stylesheet code,xml code...etc.) but the bridge driver doesn't support "ntext" BUT rather than throw an exception error like proper error handling would require it silently eats the request (very very bad) ...this exacerbated the problem I had significantly (had it thrown an error I would have known immediately that the connection was using the wrong driver and url and fixed it sooner) as it is ...I was led down blind allies thinking my code was faulty, (which it wasn't strictly speaking ..I was just missing some extra code to account for the possibility that the bridge driver is instantiated by accident) so after adding the following code above the Jsp code shown previously:
    //Configure a connection to a Microsoft Sql Database.
    DBConfig.setVendorId(DBConfig.MSSQL_VID);
    DBConfig.setDBHostId("xiassql");
    DBConfig.setDBHostPort("1433");
    DBConfig.setDBUrl(DBConfig.buildDBUrl());
    :The code worked perfectly. The "DBConfig" class does exactly that..allowing me to pass in connection attributes including the type of vendor "DBConfig.MSSQL_VID", (I have built in support for 5 popular vendors so far), the dbase host name "xiassql" and the port "1433" , then we build the url using the specified attributes and the connection is complete. After adding the code above the Jsp returned all the retrieved values perfectly. So, when testing applications that enable backend dbase connections if you get seemingly identical code behaving differently from class to Jsp, suspect an issue relating to your connection url and classes (assuming you have multiple support and a default value as I do in my app.) also any changes in the execution context from class to Jsp can cause similar errors (like not declaring the same classes at the top of the Jsp file , or less likely using an outdated Jsp engine!)
    Regards,
    PS I will take off the Duke Dollars on this question since I answered it myself!

  • Hyperlinks not working on Apex pages

    <p>I've been having a problem with hyperlinks to files on my local PC hard drive, and have reduced the issue to this: I have constructed a simple form with an HTML region that contains nothing more than a simple hyperlink:</p>
    <p><tt>&lt;a href="file:///c:\x.htm"&gt;Click&lt;/a&gt;</tt></p>
    <p>When I click on the link, nothing happens. If I create a simple test.htm (with no Apex involvement) that contains just:</p>
    <p><tt>&lt;html&gt;&lt;body&gt;<br>
    &lt;a href="file:///c:\x.htm"&gt;Click&lt;/a&gt;<br>
    &lt;/body&gt;&lt;/html&gt;</tt></p>
    <p>it works fine.</p>
    <p>I am using Oracle XE (10.2.0.1) with Apex 3.0.1 on Windows XP.</p>
    <p>I've tried various combinations of forward and back slashes, and C| instead of C: but nothing works! Any suggestions on where I'm going wrong?</p>
    Simon

    Perhaps an Internet glitch; these links all work fine for me.

  • SkillBuilders Modal Page is not working in Apex 4.2

    Hi All,
    I am trying to set up an example in apex.oracle.com of an application developed in Apex 4.1 and the SkillBuilders Modal Page plug-in is not working.
    To show this situation, I created a simplified version of the application, with only two pages, in apex.oracle.com.
    Workspace: EDIAZJORGE
    Username: TEST
    Password: test123
    Application: 66464 - Modal Page Sample
    When Page 3 loads, a Dynamic Action is executed to open Page 2 (Interactive Report) as a modal page, but it is not working (the modal page does not open).
    Please notice that this is working in Apex 4.1, and the Embed in Frames property in my application is set to Allow.
    I appreciate any help.
    Thanks,
    Erick
    Edited by: ediazjorge on Jan 30, 2013 3:20 PM
    Bump!

    Erick,
    This is due to a change that was made to the Dynamic Actions framework in 4.2. The workaround for now is to change your event to resource load on the DOM window object.
    It's working now. In the next release of the plug-in you'll be able to go back to the Page Load (ready) event.
    Regards,
    Dan
    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/

  • Oracle dbms.set_role does not work in APEX application

    Hi, in our j2ee applications, we use secure application role. Basically, the data source use the app user schema to connect to the database. the app user only has create session privileges. the database logon trigger will copy a set of attribute to the local secure context. (ip address, session user, client id, application name). The applications explicitly invoke the stored procedure sec_mgr.set_role before any DMLs are executed.
    the sec_mgr.set_role will check the local context attribute , authorize the ip, application name, and set an appreciated role to this session based on session user.
    we want to apply the same framework to the APEX application. First, we change the paring schema to the app schema which only has create session privilege. then we put the plsql code in which sec_mgr.set_role is called in the application builder --> shared components ---> edit security attribute ---> Virtual Private Database (VPD).
    however, we got the error ORA-06565: cannot execute SET ROLE from within stored procedure
    the sec_mgr.set_role is defined as invoker's right(AUTHID CURRENT_USER)
    do i missing something in APEX to get it work?
    Thanks

    Please explain it does not work in APEX? Is the application updating tables that have a trigger? APEX does NOT override trigger actions. Is it possible the values your trigger is looking for are NOT available in your APEX application? Can you post the trigger code here for review?
    Thank you,
    Tony Miller
    Webster, TX
    What if you really were stalking a paranoid schizophrenic... Would they know?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Authentication function not working in APEX but works in pl/sql

    Greetings, Jim here.
    I have written a very simple authentication funtion which uses the dbms_ldap package to authenticate using the userid and password from the login page.
    I've tested this function thru pl/sql and it returns true and false accordingly.
    I've created a custom authentication schema and in the authentication function I have return myfunction;
    The problem is, when called thru APEX, it appears to always return true and lets the login proceed, even if the password is correct. I know its using the function due to the fact that if I enter a bogus function as the authentication function, APEX spits up a message saying so.
    So, I know the function works, but I don't know why it does not work with APEX. Posting function below.
    CREATE OR REPLACE FUNCTION ODBS.CUSTAPEXLOGIN (p_username IN VARCHAR2,p_password IN VARCHAR2)
    RETURN BOOLEAN AS
    retval PLS_INTEGER;
    emp_session DBMS_LDAP.session;
    ldap_host VARCHAR2(256);
    ldap_port VARCHAR2(256);
    ldap_user VARCHAR2(256);
    ldap_passwd VARCHAR2(256);
    ldap_base VARCHAR2(256);
    BEGIN
    ldap_host := 'oraldap';
    ldap_port := '389';
    ldap_user := p_username;
    ldap_passwd := p_password;
    ldap_base := 'cn=users,dc=company,dc=com';
    emp_session := DBMS_LDAP.init(ldap_host,ldap_port);
    retval := DBMS_LDAP.simple_bind_s(emp_session,('cn=' || ldap_user || ',' || ldap_base),ldap_passwd);
    if retval = 0 then
    return true;
    else
    return false;
    end if;
    EXCEPTION
    WHEN OTHERS THEN
    begin
    if sqlcode = -31202 then
    return false;
    end if;
    end;
    END;
    /

    Hi Jim,
    Can you clarify this -
    The problem is, when called thru APEX, it appears to always return true and lets the login >proceed, even if the password is correctThat implies you're saying your authentication function ALWAYS returns true? Is that correct? Also 'even if the password is correct' doesn't read correctly to me, did you mean 'even if the password is incorrect'?
    You then say -
    now the function works, but I don't know why it does not work with APEX.So by 'does not work' you mean in APEX it is always returning true therefore allowing you to login regardless of the username/password you use? Is that correct?

  • UIComponent broadCastAction is not working in mobile page

    We are using the broadCastAction in one of our critical flows to submit to an action in Managed bean but we are facing issue in our ADF fusion web app for mobile . When we create a page with mobile render option selected the broadCastAction is not getting triggered . broadCastAction shows null in the getter of BroadCastAction.
    <tr:commandButton text="AutoSubmit" id="cb2"
    action="processResponse"
    binding="#{pageFlowScope.testBean.braodCastAction}"
    rendered="false"/>
    This is working in normal page without "render in mobile" selected , we need a solution for it to work on mobile compatible page as well

    Hi Frank
    UIComponent braodCastAction is from javax.faces.component.UIComponent . It is used to invoke action of a UI component through Java code
    if we have button like
    <tr:commandButton text="AutoSubmit" id="testCommandbtn" action="processMobile"
    binding="#{pageFlowScope.mobileBean.braodCastAction}"
    rendered="true" />
    Then through getter method of broadcastAction we can invoke the action of this button using the below code
    braodCastAction.broadcast(new ActionEvent(braodCastAction));
    This is working in the normal jspx page but not working in a page where we select render in mobile

  • Switch Theme is not working in apex 4.2.Plz  help me out.........

    Hi.......
    Switching from one theme to another theme is not working in apex 4.2..............
    Thanx in advance

    Hi!
    Same problem.
    Upgraded from 4.1 -> 4.2.
    Change theme from slightly modified Green theme (in mine case 101 is number and original was 11, One level Tabs) to Theme 25 Blue Responsive.
    Login page for instance doesn have "Login Region" for instance (not in LOV). And all pages are softly said strange.
    All have DISPLAY problem described on "http://1.bp.blogspot.com/-GzseTk6Lpes/UHvJkg9GulI/AAAAAAAAHRQ/Wt406GGZADQ/s640/Screen+Shot+2012-10-15+at+10.25.29.png", but without many parts that Dmitri describe.
    Rg
    Damir

  • Select count(*) not working in Apex

    Hello,
    The following sql works in both SQL*Plus and Toad but not in apex.  The variable seems always to be 0 no matter what data I have on the table.
    Basically I try to flip the status from "Inactive" to "Active" only when there is no "Inactive" status left on the table.  Say there are 2 inactive statuses.
    If I delete one inactive status, the overall status should still be "Inactive".  However, with this code, it flips to "Active" status regardless. 
    I tried manually assign the variable to 1 and the status was not flipped.  Therefore, it sounds to me that the count(*) is not working in APEX.
    Does anyone experience this before? 
    Thanks in advance,
    Ning
    ===================================
    DECLARE
    v_status_count NUMBER;
    BEGIN
    UPDATE LGR_APP_STATUSES
    SET DELETED = 'Y'
    WHERE LGR_APP_STATUS_ID = :P42_LGR_APP_STATUS_ID;
    commit;
    select count(LGR_STATUS_ID) into v_status_count from LGR_APP_STATUSES
    where DELETED = 'N'
    and LGR_APPLICATION_ID = :p42_application_id
    and LGR_STATUS_ID in (3,8);
    IF (v_status_count = 0) THEN
    update lgr_applications
      set lgr_application_status = 'ACTIVE'
      where LGR_APPLICATION_ID = :P42_LGR_APPLICATION_ID;
    commit;
    END IF;
    END;

    Hi,
    In query you have used p42_application_id.
    Other statements use P42_LGR_APP_STATUS_ID
    Do you have that item? What is session state for that?
    Regards,
    Jari

  • ScriptLink tag not working for application page sharepoint 2010

    <ScriptLink> tag not working for application page sharepoint 2010 for including javascript in application page, it appends either 1033 or _layout to path specified for javascript.But javascripts are located in custom document library on site and not
    in _layouts folder.
    Please help and explain in details as I tried lot on this.

    Hi,
    Use the following line of code
    <SharePoint:Scriptlink runat="server" Name="~sitecollection/Style Library/[YOUR SITE]/js/functions.js" Language="javascript" />
    Thanks,
    Vivek
    Please vote or mark your question answered, if my reply helps you

  • I wanted to send a push notification, unfortunately it does not work. The page will not load. Anyone know why?

    I wanted to send a push notification, unfortunately it does not work. The page will not load. Anyone know why?

    Push notifications, I believe, is only for iOS.
    If it is for iOS, take a look at Using Apple push notifications with Digital Publishing Suite | Adobe Developer Connection

  • When iam using jdownloader for dowload, the firefox did not work at any page, as like there in no internet conexion?

    When iam using jdownloader for dowload, the firefox did not work at any page, as like`` there in no internet conexion?``

    you need to check whether '''jdownloader''' is compatible with the Firefox version you are using.
    -> Tap ALT key or press F10 to show the Menu Bar
    -> go to Tools Menu -> Add-ons -> Extension section -> check the Status of '''jdownloader''' extension -> if '''an update''' is available for this add-on then install the update -> Restart Firefox and check again check the compatibility -> if it is '''GREYED with Exclamation mark''' then it is incompatible with Firefox
    Try using this extension to force compatibility.
    https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/
    Check and tell if its working.

  • [svn] 4323: Bug: LCDS-544 - Scenario where two components have seperate channel sets with overlapping channels not working .

    Revision: 4323
    Author: [email protected]
    Date: 2008-12-15 19:23:10 -0800 (Mon, 15 Dec 2008)
    Log Message:
    Bug: LCDS-544 - Scenario where two components have seperate channel sets with overlapping channels not working.
    QA: Yes
    Doc: No
    Checkintests Pass: Yes
    Details:
    * Hunting to a new channel within a channelset never triggered a disconnect from the previous channel(s). This isn't a problem in general, but does becomes a problem when an app defines two distinct channelsets containing at least one shared channel at the head of the list. In this case, the first channelset hunts past it and connects on a later channel. But when the second channelset hunts through (triggering a connect fault when it hits that initial shared channel that can't connect), the fault is processed by the first channelset as well (incorrectly).
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-544
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/ChannelSet.as

    Running the script by python2 solves it for me:
    su - mythtv -c "nice -n 19 python2 /usr/bin/tv_grab_nl_py --output ~/listings.xml"
    Best regards,
    Cedric

  • Interactive Reports not working with APEX listener

    Hi,
    I have posted this question APEX listener forum couple of weeks ago but very few responses.
    If any one from here can help then it would be great.
    Interactive Reports not working with APEX listener
    Best Regards,
    Baig

    Sorry for late response.
    It was a firewall issue

  • PS4 Game Voucher Code not working

    my PS4 Game Voucher Code not working and says: "The code you entered may not be correct or may no longer be valid" "Please check your entry (e-820000134)  

    Voucher codes are region-specific. For instance a US voucher won't work with a UK account. First thing to check is whether the voucher's region matches your account's region.

Maybe you are looking for