Javascript in pl sql

I have a problem
I have a biometric code in javascript. This code is verifying between two textarea temp but I need this code is verifying between the input data temp in a textarea with the field in my database. How include this code in my apex aplicacion express. How manipulate the biometric code in javascript with my database
please help me
thanks

This forum is for SQL and PL/SQL, what you are asking about is neither ... in the Oracle Database not in Application Express which has its own forum.
Please go back in to your original post and change the subject to "Please Ignore."
Then find the correct forum for your question by reviewing the forum's contents and post there. Thank you.

Similar Messages

  • Javascript with PL/Sql

    Hi everyone,
    I want to know if it's a good idea to use javascript with PL/sql using HTML-DB (PL) (enabled and disabled button) ?
    Thank you very much. Bye.
    Eric

    I would suggest you pay attention to the base directory where the relative paths for @src and @href make pertinent value pointing to the desired resource.

  • Alert javascript in PL/SQL procedure

    Hello,
    On clicking on a button to execute an sql command, If I test a value=0, so I would like to show a message like alert("Impossible to do that !");
    Is it possible ?
    Here is my very simple PL/SQL procedure :
    declare
    nbwo number(10);
    begin
    select count(*) into nbwo from [email protected] where lticketid=:P63_lticketid;
    if nbwo > 0 then
    update [email protected] set etat=1 where lticketid=:P63_lticketid;
    commit;
    else
    "Show a javascript alert"
    end if;
    end;
    Thanks for help,
    Fred

    Fred,
    If you are rendering a page you can make a plsql process generate html that the browser can display. htp.p(' html here');
    declare
    nbwo number(10);
    begin
    select count(*) into nbwo from [email protected] where lticketid=:P63_lticketid;
    if nbwo > 0 then
    update [email protected] set etat=1 where lticketid=:P63_lticketid;
    commit;
    else
    htp.p(' html here');
    end if;
    end;
    However I can see you having some issues.
    1: You need to call a page and have this process run while the page renders. It won't work for a submit process. It is still possible.
    2: You need to decide what to do with the page you are rendering. You could render the page as normal and just pop this html code in before the footer.
    Probably the best bet is to do this with an ajax call. eg press button, call jscript function, jscript function calls database to do this work, database call returns a success or fail message. Display results to user.
    I would recommend the ajax call. It works very well for this type of thing.
    Chris

  • Embedding javascript in a sql query

    Hello everybody,
    that is the question, how can a JavaScript function like: getElementById
    can be (if at all be embedded in a sql query? the thing is that when I do the query
    SELECT firstname, lastname etc
    WHERE branchnumber = here is where I want to include the javascript function so that it gets the value from a manually inserted value in a text field that the user enters.
    the item name is P3_X (which is a textfield)
    I would like to put something like
    WHERE branchnumber = getElementById('P3_X').value);
    but it does not parse it ..
    so I may be close but there is something that is not right

    Thank you for your good will Mennam from Turkey. I have found another way of solving it, in the data expresss edition each item you create carries the name you give it, then you make a reference to it on your SQL query, that item can be a combo box, a text field, etc any means for the user to enter data. that works fine.a reference as easy as this one: WHERE ( bookings.branchnumber = :PTEXT )
    Alvaro

  • Javascript in pl/sql process block

    Hi,
    Can someone please tell me why this code is not working.....
    I have put this in my pl/sql process....
    htp.p('<script language=javascript>');
    htp.p('var r=confirm("This is a duplicate record , do you want to proceed?");');
    htp.p('if (r==true)');
    htp.p('{document.wwv_flow.submit();}');
    htp.p('else{ }');
    htp.p('</script>');
    Please help
    thanks and regards,
    deepa

    What you need, in your case, is the reverse approach
    – calling PL/SQL from JavaScript code – which is
    possible, using AJAX...
    It seems like what you are trying to do is a
    validation process. Pressing the button should fire a
    JavaScript code, which in turn will fire an on-demand
    PL/SQL procedure, and according to the returned
    results will display a confirm dialog boxHi Arie,
    This is exactly what I am struggling to do, but I don't think is working...is there a good example somewhere, with good documentation saying what goes where? I've tried looking at Carl's On-Demand page example and I just can't tell if I'm following it correctly.
    Based on what is entered in P4_PROJECT_NUM, I need to verify that the value isn't already in the database when the user tabs out of the field.
    My javascript for page 4 (in HTML Header):
    function checkCO()
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=validate_value',4);
    get.add('ID', $x('P4_PROJECT_NUM').value)
    gReturn = get.get();
    if(gReturn) // if function return true
    alert($x('P4_PROJECT_NUM').value + ' already exists in database.');
    get = null;
    //-->
    </script>
    My onDemand process, from the Application Processes:
    declare
    v_count number;
    cursor cr_check_co is
    select count(*)
    from usd_changeorders
    where chg_ref_num = v('ID');
    begin
    open cr_check_co;
    fetch cr_check_co into v_count;
    close cr_check_co;
    if (nvl(v_count, 0) = 0) then
    return true;
    else
    return false;
    end if;
    end;
    I am calling the javascript from the onBlur event of the field I want verified.
    I am getting an alert, but it is displaying every time, whether the value is valid or not.
    Can you tell me what I am doing wrong?
    Thanks!!
    Janel

  • Dynamically create javascripts using pl/sql code from page header

    I understand by placing a javascript code in the page header is one of the way adding javascript functionality to your pages.
    But lets say I need (dynamically) bring my javascripts into the page header using my pl/sql package/functions like core_func_jscript_pkg.get_jscript('jf_isnumber');
    1- How can I call my pl/sql package/functions from page header area of Apex?
    If I need to use 20 javascripts functions into a page which I have them stored in database (using them on my other pages) and I don't want to copy or re-write them in Apex, instead I like to have 20 line of calls to my pl/sql package like:
    core_func_jscript_pkg.get_jscript('myFirstJavascript');
    core_func_jscript_pkg.get_jscript('mySecondJavascript');
    core_func_jscript_pkg.get_jscript('myThirdJavascript');
    core_func_jscript_pkg.get_jscript('myFourthJavascript');
    ... and so on.
    2- In past we wrote our web apps using pl/sql example:
    htp.p('<html>');
    htp.p('<head>');
    core_func_jscript_pkg.get_jscript('jf_get_today_date');
    core_func_jscript_pkg.get_jscript('someothe_scripts');
    htp.p('</head>');
    htp.p('</html>');
    I like to do the same thing in Apex, Can I accomplish this in Apex?
    Thanks again
    -iahmadi

    There was a <head> content & dynamic metadata with APEX? that should provide some pointers.

  • Javascript usage with sql

    Hi,
    I need to know how to use the javascript with sql to insert update and delete operation
    Need more explanation
    Help me

    user8818950  wrote:
    Hi,
    I need to know how to use the javascript with sql to insert update and delete operation
    Need more explanation
    Help meThen you should perhaps ask on a Javascript forum as that's a javascript question you're asking, not an SQL or PL/SQL question.

  • JavaScript equivalent of SQL in

    Hi all,
    I do not know where to ask this question, but I am trying to write a javasctript for my dynamic action.
    Now I have to check a variable for values and I do it like this:
    if ($v("APEX_ITEM") == 1 && $v("APEX_ITEM")==2) { ....}
    In SQL I would write:
    apex_item in (1,2)
    Is there something like that for Javascript because I have a list of ten id's.
    Thank you.
    Raoul

    You could use indexOf, but that doesn't work in IE.
    Try this:
    var list = [ "1", "2", "3", "4"];
    alert(jQuery.inArray( "3", list ));  //this will return 2
    alert(jQuery.inArray( "5", list )); //this will return -1
    If the element is not in list, inArray will return -1. So basically, you need to check if the returned value is -1 (the element is not in list) or greater (the element is in list).

  • Calling JavaScript from a SQL report?

    I am using the HTMLDB_ITEM api's to build my report. I am trying to render a text item and append an image / hyperlink to the end of my textbox which links to a custom popup page.
    I have all this working but I need to use a JavaScript call html_GetElement to pass into the URL I am building in the link.
    e.g.
    This query works fine and my popup page fires passing the value 'ABC' into the element P323_PIN on the popup page 323.
    <br><br>
    SELECT HTMLDB_ITEM.text (01, NULL, 10, 25)
    ||
    '<ah ref="javascript:html_PopUp(''f?p=&APP_ID.:323:&APP_SESSION.::::P323_PIN:ABCD'');
    ">Link</a>' pin
    FROM DUAL;
    <br><br>
    PS the hyperlink tag has been broken so it will display in the forum.
    <p>I would link to replace this with the value (if any) that the user types into the textbox (01).
    Any suggestions as I cannot seem to concatanate the right value into my url string. I think it is due to the quotes but I cant see the wood for the trees at the moment.
    Regards
    Duncan
    Message was edited by:
    Duncs

    If the at line selections is getting fired then just use this option to call the url,
    REPORT  zkb_test4.
    DATA: v_str(60) TYPE c.
    AT LINE-SELECTION.
      DATA: v_url TYPE string.
      v_url = v_str.
      CALL METHOD cl_gui_frontend_services=>execute
        EXPORTING
          document               = v_url
        EXCEPTIONS
          cntl_error             = 1
          error_no_gui           = 2
          bad_parameter          = 3
          file_not_found         = 4
          path_not_found         = 5
          file_extension_unknown = 6
          error_execute_failed   = 7
          synchronous_failed     = 8
          not_supported_by_gui   = 9
          OTHERS                 = 10.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    START-OF-SELECTION.
      v_str = 'http://sap.com'.
      WRITE / v_str.
      HIDE v_str.
    Regards
    Kathirvel

  • Use javascript value in SQL report

    Hello,
    I'm trying to do a report that must use the windows username as a filter. Something like
    select *
    from audit
    where username = WINDOWS_USERNAME.
    I have this code that retrieves it from the system
    <script language="Javascript">
    var WshNetwork = new ActiveXObject("WScript.Network");
    var userName;
    function getUsername(){
    userName = WshNetwork.UserName;
    return userName;
    Does anyone know how can I use it?
    Another possibility is having a application item that is populated in the onLoad event. Help please!

    I'm going to show you how I implemented my solution:
    I have in the login page a html region with the following code:
    <script language="Javascript">
    var WshNetwork = new ActiveXObject("WScript.Network");
    html_GetElement('P111_USERNAME').value = WshNetwork.UserName;
    document.write('<b>'+html_GetElement('P111_USERNAME').value+'</b>
    </script>When the user clicks the button I have a computation that sets a application item with the value of the P111_USERNAME hidden field.
    In all the others pages I reference the application item and it has the correct value.
    Your errors should be because you are declaring the ActiveX object outside the function. Or it's just a security limitation of your IE.
    Message was edited by:
    Reise

  • Javascript embedded in button pl/sql event handler not being executed

    Javascript calls not working from pl/sql button event handler. What am I missing? Are specific settings needed to execute javascript from pl/sql proceedures?
    Example: Want to toggle target='_blank' off and on in a button pl/sql event handler to open url call in new window & then reset when processing submit is done & the app returns to the form.
    portal form button's pl/sql submit handler:
    begin
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    htp.p('<script language=JavaScript>') ;
    htp.p('this.form.target="_blank"') ;
    htp.p('</script>') ;
    end ;
    Putting the following in the button's javascript on_click event handler works great:
    this.form.target='_blank'
    to force opening new window with a call in the button's submit pl/sql code via:
    PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
    but then the target='_blank' is left on when the submit is done & we return to the form.
    putting the above javascript as a function (called fcn_newpage) elsewhere (e.g., after form opens) & calling in the submit pl/sql with
    htp.p('fcn_newpage') ;
    also doesn't work.
    Metalink thought this was an application issue instead of a bug, so thought I'd see if anyone knows what's going wrong here. (Portal 9.0.4.1)

    thanks for your discussion of my post.
    Please clarify:
    "htp.p('fcn_newwindow') sends a string":
    What would you suggest the proper syntax for a function fcn_newwindow() call from a pl/sql javascript block that differs from
    htp.p('<script language="Javascript">') ;
    htp.p('fcn_newwindow');
    htp.p('</script>');
    or more simply
    htp.p('fcn_newwindow') ;
    More generally, what I'm trying to figure out is under what conditions javascript is executed, if ever, in the pl/sql of a button (either the submit or custom event handler, depending on the button).
    I've seen lots of posts asking how to do a simple htp.p('alert("THIS IS TROUBLE")') ; in a pl/sql event handler for a button on a form, but no description of how this can be done successfully.
    In addition to alerts, in my case, I'd like to call a javascript fcn from a pl/sql event handle that would pass a URL (e.g., http://www.oracle.com) where the javascript fcn executed
    window.open(URL). The API call to set_target(URL) in pl/sql has no ability to open in a new window, so calling that is inadequate to my needs and I must resort to javascript.
    Its clear in the PL/SQL of a button, you can effect form components since p_session..set_target & p_session.get_target set or get the contents of form components.
    So to see if javascript ever works, I tried to focus on something simple that only had to set what amounts to an enviromental variable when we returned to the form after a post. I chose to try to change the html value of TARGET from javascript in the PL/SQL button because it doesn't need to be implemented until we finish the post and return to the form.
    So I focused on a hack, setting this.form.TARGET='_blank' in the on_click event handler that forced every subsequent URL call or refresh of the form to be a new window. I then wanted to turn off opening new windows once I'd opened the URL call in a new window by setting TARGET='' in the portal form. I can achieve what I want by coding this.form.TARGET='' in the javascript (on_focus, on_change, or on_mousedown, ...) of every form component that might refresh the form. However, that is a ridiculous hack when a simple htp.p('<script>') ; htp.p('this.form.target=""') ; htp.p('</script>') ; at the end of the button's pl/sql event handle should do the same thing reliably if javascript ever works in the pl/sql event handler.
    If we didn't have access to form components through p_session calls, I'd assume it was a scope issue (what is available from the pl/sql event handler). But unless my syntax is just off, when, if ever, can javascript be used in a portal form's pl/sql event handler for a button?
    if I code a javascript funtion in the forms' pl/sql before displaying form:
    htp.p('<script language="JavaScript">') ;
    htp.p('function fcn_new_window(URL)') ;
    htp.p('window.open(URL)' ) ;
    htp.p('</script>') ;
    the function can be called from a button's on_click javascript event handler:
    fcn_new_window('http://www.oracle.com')
    but from the same button's pl/sql submit event handler this call doesn't work: htp.p('fcn_new_window("http://www.oracle.com")')
    So my questions remain: Is there other syntax I need, or does javascript ever work properly from the pl/sql of a form button's event handler? If it doesn't work, isn't this a bug that should be fixed by Oracle?
    I can probably figure out hacks to make things work the way I need, but executing javascript from pl/sql event handlers seems to be the expected way to affect portal html pages (forms, reports, ...) and it seems not to work as expected. I don't feel I should have to implement hacks for something as simple as calling a javascript function from pl/sql when almost every example I've found in metalink or the forums or Oracle Press's "portal bible" suggests using javascript from pl/sql via the utility htp.p() to effect web page components in portal.
    My TAR on the subject, while still open, returned the result basically: "We can reproduce your situation. Everything looks okay to us, but we can't explain how to use javascript where you want or point you to any documentation that would solve your problem or expain why it should not work the way you want it to. We don't feel its a technical issue. Why don't you post the problem on the portal applications forum."
    I'm hoping I'm just missing something fundamental and everything will work if I implement it a little differently. So if anyone sees my error, please let me know.
    by the way, not sure this is germain, but in reference to your comment:
    "redirections in pl/sql procedures give a peculiar result. in a pl/sql procedure, usually, portals give the last redirection statement and ignore anything else coming after it."
    if I try to raise an alert:
    htp.p('alert("you screwed up")');
    return;
    in a pl/sql event handler, it still doesn't raise the alert, even though its the last thing implemented in the event handler. But if I set the value of a text box using p_session..set_value_as_string() at the same spot, it correctly sets the text box value when I return to the form.

  • JavaScript and SQL

    Helo Everyone,
    I am writing a PL/SQL package, dealing with names and IDs. The names in the database are:
    Farhan
    John
    Jack
    Mary
    Mary #1
    Mary #2 I am using Javascript to write SQL strings that are used for queries. I have a name variable in Javascript that is used to store the names from the databse. First, I retrieved the names by:
    Select name from Friends; then, I used bulk collect to stores the names into a variable. On my display, I have a list (a textarea) where you can click on the name and it uses that specified name for the Javascript variable. My query is something like:
    "Select *" + " from Friends" +st1+ " where name =variable";When I click on the names Farhan, John, Jack , and Mary my query works and the right results are displayed on the screen.
    But when I choose Mary #1 or Mary #2 from my textarea, no results are displayed on the screen eventhough Mary #1 and
    Mary #2 are valid names in the database.
    I am thinking that Javascript has a problem when passing the # to SQL strings. Is there any way around this problem?

    The alert shows the following:
    select * from Names where id in ('Mary #2') I am using a variable called nameid, which I pass in the query so this is my Javascript string:
    query:= 'select *' +
                ' from Names'+
                ' where id in ("+nameid+")";
    {code}
    I select the names from a textarea and any name with the # sign in it doesn't work. The other names without the # sign works fine.
    Also, I ran the query separately and all of them works (even those that have # signs in it). It just doesn t work with JS.
    Any ideas??                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Converting HTML parameters values to PL/SQL varibales

    I am using HTML/JavaScript in PL/SQL cartridge. Is there any method of converting the values in HTML/JavaScript to PL/SQL variables?
    eg : <input type="hidden" name="p_emp_code" value="'||p_emp_code||'" >
    Can I convert p_emp_code to a PL/SQL variable?

    I am using HTML/JavaScript in PL/SQL cartridge. Is there any method of converting the values in HTML/JavaScript to PL/SQL variables?
    eg : <input type="hidden" name="p_emp_code" value="'||p_emp_code||'" >
    Can I convert p_emp_code to a PL/SQL variable?

  • PL/SQL Utility for Sanitizing HTML User Input

    I would like to allow my users to include a limited set of HTML tags in there text input. Does anyone have a PL/SQL utility they would be willing to share that scans a string and "sanitizes" it by escaping tags that do not belong to a set of programmer defined set of allowed tags? Something like what is mentioned in this post for Ruby: http://ideoplex.com/id/1138/sanitize-html-in-ruby.
    Any related suggestions or techniques are much appreciated!
    Thanks,
    Bill

    Hello,
    My currently limited knowledge of APEX makes me think that this should be done using Javascript, called from the PL/SQL area. Assuming that you know a little about javascript, and that you are using a html form for input, you can insert some javascript to do the encoding. Here is some information on how to call a javascript from PL/SQL:
    http://apexwonder.blogspot.com/2007/10/apex-plsql-html-javascript-part-2.html
    Also, check this site for some information on javascript encoding:
    http://www.yuki-onna.co.uk/html/encode.html
    Cheers
    Jason

  • LOVs and JavaScript

    Hi,
    I am trying to use LOVs created with Portal Application inside PL/SQL PDK created portlets.
    Anybody has done that?
    Also, is there a way to use JavaScript with PL/SQL PDK?
    I saw this call inside portal geberated html:
    PORTAL30.wwv_javascript.fetch_script?p_name=genlist_popup
    anybody knows how to generate it in custom portlets?
    Thank you

    Yuri,
    One of the features of the OWA toolkit is the htp package. The htp packages is used to create html from plsql. There are two procedures that you can use.
    1. htp.script
    prints html tags for a macro scripting lanugage such as JavaScript, VBScript, etc. It takes in: cscript, clanguage.
    Take a look at the package for more info.
    2. htp.p
    If you use procedure "p" you can insert html tags into your plsql code by placing the tags in quotes...
    htp.p('<script language="Javascript" src="http://test.js"></script>');
    Hope this helps,
    Sue

Maybe you are looking for

  • Recent Safari 1.3.2 Problems

    On one of my Mac's, I am still running Mac OX 10.3.9 and, consequently, have Safari 1.3.2. Recently (in the last 3-4 months) I have been starting to see some problems. Most notably, Google Maps no longer works and trying it results in Safari crashing

  • Horrible, screeching noise when i plug nano into my car's auxiliary

    Thats right...the auxiliary......with which my 160 gig classic has no problem whatsoever in playback, seems to like to cause mayhem when it is my nano who is feeding it. I know there are a couple of threads on this....but.... twas never resolved. Go

  • Calling one component from other

    Hi,    I want to call a portal component,with in the event handling routine of cellClick. Actually what I need is,in cellClickEvent method,I need to store the clicked value in session and then redirect it to another component based on the clicked val

  • I need help on the Sound Blaster Audig

    I just got the sound Blaster Audigy 4 and installed it on a Dell computer. The receiver that comes with the card worked fine with the media center the first time it is installed but after that the red LED light comes on instead of blinking when the r

  • Where are all the UME actions and UME roles stored?

    Hi there, I had a look at the SAP<SID>DB.UME* tables, it seems to me that they are not stored there. What I wanted to achieve is to build a list of all user, user to role assignment, all UME actions, and role to action assignment so that we can do so