Invoke Javascript alert withing a PLSQL Function Block

Hello,
I am having trouble trying to achieve the following functionality. I have a page with an update button. On submit of this update button I have created a PL/SQL Function Body which returns TRUE for CASE 1, and FALSE for CASE 2. If CASE1 is achived then the process will update the data in the underlying table and will do nothing for CASE2. What I simply want to do is for CASE2, I also want to throw up an Alert informing the user that he is in CASE2. My existing PL/SQL function looks something like:
BEGIN
IF CASE 1 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END;
I want something like:
IF CASE 1 THEN
RETURN TRUE;
ELSE
RETURN FALSE;
javascript:alert('Update did not work!');
END;
Can anybody help me?
Thanks
Mitesh

If you have submitted the page it is too late for javascript to run, javascript runs in the client, and the pl/sql runs on the server. If you want that to popup at that point you will need to have it popup on onLoad of the resulting page. Or do all of the validation in javascript then have javascript submit the page.

Similar Messages

  • Help with a PLSQL Function

    I am having problems with a SQL Function:
    CREATE OR REPLACE FUNCTION GDRREPORTS.MONTHTOTALS
    (BDate IN DATE)
    RETURN INTEGER
    AS
    ShakeCount INTEGER
    BEGIN
    ShakeCount=(Select count (distinct b.patid),
    to_char(gdrreports.To_Date_w_error (t.data), 'MON') BDay_month,
    to_char(gdrreports.To_Date_w_error (t.data), 'YYYY') BDay_year
    FROM CCI.a_patientlist p
    Inner Join CCI.PATIENTEDUCATIONNOTE_SCN_216IL b on
    b.patid=p.patid and b.tag=1789
    Inner join CCI.BIRTHDATE_519 t on
    t.patid=p.patid
    where p.unit != 'TRAIN' and p.admtime>='01JAN2011'
    and b.Data ='X'
    and to_char(gdrreports.To_Date_w_error (t.data), 'YYYY')=to_char(Bdate, 'YYYY')
    and to_char(gdrreports.To_Date_w_error (t.data), 'MON')=to_char(Bdate, 'MON'))
    RETURN ShakeCount ;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN NULL;
    END MONTHTOTALS;
    Not exactly sure what's wrong with it.
    Thank you.

    871359 wrote:
    I am having problems with a SQL Function:
    CREATE OR REPLACE FUNCTION GDRREPORTS.MONTHTOTALS
    (BDate IN DATE)
    RETURN INTEGER
    AS
    ShakeCount INTEGER
    BEGIN
    ShakeCount=(Select count (distinct b.patid),
    to_char(gdrreports.To_Date_w_error (t.data), 'MON') BDay_month,
    to_char(gdrreports.To_Date_w_error (t.data), 'YYYY') BDay_year
    FROM CCI.a_patientlist p
    Inner Join CCI.PATIENTEDUCATIONNOTE_SCN_216IL b on
    b.patid=p.patid and b.tag=1789
    Inner join CCI.BIRTHDATE_519 t on
    t.patid=p.patid
    where p.unit != 'TRAIN' and p.admtime>='01JAN2011'
    and b.Data ='X'
    and to_char(gdrreports.To_Date_w_error (t.data), 'YYYY')=to_char(Bdate, 'YYYY')
    and to_char(gdrreports.To_Date_w_error (t.data), 'MON')=to_char(Bdate, 'MON'))
    RETURN ShakeCount ;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN NULL;
    END MONTHTOTALS;
    Not exactly sure what's wrong with it.Without additional clues, we can't guess.
    It would help if you used COPY & PASTE so we can see this reported problem too.

  • How to invoke action class with in a function in jsp in struts

    ex
    if(condion)
    we have to use tag
    window.location="example.do";
    thank u
    sreevatsa adiraju

    hi,
    if that condition is like validation means, better to use client side script to execute when your condition is satisfied....
    if my above answer is not satisfied to you means,,
    post your code & ask in that...

  • SoftMotion Express VIs vs. Function Blocks

    Hi,
    Are there any differences between SoftMotion's express VIs and the function blocks? I plan to drive a servomotor via an NI 9505. The NI examples show how to use the function blocks, but I've been advised to use the Express VIs instead, to work around strange behaviour when using a simulated axis (http://forums.ni.com/t5/LabVIEW/SoftMotion-quot-Up​date-Buffer-quot-VI-refuses-to-take-more/m-p/22508​...
    Thanks!
    Solved!
    Go to Solution.

    Hi JKSH,
    If I were starting a new application, I would use Express VIs over function blocks. Here are a list of things to consider when choosing:
    By default, function blocks are asynchronous. They execute on the rising edge of the 'execute' input and are done when the 'done' output goes high. They do not block and a function block architecture will almost always involve calling the same function blocks over and over in a loop. You control the execution flow with the 'execute' and 'done' input and output. Express VIs, on the other hand, are by default synchronous. They do not have an 'execute' input and instead begin execution as soon as they are called. They also block until finished. Express VIs can be converted to asynchronous by right clicking on them and changing the 'timing model.' When you change the timing model to asynchronous, the Express VI will now act exactly like a function block.
    In general, you should never mix asynchronous and synchronous APIs. Your entire application should be one or the other. While it is possible to safely have both synchronous and asynchronous calls, you have to be very careful and really know what you're doing.
    In my experience, writing simple applications is easier with a synchronous API and more complex applications are better suited for an asynchronous API. Since synchronous calls are blocking, you need more loops in your application and it can become difficult to maintain.
    There is also the property/invoke node API, upon which both function blocks and Express VIs are built. You can right click on either a function block or Express VI and convert it to a subVI to see the underlying code. While function blocks and Express VIs can be nice to work with, sometimes you need the lower level control that is offered by the property and invoke nodes.
    I looked at your other post and it looks like you are encountering one of the subtleties of asynchronous calls. In point 1 above, I mentioned that function blocks are rising edge sensitive on the execute line. In both your modified example and the original example, the 'Update Buffer' function block is executed when the 'space available' becomes greater than or equal to the 'Size of the Contour Data.' In the original example, the table size is 40, but in your example, it is 100. Let's trace the flow through the example:
    We don't do anything in the first iteration since we don't see a rising edge on the 'execute' signal of 'Initialize Buffer' until the second iteration.
    At the beginning of the second iteration, we initialize the table with 20 points, leaving 20 spaces available. This function block may take more than one iteration to complete, so the loop may run several cycles before the 'Done' output is true. When this happens, the next block executes.
    Next we start the contour move. No point gets taken from the buffer yet; that happens in in the non user code portion of the scan.
    Next we see that there are 20 spaces available,, so we add 20 more points to the buffer, leaving us with 0 spaces available. This means that in the next iteration of the loop, the 'execute' signal of the 'Update Buffer' function block will go false. This is critical to the operation of the example. 
    Since there is no abort called, we loop back around. 
    Every scan, SoftMotion is taking one point from the buffer. Eventually, the number of points available will climb back to 20. When this happens, the 'execute' input will toggle from false to true on the 'Update Buffer' function block and 20 more points will be added to the buffer. This cycle continues until you stop.
    So what was wrong with your modification? You made the table size 100 points. If you look at the steps above, you'll see that in the example, we put 40 points into the buffer before taking any points out. If you increase the table size to 100, that means that there will be 60 spaces available. However, 60 is still greater than 'size of contour data' (which is 20) and so the 'execute' input of the 'Update Buffer' function block never goes false; we always have more space available than the 'size of contour data.' Since 'execute' is rising edge sensitive, we're never actually putting new data into the buffer and therefore you only get out the two cycles that you originally put in. I agree that this is tricky, but it is exactly as function blocks are supposed to operate and is definitely something to think about when using the asynchronous API. 
    Thanks,
    Paul B.
    Motion Control R&D

  • Plsql function error in computation

    Hi Friends,
    I have the below plsql function which is throwing error.
    The below function is written in Apex, so kindly let me know how to resolve this error
    The below query checks the existing value and if null assigns a value by select statement. else will assign it back to the variable. I am not getting how to set the value dynamically using the select statement
    Function:
    BEGIN
    IF
    :P1_VARIABLE_NAME IS NULL THEN :P1_VARIABLE_NAME:=select .... from .... (which returns a string value)
    ELSE
    :P1_VARIABLE_NAME
    END
    END
    Error:
    Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe

    Hi Kiran,
    I followed the query you mentioned and I am now getting the follwing below error:
    ORA-06550: line 7, column 3: PLS-00110: bind variable 'P1_VARIABLE_NAME' not allowed in this context ORA-06550: line 9, column 1: PLS-00103: Encountered the symbol "END" when expecting one of the following: ; The symbol ";" was substituted for "END" to continue.
    Note that I am using the PLSQL function block to fetch the data in the computation section of Apex.

  • OBIEE 11g: Dashboard not invoking simple javascript alert

    Hi Experts,
    I'm trying to invoke one simple ALERT command with javascript in obiee 11g dashboard. The purpose is when it loads, it should print one ALERT message and also when we change something in the prompt and clicking Apply button.
    Here is code written in a text item (Checked html markup option) after prompts;
    <script language="Javascript">
    alert ("Hello");
    </script>
    The Javascript alert message is showing when the dashboard page loads, but its not coming when we click the Apply button after changing the prompts.
    Can anyone give helpful hint, how to check it and why its not showing up when we press Apply button?
    Any hint or some useful links will b highly appreciated.
    Thanks in advance.

    You just used code and I would say the default event is onload of the page, thats the reason you are able to see alert.
    Since you didnt ask or written code onClick event to show alert, its not showing.
    You need to tell to browser when to prompt alert message instead of onload.
    Hope you are more confuse about 'how to do'
    if yes, mark :)
    give some more info about your actual req. that helps any other gurus to help.
    Edited by: Srini VEERAVALLI on Mar 27, 2013 8:42 AM

  • JavaScript Alert functionality in PL/SQL

    I'm in need of implementing the JavaScript "Alert" functionality (display message and wait for user to acknowledge) in the "before displaying the page" PL/SQL block of portal reports and forms. While I'm at it - How about the JavaScript "history.back" function as well?
    Is this possible? Can you point me in the right direction.

    Hi,
    Where Portal says "before displaying the page" what it means is that it will run this code before it starts to htp.p() out the HTML of the page.
    In WebDB this was actually what happened, in Portal there are some elements of HTML output BEFORE this block of code is run.
    Anyway I don't think that you can have an alert that displays before the page is loaded. The page will still show behind the alert.
    To get around this you would need a blank page to show your alert that forwards you on to the required page.
    The history function can be called by the onclick event of a button or you can access Javascript through an anchor tag:-
    link text
    Regards Michael

  • Not able to display javascript alert message from within a pl/sql block

    Hello,
    Can anyone please help me out with this issue. I wanted to display an javascript alert message from within a pl/sql block for an update button. Below is sample code which i am using. P1_ITEM is my hidden item on the report.
    begin
    if :P1_ITEM IS NOT NULL then
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Please complete the item which is already assigned to you!'');');
    HTP.p ('</script>');
    end if;
    end;
    and I have made this code to be executed conditionally when request = Expression1
    Expression1: SUBMIT
    The thing is I am not able to display an alert message when the update button is clicked.
    Can anyone please help me with this one.
    Thanks,
    Orton

    varad but I also have an update statement within that block for the update button something like this i want to achieve.
    begin
    if :P1_ITEM IS NULL THEN
    update sample_tbl
    set col1 =:APP_USER,
    col2 = 'Y'
    where pk_col = ---;
    commit;
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Successfully assigned an item!'');');
    HTP.p ('</script>');
    end if;
    if :P1_ITEM IS NOT NULL then
    HTP.p ('<script type="text/javascript">');
    HTP.p ('alert(''Please complete the item which is already assigned to you!'');');
    HTP.p ('</script>');
    end if;
    end;
    thanks,
    Orton

  • How to invoke PLSQL function result using SPEL for Rendered Property.

    Hi All
    I have requirement in Iprocurement to show a warning message in Shopping cart page when user click on the Add to Cart Button and irrespective of the warning message it should allow the user to continue to the next screen. We have 5 different stores in ShoppingHomePG and all of them lead to same screen for user date entry when we click on the store. But my requirement is to show a warning message for only one store.
    I created a TIP and showing a warning message on the screen. But this message is showing up for all the stores. I want to show only for one store.
    I have a SQL query to identify the store Name and I can return true or false value using plsql function. I am thinking there may be an option to invoke the plsql function boolean value using SPEL. Kindly suggest me how to acheive this.
    If my understanding is wrong about PL/SQL funciton with SPEL. Please point me in right direction to achive this requirement.
    OA Framework version : 11.5.10.5RUP
    Thank You!
    Krishna

    this is an error when i connect to application server by jdeveloper
    Error getting OC4J Process for: opmn-home+oc4j-test130.pythis-vpmn.com-6202-default:
    Too few bytes (7) received from OPMN response

  • Javascript alert boxes are wrapped in Windows 7 with IE 8

    I can't count the number of JavaScript alert boxes I have throughout my systems and they have always made the transition between IE browsers from 6 to 8 without a hitch.  Without a hitch until I setup my first Windows 7 machine.  It is a 64 system that has both 32 & 64 bit IE browsers.
    It doesn't matter which of the two versions I use, the JavaScript messages that I have so carefully crafted with just the proper layout are now wrapped.  The resultant text in the new W7 popups is almost unintelligible because it is so badly scrambled/wrapped on the new white background.
    Since an alert box is simplicty itself, there is no way that I can think of to change the inherent size of the box.
    Has anyone else notice this phenomena???   If so, do you have a way around it short of redoing all of the text in the effected boxes???
    Len
    XP machine's JavaScript Alert popup in IE 8
    W7 machine's JavaScript Alert popup in IE 8 with wrapped text

    HMM I have the same problem. My researches suggest that the Zone.Identifier ADS is still being used for the internet zone, but not the Intranet zone. I too can get an intranet location out of IE, but not by querying Zone.Identifier eg using Powershell. This
    issue is present in XP as well as Win 7. It appears to extend to trusted zone ids.
    One hypothesis is that this is being stored in hidden form to prevent zone ids that decrease security being applied by malware.
    I had thought that maybe the intranet zone id was only present during download - but your experiment suggests otherwise.

  • How to verify JavaScript alert message display on page with C#?

    Hi All,
    I have a question about verify the JavaScript alert message on page. For example, I input the script in browser address like: "javascript:onmouseover=alert('popup windows')" . How to verify there's a alert message displayed on page with C#?
    Thanks

    Are you trying to use some automation or ? What the previous solution is they have put the text in the dom for you to pull out with C# or other languages.
    if you are trying to automate this through a browser maybe look into WebDriver
    WebDriverWait wait = new WebDriverWait(driver, 2);
    wait.until(ExpectedConditions.alertIsPresent());
    Alert alert = driver.switchTo().alert(); var alertText = alert.Text;
    alert.accept();

  • Unexpected problem with authorization scheme of type plsql function

    Hi,
    I have created one authorization scheme of type plsql function returning boolean. Authorization scheme is for pages only. p2_user_priviledge is a textbox on home page which extract privilege (list of pagenos) for login user from database. Home page has no authorization required. AUTHORIZATION SCHEME always returns false. I am not able to trace problem in my code. same code works fine for a textbox's default returning 'c'.
    ----- CODE FOR AUTHORIZATION SCHEME------------------------------------------------------------
    declare
    pageid varchar2(10);
    privilege varchar2(300);
    c number(3);
    begin
    pageid := ':P'||to_char(:app_page_id)||':' ; ---Pageno get stored in format  *:P2:*
    privilege := trim(:p2_user_priviledge); ++------Contain list of privilege like    :P2:P13:P67:P23:  etc+++ select instr(privilege,pageid) into c from dual;
    if c>0 then
    return true;
    else
    return false;
    end if;
    end;
    One more problem is again related to authorization scheme.
    I created one application and one authorization scheme (auth_aug) which worked finely. Then after some days i added 10 more pages to same application, But now autho_aug was always returning false for new pages. So i copied code from 'autho_aug' to new scheme 'autho_sept', & it worked for new pages. I don't understand if code is same for both scheme, why required to use two different schemes.
    Now i have added few more pages to application, and facing problem mentioned earlier.
    any solution for both the problems.....

    Hi,
    Let me clear my problem once again.
    -->Home page i.e. P2 does not use authorization, So it is displayed along with text item :p2_user_privilege.
    -->Then user click on one of the links , Now page :P70: should get displayed.
    P70 is using authorization scheme.
    -->But :p2_user_priviledge value is not accessible at authorization scheme, I dont know why.
    I could not find out where to create Application item , as suggested by you.
    & not able to find Developer menu , session at home page as suggested earlier.
    And one more question, my application at runtime display
    X en us
    at bottom
    How to make it
    USER: X Language: en us
    Like in development environment.
    Hope I have cleared my problem, waiting for reply.
    Edited by: TEJU on Nov 17, 2008 9:25 AM

  • When my Firefox language settings are fr_fr or fr_ca Firefox does not display the e with acute accent character correctly when it is displayed in a javascript alert box. However, it does display it correctly when my language settings are just fr. Please t

    Firefox does not display the e with acute accent character correctly from a javascript alert box when my browser language settings are fr_ca or fr_fr. However, it does it correctly when my browser language setting is fr. How do i get it to display e with acute accent and other iso8859 characters correctly in a javascript alert box when my browser language settings are fr_fr and fr_ca?
    == This happened ==
    Every time Firefox opened

    Use Unicode (UTF-8) for those characters.
    Then you will always be sure that they are displayed correctly.

  • This message always appears: [JavaScript Application] "Error: missing } after function body" Please, i need help with this.

    A window appears with this message : [JavaScript Applicaction] Error: missing } after function body.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Read function block parameter with its object dictionary index in VC?

    How do I read  a function block parameter with its object dictionary index using NI-Fbus Communications Manager Programmer VC API?

    You can use  marco NIFB_INDEX(index) as parameter for nif_ReadObject function. The index is the relative index of the parameter in the block.
    nifError_t nifReadObject(nifDesc_t ud, NIFB_INDEX(uint32 idx), void *buffer, uint8 *length)
    Please also refer to 'NI-FBUS Hardware and Software User Manual' from Start->National Instruments->NI-FBUS->Manuals. Page 6-41 ~ Page 6-44 describe the detail information about nifReadObject() function.
    Page 6-51 ~ Page 6-52 explain the usage of marcos for processing index.
    Feilian (Vince) Shen

