Execute Javascript via PL/SQL

Hello

I'm trying to run a simple js in plsql exactly as in the link here, but I don't know where I'm going wrong it does not work for me, doing exactly the same thing by putting the code in DA plsql type and running when you click the button.

Denes Kubicek ApEx BLOG: Run Javascript via PL/SQL

where iam going bad? the alert doesn't popup but ik fixed all syntax errors

what I did:

================================

create DA on click the button, and then set it to run when the page loads

Code:

v_todayVARCHAR2 (200);

v_emp_count NUMBER;

BEGIN

SELECT COUNT (*)

IN v_emp_count
EMP;

because loop me in 1.10

v_today: = TO_CHAR (SYSDATE, "dd.mm.yyyy hh24:mi:ss");

HTP.p ("< script type =" text/javascript"> '");

HTP.p (' alert (""is today"))

|| I have | » '|| v_today
|| '.\n'
|| "He must."
|| v_emp_count
|| ' employees in your emp table. \n"
|| "This is an alert generated by a PL/SQL block \n".
|| "(l'exécution de code javascript!'');" );
END loop;

HTP.p ("< /script >");

end;

any help?

concerning

Hello

Gor_Mahia wrote:

you're right, I know / 3.2, we had no DA, but if I run it as a plsql code type DA or plsql process page it should work I don't see that as a problem in this case, no?

Dene example idea is JavaScript print while the page is loading. Then he will be executed.

When you print out the script tag after the page is rendered using the DA, it won't work not and not executed. That's how work browsers.

You should also read the comments of this blog post from Dene.

What iam trying to do is nothing special, just trying to execute this code example as it is?

You try to simply approach quite wrong.

Kind regards

Jari

Tags: Database

