Call a procedure from javascript
HelloI would like to help on the following please.
I have a JavaScript in page region 'function and Global Variable declaration ':
function openUrl(pUrl) {
window.open(pUrl,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=1024, height=768");
}
In the same page one have a number of standard reports. A number of columns in each of these reports sets a link. The binding for all the columns settings are defined as follows:Target: URL
URL: javascript:openUrl('http://#SERVERNAME#:9704/xmlpserver/Publications/Dock_Report.xdo?_xpf=&_xpt=0&_xdo=%2FPublications%2FDock_Report.xdo&_xmode=4&_paramsID_USU=#ID_USU#&_paramsIDCR=#IDCR#&_paramsIDCU=#IDCU#&_xt=DPol_Layout&_xf=pdf&_xautorun=true');
As you see, the user of the application, click on the link on the column of the report and a popup is generated showing the report. It all works very well.My requirement is to call a procedure from the augments that are included in the column link that was clicked by the user of the application.
#ID_USU#
#IDCR#
#IDCU#
My question is how to achieve this as the url is inside a call to javascript?Can I use the Javascritp set in the page to extract the details, and then use javascript to call a procedure?
Any help, pointers, ideas, everything is welcome.
Request Express 4.0.2.00.07
Thank you
Published by: zooid on 4 April 2013 22:47
Have you seen this javascript API? http://docs.Oracle.com/CD/E17556_01/doc/apirefs.40/e15519/javascript_api.htm#BGBJHEHG
It has very convenient function: apex.submit (pOptions);
Specify the target URL as:
JavaScript:rowClick('#ID_USU#',_'#IDCRM#',_'#IDCU#');
Then add a function to your page somewhere:
function rowClick(idUsu, idcrm idcu){
openUrl(/*url*/);
apex.submit({request: "SOME_REQUEST_VALUE", set: {Px_ID_USU: idUsu, Px_IDCRM: idcrm, Px_IDCU: idcu}});
}
(Where you have page elements for each of the items that you want to set.
Then you can have a process of PL/SQL page, under condition of request = expression 1, term 1 = SOME_REQUEST_VALUE
And do you want to ;-)
Tags: Database
Similar Questions
-
call PL/SQL procedure from javascript
Hello!
How can I call PL/SQL procedure from JavaScript code?
Thank you!
NihadNihad,
What APEX version do you use? Dynamic actions in 4.0 make is much easier than it was in previous versions of APEX...
Kind regards
Dan -
Calling a procedure from a form of Oracle database
Hello
I have a question, we will be calling the procedure from a form of Oracle, and through that we can spend as input values from 1000 to this procedure and that we must return values back to the Oracle form also. Here the damaged take two or more parameters. Please advice.
To receive the input values, we have the input parameter of the procedure as a type object, so that we can receive several parameter values.
Thanks and greetings
Srinivasuser2626293 wrote:
Hi François,Thanks for your response, please suggest me as to how we can achieve the passage of the parameters that can contain multiple values, by a call to the procedure of the form of the Oracle database
Hi Srinivas,
Here is an example of how...
CREATE OR REPLACE PROCEDURE P_GET_SAL (P_EMPID NUMBER, P_SAL OUT NUMBER) IS BEGIN SELECT SALARY INTO P_SAL FROM EMPLOYEE WHERE EMPLOYEE_ID=P_EMPID; END; SQL> VAR G_SAL NUMBER; SQL> EXEC P_GET_SAL(100,:G_SAL); PL/SQL procedure successfully completed. SQL> PRINT G_SAL; G_SAL ---------- 2300
Hope this helps
Hamid
If someone answer is useful or appropriate, please mark accordingly. *
-
Huh? Or, call a procedure from a dynamic page portlet
I have a procedure which returns the number of records in a table. Works very well.
I want to call this procedure from a dynamic page portlet in Oracle portal.
Here is (close to the) the content of the page:
< HTML >
< TITLE > example < /title >
< ORACLE >
HTP. P (SCHEMANAME. PROCEDURENAME());
< / ORACLE >
< / BODY >
< / HTML >
I get an error
ORA-00900 invalid sql statement.
Could not be parsed as portal_app - HTP. P (SCHEMANAME. PROCEDURENAME()); WWV-08300
(The procedure has been granted execute privileges to the public and anonymous.)So, it is a FUNCTION and not a PROCEDURE that you are trying to call from a dynamic page? Then try something like the following:
DECLARE v_test VARCHAR2(4000); BEGIN v_test := SCHEMA.FUNCTION(); htp.p(v_test); END; -
calling a method from javascript bean
Hi forum,
I was wondering if it is possible to call a method of bean managed from javascript. Why do I need it? Because I want to implement a simple javascript and light confirm dialogue resulting (Y or N) determines if the call or not a method that could achieve a vo. To be more precise, I hava a table only reading and I want to give the user the option to select a single line and remove it without taking to another page but confirming a javascript dialog box.
Thank you very much in advance.
AlbertoYes,
.. You should forget about it. 10.1.3 doesn't have a callback method in controlled beans. In theory, you can create a filter for the faces servlet and pass a parameter of specific application as a flag with the request, so the filter can attempt to access the bean managed and put some information below. However, on the client side you would issue such a XMLHttpRequest
Frank
-
Cannot call the functions from Javascript using ExternalInterface
Hi all, I use external Interface to call Javascript in an HTML document with an embedded flash object, but I can't call functions in the flash JavaScript object.
JavaScript:
function call_actionscript {}
If (document.getElementById ('flashObj')) {}
Alert ('object flash found.');
document.getElementById('flash2').test_from_javascript ();
}
}
ActionScript:
package {}
import flash.display.MovieClip;
to import flash.external.ExternalInterface;
import flash.events.Event;
SerializableAttribute public class extends MovieClip {} FlashObj
public void FlashObj() {}
ExternalInterface.addCallback("IsStatic",IsStatic) ('test_from_javascript', test_from_javascript)
}
public void test_from_javascript(e:Event):void {}
ExternalInterface.call("saveglobalscore",score) ("alert", "javascript test received in actionscript!")
}
}
}
Call the "call_actionscript()" javascript function produces no result. Call Test_from_javascript() manually to code Actionscript product alert "javascript test has received in actionscript!" without problem. So the ExternalInterface.call("saveglobalscore",score) method works fine, but the the ExternalInterface.addCallback("IsStatic",IsStatic) doesn't seem to work at all. What I'm missing here?Try to change/add the JS in your HTML code to the following.
TS
-
How to call the stored procedure from javascript? (Google suggest, AJAX)
Hi I want to set up a text field so that it behaves like [Google Suggest | http://www.google.com/webhp?complete=1 & hl = en].
I read this post .
Now, I installed everything according to this document. But it simply doesn't. And I don't know why.
I think that problems can fall into the following three categories:
1. the text field and the page invoking the appropriate javascript?
2 - is the JavaScript call the stored procedure?
3. the stored procedure correctly returns the result formatted?
I'm assertive for 1 and 3, but I'm not sure 2. Because I don't know how if a stored procedure has been called? Is there a PL/SQL statement that I can query in SQL * more?
Also, I would like to know how to debug AJAX in the APEX. It involves a lot of things.
Finally, I used APEX 3.2 and Oracle XE. I can't find file dads.conf or marvel.conf. Is ' / apex / "the virtual directory for APEX?
Thank you very much!Buffalo,
I managed to make it work on XE with APEX 3.2!
It took more time than expected because my XE installation was still on an earlier version of the Apex and I had put it first...But that's what I did:
-in the ac.js file, I changed the path ' / apex / "and I added the ac.js file to my candidacy as a static file. So as you did.
-J' copied my request to the XE and copied my procedure on the schema that is related to my request
-J' gave to run anonymous rights my procedureNow at first, it did not work...
Then I suddenly remembered something: If you want to run a procedure through the pl/sql gateway in the XE, XE please how it is.
Do you this by changing the APEX_030200.wwv_flow_epg_include_mod_local function!This is the code for the function changed for my example:
CREATE OR REPLACE function APEX_030200.wwv_flow_epg_include_mod_local( procedure_name in varchar2) return boolean is begin --return false; -- remove this statement when you modify this function -- -- Administrator note: the procedure_name input parameter may be in the format: -- -- procedure -- schema.procedure -- package.procedure -- schema.package.procedure -- -- If the expected input parameter is a procedure name only, the IN list code shown below -- can be modified to itemize the expected procedure names. Otherwise you must parse the -- procedure_name parameter and replace the simple code below with code that will evaluate -- all of the cases listed above. -- if upper(procedure_name) in ( 'MATTHIASH.INCSEARCH') then return TRUE; else return FALSE; end if; end wwv_flow_epg_include_mod_local; /
After that, the AJAX function worked as expected...
HTH
Matthias HoysPublished by: mhoys on August 13, 2009 15:24
-
A simple way to call PL/SQL from javascript?
Hello
I have a page with 2 fields and a button. In both areas, the user put 2 different customer numbers and when they click the button must call a PL/SQL procedure that will merge the customer News #1 in the #2 client.
I would like to show the user a before confirmation dialog box accepts eventually merge the two clients.
How can I do?
Thanks in advance...AJAX is fine if you don't need to refresh the page, but if you just need a simple process you can build as simply a page process runs under condition based on a certain application (such as FUSION). Then have your button call the javascript and call doSubmit in it - as follows:
You put the code above in the header, and then set the redirect URL on your button to call:
javascript:merge();
-
Cannot call function AS3 from JavaScript
Hello
I am trying to call a function in ActionScript 3 with JavaScript. The problem that I can't get one of the browsers to trigger this AS3 function. Debuggers to say that the function is not defined when I call on the flash object.
What is supposed to happen is - the javascript function calls the AS3 function and passes an integer value. This integer is then used to remove one of the 20 funds sovereigns and load that into the flash movie.
Please let me know if you can think of everything I can do to make it work! I've been blocked for hours and can't seem to get there.
Here are my actionScript:
import flash.net.URLRequest;
import flash.display.Loader;
to import flash.external.ExternalInterface;
var movies: Array = ["idle - ok.swf ',"idle - good .swf"];
First, it loads it "Hello swf»
var helloLoader:Loader = new Loader();
var helloURL:URLRequest = new URLRequest ("idleAvatar.swf");
helloLoader.load (helloURL);
addChild (helloLoader);
var setAvatar:Function = loadAvatar;
ExternalInterface.addCallback("IsStatic",IsStatic) ("callSetAvatar", setAvatar);
Then, this function must be called by JavaScript to load one of the other sovereign wealth funds.
function loadAvatar(indx:Number) {}
var url: URLRequest = new URLRequest(movies[0]);
var ldr:Loader = new Loader();
LDR. Load (URL);
addChild (ldr);
}
Here's my JavaScript:
"<script type="text/javascript"> ".
function callExternalInterface (val) {}
document.getElementById("loader").callSetValue (val);
}
< /script >Here is my embed code:
<div >
"" " <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="350" id="charger" name="loader"> .
" <param name="movie" value="loader.swf"/ >
" <param name="allowscriptaccess" value="always"/ >
<!--[if ! IE] >->
"" <by typeobject = "application/x-shockwave-flash" data= "loader.swf" width= "250" height= "350" > ""
" <param name="allowscriptaccess" value="always"/ >
<!-<! [endif]-->
" <a href="http://www.adobe.com/go/getflashplayer_fr"> ".
" <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/ >
</a>
<!--[if ! IE] >->
< /object >
<!-<! [endif]-->
< /object >
</div>
"<a href="#" onClick="callExternalInterface (1)' >click ON < /a > ""You don't appear to be calling any function in your actionscript code. Names between and inside are in disagreement.
document.getElementById("loader").callSetValue (val);
must call a function identified by the string "callSetValue" in your actionscript code, but you only have an identified with "callSetAvatar" and the function associated with the one on your side AS3 is specified as setAvatar...
ExternalInterface.addCallback("IsStatic",IsStatic) ("callSetAvatar", setAvatar);
but you do not have a function named setAvatar, you have a named loadAvatar
Here is a link to a tutorial that can help you see how the functions are specified between actionscript and javascript using the ExternalInterface class. He becomes confused, I suggest that you copy the code into a word processing file, so you can put clear where they have the same language between them.
http://Viget.com/inspire/bi-directional-ActionScript-JavaScript-communication
-
Call the procedure this file download, but not from the URL
Hello
Oracle 11g, Apex 4.1.1.00.23.
I have a procedure that generates a CSV of a query (BLOB). The query uses the apex collections.
As it seems impossible to use collections of the apex outside Apex, I can't call this procedure from the URL to download the file (the query fails).
How can I call my procedure on click of a button, without reloading the page, and without calling the URL ?
I have some ideas like the creation of a new page, with a conditional header process that calls my procedure to download the file, then call it in a popup, etc... but I need a simple solution...
Thank you.
Yann.
PS: actually, I need the same functionality when you change a process, let us say a process page, in the source attribute, you link < police = "courier" > [Download Source] < / font >, this link simply calls < police = "courier" > javascript:doSubmit('DOWNLOAD') < / font >, but it seems that the page is not reloaded. That's exactly what I need, it does not call for any procedure in the URL, and it does not reload the page.Use an application process. These run in the security model for APEX, including the use of the collections.
-
Hi friends I want to know how to call a procedure that has values arrary as parameter?
I have a procedure as shown below, and I am using oracle 11g.
create or replace procedure procedureName (v_hospital_id in NUMBER,
v_process_id VARR_VARRY,
v_cnt OUT NUMBER);
Now, how to call this procedure from PLSQL. If v_process_id values ('abc123', 'xyz234', 'sfs234')
Please present the definition of VARR_VARRY
If it's a simple table of varchar2.
declare
v_cnt NUMBER;
Start
procedureName (1, VARR_VARRY('abc123','xyz234','sfs234'), v_cnt);
end;
-
call a procedure of package DB type complicated if the type defined in the package itself
Hello world
I use jdev 11.1.1.7.0
I defined a package of data with a procedure and internal two types as follows:
Create Or Replace Package Db_Package As Type rec Is Record(Rec_Type Varchar2(10), Rec_Desc varchar2(10) ); Type recordList Is Table Of rec; Procedure Test_Procedure(p_out out recordList); END db_package;
evil
I want to call this procedure in the module of the application. I know how to call a procedure or function db AM,
but in this case that I've defined two types in the package itself and I use one of these types as to the procedure output parameter, I had a problem.
below is the example of code to call the db procedure, but it does not work because the plsqlBlock.registerOutParameter () setting will not
CallableStatement plsqlBlock = null; String statement = "Begin DB_PACKAGE.Test_Procedure(:1); END;"; try { plsqlBlock = getDBTransaction().createCallableStatement(statement, 0); plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY);// it doesn't work plsqlBlock.executeUpdate(); Object object = plsqlBlock.getObject(1); } catch (Exception e) { e.printStackTrace(); }
I know that if I set the types of packets (rec, recordList) as types of oracle (instead of setting in the packaging itself) so I can call the procedure with success, in this case I should use below:
plsqlBlock.registerOutParameter(1, OracleTypes.ARRAY,"Recordlist");
but I wonder how you can call a procedure from the package if the types defined in the package itself.
Kind regards
Habib
JDBC supports the types of oracle level package only from 12 c database and jdbc driver ojdbc7 (which requires java 7).
Dario
-
Calling a procedure stored since SQL * PUS
Hi all
I want to call a procedure from SQL * MORE who returns the number, varchar2 and one OUT parameter as table index.
I can declare a variable for the number and varchar2.
How can I manipulate the array index passed into the procedure output parameter.
Thanks, Sandeepdeclare
a number, varchar2 (20) b;
type t as table of varchar2 (10) index directory. -identical to your procedure declaration
c t;
Start
procedure (a, b, c);
end;
/ -
Call a procedure only once for the last place of the trigger FOR EACH ROW
Hello world
I wonder if someone could help me in the execution of the trigger. My use case what follows:
-a trigger after each INSERT or UPDATE operation;
-use FOR EACH ROW algorithm for relaxation;
-collect certain values inserted/updated fields as: new.uuid and store in a set defined on the layer of the package;
-only for the last inserted/updated line call a procedure from the global collection with the values collected as a parameter;
Is it possible to be implemented for the type of the LINE FOR EACH of the trigger? Fact one: new identifier or trigger itself have special attributes such as COUNTY, SIZE to set a size of data inserted or changed to conditional logic? Is there another solution to possible workaround for thoughtful use cases.
Thank you
AndreyHi, Andrey,
I suggest you use 2 triggers:
(1) A FOR EACH ROW trigger, as you described, to collect relevant data and store it in a temporary table overall or variable poackage. Whenever the trigger is activated, it will overwrite all the data from the previous row.
(2) AFTER ( NOT FOR EACH ROW) trigger that calls the procedure by using the saved data. -
Error calling a procedure of h
Hello
I get the following error when trying to call a procedure from h. I checked and all the settings are correctly transferred. Not sure why it's throwing error. Here is the error message.
oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in the call to 'AbcPositionDetails '.
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Any help is appreciated.
Thanks in advance
PKPK,
The exception ' wrong number or types of arguments in the call to 'AbcPositionDetails' ' means that you pass incorrect parameters to procedure types or parameter argument is differrent.
for example, if the procedure definition is AbcPositionDetails (* x * in varchar2, varchar2 y ), you call in AM
As the appeal procedure (start AbcPositionDetails (* z * =>: 1, t =>: 2); end;)To resolve this problem, you must call the procedure (start AbcPositionDetails * (x * =>: 1, => y : 2); end;)
that is the definition of the procedure does not change
(or) You can call it that (begin AbcPositionDetails (: 1: 2); end;)Thank you
Kumar
Maybe you are looking for
-
Equium turns off automatically
My Laptp is turn off by itslef at random points, it feels very warm when it does this, especially the base of the laptop. What is the best way to treat this? Did the cleaning of need to the fan, if so, how can I do. Thank youAshley
-
How can I get rid of the music on my iphone that I never installed, is not on my reading list, but continues to play to my boredom?
-
The desktop icons to go to the left of the screen on reboot.
I had already read the thread "Windows 7 for moving desktop icon", but can't respond to it because it is "locked". So here I am. Mine started about 4 days (after some questionable sites surf?). All my icons have been splashed against the left side
-
If my ADSL connection disconnected by the provider of the connection on my computer freezes instead of disconnect! As the title suggests, if my connection interrupted by the ISP (for example: Internet service provider who use dynamic IP automatically
-
Trash on G:\ is corrupt?
I use windows 8, and when I start my computer, I always get a popup saying the trash on corrupt G:\is, you want to clean up? I can say yes or no. What is happening and why continually make this popup when my office opens?