Maybe you are looking for

  • Startup Sound Phenomenon

    When I turn on my iMac, it plays the startup sound and repeats the first part of it, then cuts off halfway through, and does it again and again for a while until the apple logo appears, and everything else is fine. This happens mostly when I am comin

  • FOR DATE DATATYPE

    Good Morning Everyone, We only knew NVL for Number. Now, we would like to return all dates. SELECT C.START_DATE, C.END_DATE, C.CREATE_DT, C.MODIFIED_DT FROM CLASSES C WHERE C.C_ID = 31 30-JUN-00 22-DEC-07 30-FEB-10 1 row selected. Thanks in advance,

  • Insertion of user name failing in 10g--very very urgent

    Hi I have this insert statement: INSERT INTO tHistory(Client_ID,Table_Ref,Table_ID,Entry_Type,Subject,User_Name ,Parent_ID,content) VALUES( 'D5555555','tClient','D555555','edit','Edit By '||user,user,0,'test'); all fields are non nullable. However wh

  • Where do you find your iPad telephone number

    The settings disappeared?

  • Hyperion Planning : multiple hierarchies for a dimension ?

    Hi, Is it possible into planning 9.2 to manage multiple hierarchies for a dimension ? I didn't found that in the documentation but I had already listened that there is a workaround to do that. Regards