Similar Questions

  • Create jobs and positions via PL/SQL script

    Hi, it is recommended to insert new jobs and positions via PL/SQL Script?

    I know it's possible, I'm not sure if it is recommended. especially when it's via a direct insertion.

    Is there an API for it?

    I have about 200 + positions I need to set in our Instance of the EBS Test.

    Thank you!

    The APIs are the best way to do it in batches of charges-

    Job: HR_JOB_API

    Position: HR_POSITION_API

    To know that all the seeds API, add the responsibility of integrated SOA gateway

  • JavaScript for loop to execute Advanced Actions - execute Javascript does not?

    I use a loop to check the value of a Cookie.  When I add this using Execute Javascript it works fine but I want to run with certain other actions, if I want to use Of execute advanced Actions. When I add this coded to an action to run Javascript in the breast to perform advanced Actions code disappeared if I open the Script window again once.  I try to remove the code for loop in bold below and then the remaining code remains.  So I think that the problem must be with the loop for, but I don't see anything wrong with this code and I have, as I said that this code works fine if I use Javascript to run on its own. I've attached a video clip below to show what I mean.

    var task1_value = readCookie ("task1");

    function readCookie (name) {}

    var nameEQ = name + '=';

    var CA = document.cookie.split(';');

    for (var i = 0; i < ca.length; i ++) {}

    var c = ca [i];

    even if (c.charAt (0) ==' ') c = c.substring(1,c.length);

    If (c.indexOf (nameEQ) == 0) return c.substring (nameEQ.length, c.length);

    }

    Returns a null value.

    }

    I found that window JavaScript of CP does not like loops.

    Your best bet is to put the function in an external JS file from the top of the page. I always run scripts in an external file. Really helps debug that you do not have to republish Captivate. Just change your code and refresh the browser. If you use external file you can store all your functions there.

    I would also look into using the local storage instead of cookies. Very easy to implement and you can store a ton of information.

    Local storage - dive into HTML5

  • Make the HTML via PL/SQL code

    How can I get a file via PL/SQL porgram .html.

    You can use TEXT_IO built - in the opening and drop package
    and use the HTML tag
    and tag/html to open and station as

    declare
    sFile text_io.file_type;
    Start
    sFile:=TEXT_IO.fopen('D:\ss\ss','rw");
    TEXT_IO.put_line (sFile, e');
    TEXT_IO.put_line (sfile, '<-------------->');
    TEXT_IO.put_line (sFile, e');
    end;

  • error in reading the response soap via pl/sql

    I try to call one served web via pl/sql. You can see the answer below;

    < h4 > < SOAP - ENV:Envelope xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >
    < SOAP - ENV:Body >
    < ns1:duyuruSorgulamaResponse SOAP - ENV:encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1 = "WsDuyuruSorgulama" >
    < back xsi: type = "xsd: String" > <! [CDATA [<? xml version = "1.0" encoding = "iso-8859-9"? > < XmlString > < SONUC > 1 < / SONUC > < DURUM > 0 < / HARD wheat > < ACIKLAMA > duyuruSorgulama:BASARILI ISLEM < / ACIKLAMA > < TRXNO > 0 < / TRXNO > < DUYURUADET > 0 < / DUYURUADET > < ADSOYAD > Asd Hhhhhh < / ADSOYAD > < REFNO > < / REFNO > < KUPONKAYITLILIKMESAJ > < / KUPONKAYITLILIKMESAJ > < DUYURULIST > < / DUYURULIST > < CEKILISDUYURULIST > < / CEKILISDUYURULIST]] [[> < / XmlString >]] > < / return >
    < / ns1:duyuruSorgulamaResponse >
    < / SOAP - ENV:Body >
    < / SOAP - ENV:Envelope > < / h4 >

    That's how I try to read the application

    < h4 >
    RESP XMLType.
    resp: = resp.extract('/SOAP-ENV:Envelope/SOAP-ENV:Body/child::node () '
    , ' xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/".
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    container = "http://www.w3.org/2001/XMLSchema" '
    );

    resp: = resp.extract ('ns1:duyuruSorgulamaResponse / text () ',' xmlns:ns1 = "WsDuyuruSorgulama" '); < / h4 >


    I'm getting "ORA-30625: shipping on NULL SELF argument method is not allowed" error. I did not understand how the xmltype.extract function works.

    Thank you

    Hello

    This part returns an empty document because you left out the "back" element in the XPath expression:

    resp:= resp.extract('ns1:duyuruSorgulamaResponse/text()','xmlns:ns1="WsDuyuruSorgulama"'); 
    

    I think that, here, extractValue function can better suit your need:

    DECLARE
     resp xmltype :=
     xmltype(
    '
    
    
    
    10duyuruSorgulama:BASARILI ISLEM00Asd Hhhhhh ]]>
    
    
    
    '
     );
    
     xmldoc VARCHAR2(500);
    
    BEGIN
    
     SELECT extractValue(resp,
                         '/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:duyuruSorgulamaResponse/return',
                         'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/", xmlns:ns1="WsDuyuruSorgulama"')
     INTO xmldoc
     FROM dual;
    
     dbms_output.put_line(xmldoc);
    
    END;
    /
    

    Output =.

    10duyuruSorgulama:BASARILI ISLEM00Asd Hhhhhh 
    
  • Set the 'Not available' application via the SQL statement

    Hi, I am trying to automate the deployment of applications and wonder if anyone knows how I could define the "Unavailable" via a SQL script application. In the views of the APEX_030200 scheme, there is a view called "APEX_APPLICATIONS" with "AVAILABILITY_STATUS" and "UNAVAILABLE_TEXT" columns What I want to do is to run a statement that sets the 'Not AVAILABLE' application before you run the import script.
    Thanks, J

    Hello:

    You can use the 'wwv_flow_api' to set the State of the application

    DECLARE
    ws_id number;
    BEGIN
    select max( workspace_id) into ws_id from apex_applications ;
    wwv_flow_api.set_security_group_id(ws_id);
    
    wwv_flow_api.set_flow_status (
        p_flow_id => :app_id,
        p_flow_status => 'UNAVAILABLE',
        p_flow_status_message  =>'Application being updated...')
        ;
    end;
    

    The valid values for p_flow_status are
    'AVAILABLE. '
    "AVAILABLE_W_EDIT_LINK,"
    "AVAILABLE_W_INLINE_EDIT,"
    "DEVELOPERS_ONLY,"
    "UNAVAILABLE_URL,"
    "UNAVAILABLE_PLSQL,"
    "RESTRICTED_ACCESS,"
    "UNAVAILABLE".

    CITY

  • execute the block via file sql plsql

    Hi all

    I'm trying to run under plsql block by putting in a sql file and run it as (-oradb/BDC/oracle/OracleHomes/db/111/bin/sqlplus cpa@bdcd/cpa @/ apps/bkrdlr/interface_programs/IDSI_apply_rec_H_apply_test.sql--) but for some reason his hanging in there any idea what I'm doing wrong here. These sql statements are run very well when I run by physically logging in. appreciate your help. Thank you
    set serveroutput on;
    DECLARE
    x NUMBER(10):=0;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('Loading A0 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_A0;
    DBMS_OUTPUT.PUT_LINE('total records fetched from A0: ' || x);
    
    DBMS_OUTPUT.PUT_LINE('Loading D1 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_D1;
    DBMS_OUTPUT.PUT_LINE('total records fetched from D1: ' || x);
    
    DBMS_OUTPUT.PUT_LINE('Loading D2 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_D2;
    DBMS_OUTPUT.PUT_LINE('total records fetched from D2: ' || x);
    
    DBMS_OUTPUT.PUT_LINE('Loading B0 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_B0;
    DBMS_OUTPUT.PUT_LINE('total records fetched from B0: ' || x);
    
    DBMS_OUTPUT.PUT_LINE('Loading B2 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_B2;
    DBMS_OUTPUT.PUT_LINE('total records fetched from B2: ' || x);
    
    DBMS_OUTPUT.PUT_LINE('Loading M0 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_M0;
    DBMS_OUTPUT.PUT_LINE('total records fetched from M0: ' || x);
    
    DBMS_OUTPUT.PUT_LINE('Loading M2 Records');
    x:=cms_idsi_prices_pkg.fn_upd_idsi_prices_from_M2;
    DBMS_OUTPUT.PUT_LINE('total records fetched from M2: ' || x);
    END;
    commit;
    exit
    Hanging out:
    $ /oradb/BDC/oracle/OracleHomes/db/111/bin/sqlplus cpa@bdcd/cpa @/apps/bkrdlr/interface_programs/IDSI_apply_rec_H_apply_test.sql
    
    SQL*Plus: Release 11.1.0.7.0 - Production on Mon Mar 7 10:48:41 2011
    
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    
     34
    expected results (ran the connection manually)
    SQL> /
    Loading A0 Records
    total records fetched from A0: 4253
    Loading D1 Records
    total records fetched from D1: 4253
    Loading D2 Records
    total records fetched from D2: 4253
    Loading B0 Records
    total records fetched from B0: 2853
    Loading B2 Records
    total records fetched from B2: 2799
    Loading M0 Records
    total records fetched from M0: 0
    Loading M2 Records
    total records fetched from M2: 96
    
    PL/SQL procedure successfully completed.

    Try to make / issue;

  • Call the Javascript htmldb_delete_message PL/SQL procedure

    Hi guys,.

    I am a novice when it comes to JavaScript; I've written a PL/SQL procedure that removes multiple records based on a primary key:

    PROCEDURE clear_alterations (p_eco IN VARCHAR2)
    IS
    BEGIN
    DELETE FROM xxmel_apex_eco_alterations
    WHERE the eco = p_eco;
    END clear_alterations;

    I can run it directly from a normal button, but I want the pop htmldb_delete_message dialog box to confirm whether to delete or not. When the user clicks "OK" I want the file to delete and cancel, do nothing.

    I have managed to get the confirmation box appears, but cannot see how to call the PLSQL based on the OK"" button.

    Any help would be great,
    Thank you
    Chris

    Hello

    Set your target URL button

    javascript:confirmDelete('Delete record?','DELETE_REC');
    

    Then create processes that call your procedure and define the process conditional request DELETE_REC

    Kind regards
    Jari

  • Executes JavaScript &gt; &gt; Goto URL?

    Hello

    Is it possible to do a javascript button in Configurator 1.0 (CS4), which opens the default browser and the user to a certain homepage?

    Thank you, Brian

    Customize these lines with your group name:

    var strPlugInsFolderDirectory = locate ('e $$$/LocalizedFilenames.xml/SourceDirectoryName/id/Extras/[LOCALE]/[LOCALE]_Plug-ins/valu plugins =");

    var htmlFileName = app.path.toString () + "/" + strPlugInsFolderDirectory + "/ panels/Panel name/content/index.html;

    Leader (htmlFileName). Execute();

    and then prepare a file index.html with the link to the web address to open

    (must have html page as the code to refresh itself the opening) and save it in the content of your exported Panel folder

  • Application of CF to execute the WORK of SQL 2 k?

    Hi all

    I would like to create an application to perform an MS SQL Job.

    The job is in-Server-Management-SQL Server Agent------jobs.

    II he had to connect from a desktop users, ask them to click on a button and execute SQL TASK.

    Has anyone done this?  Any information would be helpful.

    Thank you

    TJones

    You can use the procedure sp_start_job to start work
    http://msdn.Microsoft.com/en-us/library/aa260289 (SQL.80) .aspx

    To call a stored procedure in CF use the CFSTOREDPROC tag.

  • Dashboard OBIEE - JavaScript - get the SQL logic

    Hi Experts,

    I have the dashboard with an OBIEE report and dashboard invites. So, whenever I change the values in the prompt lines in the report to amend accordingly. I hope that the sql logic changes also to the selection, I do on the dashboard page.

    I want to take this logical sql update. I knew that we can write the javaScript function in the municipality. JS file and then call this function in the dashboard. But I want to know how I can get the update sql logic.

    Any help or inputs would be appreciated.


    Thanks and greetings
    S

    Hi Siva,

    Sorry about that last post. I did not properly escape all my special characters and the Forum diverted.

    I have corrected the errors and again tested the code. Works fine on IE and Moilla.

    Give it another shot.

    -Joe

  • What is the correct syntax to execute a procedure for SQL workshop

    I have a procedure that I want to test in the workshop of SQL in the APEX. He has an argument, but I don't know the syntax to include the argument. I put

    begin download_attached_files;
    end;

    How can I manually assign a number to this procedure?
    (IE it does not work):
    Start download_attached_files = 43; end ;)

    Hello

    Try:

    BEGIN
     EXECUTE download_attached_files(43);
    END;
    

    Andy

  • EXECUTE IMMEDIATE and multiple SQL

    Hello
    I get a string, say strSQL from an application.
    for example:

    strSQL: = "CREATE UNIQUE INDEX 'WEBDBTARGET'". "" PK_EMPID6"ON"WEBDBTARGET ". "" EMP_R1 "("EMPID")
    PCTFREE, INITRANS 10 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "TARGET_TS_01";

    CREATING INDEX 'WEBDBTARGET '. "' MARK ' ON 'WEBDBTARGET '. "" EMP_R1 "("EMPNAME")
    PCTFREE, INITRANS 10 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE «TARGET_TS_01 "«;»

    I tried to run the strSQL using EXECUTE IMMEDIATE

    get the error
    * "PLS-00103: encountered the symbol"end-of-file"when it is waiting for one of the following values: *"
    *; < an ID > < a between double quote delimited identifiers of > *.
    * The symbol ";" was replaced by "end-of-file" continue. » *

    I understand that the question is after the first SQL.
    How to use EXECUTE IMMEDIATE if the input string contains multiple SQL?
    Help, please.

    TIA,
    Newbie

    user570138 wrote:
    strSQL: = "CREATE UNIQUE INDEX 'WEBDBTARGET'". "" PK_EMPID6"ON"WEBDBTARGET ". "" EMP_R1 "("EMPID")
    PCTFREE, INITRANS 10 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "TARGET_TS_01";

    CREATING INDEX 'WEBDBTARGET '. "' MARK ' ON 'WEBDBTARGET '. "" EMP_R1 "("EMPNAME")
    PCTFREE, INITRANS 10 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE 'TARGET_TS_01"';'

    You have extra quote (marked in red). But remove won't solve all of your problems. EXECUTE IMMEDIATE executes a SQL statement. You must divide in two strSQL:

    strSQL:=' CREATE UNIQUE INDEX "WEBDBTARGET"."PK_EMPID6" ON "WEBDBTARGET"."EMP_R1" ("EMPID")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "TARGET_TS_01"';
    EXECUTE IMMEDIATE strSQL;
    CREATE INDEX "WEBDBTARGET"."SDSDSD" ON "WEBDBTARGET"."EMP_R1" ("EMPNAME")
    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "TARGET_TS_01"';
    EXECUTE IMMEDIATE strSQL;
    

    SY.
    P.S. in the majority of cases it IT not a good design of database to create objects dynamically.

  • Creating external Tables using the EXECUTE IMMEDIATE in PL/SQL

    Hi guys,.

    I am trying to create an external Table using the EXECUTE IMMEDIATE in a procedure and I managed to compile and no errors were generated. But when I try to run it from sql using the exec command I get the following error:

    ------------------------------------------------------------------------
    ERROR on line 5:
    ORA-00911: invalid character
    ORA-06512: at "GEO. TEST_DDL', line 4
    ORA-06512: at line 5

    -------------------------------------------------------------------------

    I tried to check the whole statement to create the external table, but I can't find where is the error. Surprisingly, if I simply run the command table create external on sqlplus it works, but not a procedure.

    If anyone can help with ideas or experience?

    Geoffrey Kossami

    The error means that there is an identifier somewhere that starts with a nonalphanumeric. This is a typical mistake of editing. A procedure compiles correctly is not of course because the underlying dynamic sql running is OK. Which of course only be resolved when you try to run it.

    There is certainly a problem with the text you provide to be run as a piece of dynamic sql code. You should try to watch it with dbms_output and run this code in sqlplus. But your problem is with the code you run as dynamic PL/SQL, it is not itself compilable.

    Jack

  • How to install JavaScript via Firefox?

    Many sites say that my JavaScript is not enabled. How can I find the Tools section? Thank you.

    JavaScript is installed and enabled by default on Firefox for Android.

    You have installed extensions such as noscript? What are the websites you run into that?

Maybe you are looking for

  • Firefox supports AutoComplete?

    Firefox supports AutoComplete? Such as name, address, email, etc.

  • HP Firebird 802 LED lighting

    Long ago, I was able to change the color of my LED on my HP Firebird 802 desktop until I updated something. I downloaded the application of "HP Firebird ESA System Tools" which adds a section to the NVIDIA Control Panel to control the color of the LE

  • HP G2: Error hard drive check

    I have failure ID GGDL90-0007PU-MFGJL1-60AV03 Product ID: G8R97AV That means for me? What do I do now? Help

  • All my ICON Office descriptions are changed to white lettering with blue background. How can I change this back?

    All my ICON Office descriptions are changed to white lettering with blue background. Don't know how it happened. I would like to have black letters with NO background (background right). How can I make changes?

  • Question of WVC2300

    I think to buy some WVC2300 for my house.  However, I can't find the camera can achieve what I'm looking for. Is it possible for the WVC2300 take a snapshot (high quality jpeg image) and upload it to a FTP site server every 30 seconds or more? If so,