How to run PL/SQL code, as soon as a page opens
HelloWe have a business scenario where we have Apps initialize to obtain data of the ebs. We want this commissioning to arrive as soon as the page opens. Is there a way to do this? Simple, we want to be able to run pl/sql code, as soon as the page opens. Is there a way to do this?
PL Note: We use APEX with ebs.
Kind regards
Joseph
"You can have the pl/sql code in an Application process that has a ' process ' of ' On Load: before header".
CITY
Tags: Database
Similar Questions
-
Lean how to run the stop code when the highest level VI ends
Hi people.
I am a newbie of LV with 30 years of experience in embedded SW engineering. I searched for how to run the stop code when a VI of highest level ends. I found many examples, but they are horribly complicated. A little birdie told me that such a model of simple design should not be so compilicated.
My application is an application of high tension control to disable all HV checkpoints when the SW ends. My VI code is running in a while loop with a stop button that leads out of the loop. I can easily accomplish my requirement by programming with a sequence of plate that runs after the end of the main loop. The technique of flat sequence does not work when the user clicks the Cancel button in the toolbar of façade, more than that market when the user clicks the close button of the application (X button) when you run the exe application.
Can someone tell me please a simple technique, the code example that can show me a lean and elegant way to accomplish my task? It doesn't have to be an obvious solution (for example a stop induced watchdog seems simple enough).
Thank you - John Speth
1. place this code in a VI:
(also attached)
Calling code in your VI of highest level like this:
-
How to run wfstatus.sql for i-expenses
How to run wfstatus.sql i-expenses in EBS 11i.Select this check box, hope it helps.
How to find and solve the reports on Internet expenditures within workflow [ID 185004.1]
How wfstatus.sql to run on a statement of expenses Internet [134895.1 ID]
-
How to run multiple sql statements
Hi all
I wonder if I can run multiple sql statements in one shot with > >, immediate run
for example:
I set the variable as X: = sql statement
Y: = sql statement
z: = sql statement
can I execute immediate (X, Y, Z);
If yes how? and if not what other possible
Thank youBeginning with the codes of Ganesh
DECLARE l_statement VARCHAR2 (2000); v_passwd VARCHAR2 (200); v_username VARCHAR2 (200) := 'test'; v_pwd_key VARCHAR2 (200) := 'lwty23'; v_dblink_name VARCHAR2 (2000); v_dblink_drop VARCHAR2 (2000); v_dblink_create VARCHAR2 (2000); v_dblink_check_connection VARCHAR2 (2000); l_number NUMBER; BEGIN --<
> FOR c_instance IN (SELECT * FROM v_oracle_instances WHERE environment = 'Developement') LOOP SELECT encpwd_owner.display_db_encpwd (v_username, c_instance.host_name, c_instance.instance_name, v_pwd_key) INTO v_passwd FROM DUAL; v_dblink_name := c_instance.host_name || '_' || c_instance.instance_name; v_dblink_create := ' CREATE DATABASE LINK ' || v_dblink_name || ' CONNECT TO ' || v_username || ' ' || 'IDENTIFIED BY ' || v_passwd || ' USING' || ' ''(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST= ' || c_instance.host_name || ')(PORT=' || c_instance.LISTENER_PORT || '))(CONNECT_DATA=(SID=' || c_instance.instance_name || ')))'''; v_dblink_check_connection := 'select 1 from global_name@' || v_dblink_name || '.QCM'; --- Notice this change. I am simply selecting 1. That should be enough to test the database link. v_dblink_drop := 'drop database link ' || v_dblink_name || '.QCMTLAF'; -- l_statement := 'BEGIN ' || v_dblink_create ';' || v_dblink_check_connection ';' || v_dblink_drop '; END ;' BEGIN EXECUTE IMMEDIATE (v_dblink_create); DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Created'); EXCEPTION WHEN others THEN dbms_output.put_line( 'Failed to create the database link ' || v_dblink_name ); dbms_output.put_line( dbms_utility.format_error_backtrace() ); INSERT INTO error_table( column_list ) VALUES( < - > );
END;
EXECUTE IMMEDIATE (v_dblink_check_connection) INTO l_number; --- Notice this.
DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Tested');
BEGIN
EXECUTE IMMEDIATE (v_dblink_drop);
DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Dropped');
EXCEPTION
WHEN others THEN
dbms_output.put_line( 'Failed to drop the database link ' || v_dblink_name );
dbms_output.put_line( dbms_utility.format_error_backtrace() );
INSERT INTO error_table( column_list )
VALUES( <
- > );
END;
END LOOP;
END;
But I agree with the comment that others have grown up is not really wise to create and drop a database like that link.
Justin
-
Dynamic Action run PL/SQL Code runs is not after 4.2.5 upgrade
APEX 4.2.4 to 4.2.5 11.2 database upgrade
I have a button to click on DA who owns shares run of PL/SQL Code and update point who worked in version 4.2.4 which is no longer running after the 4.2.5 patch.
The PL/SQL procedure has been tested autonomous and it runs correctly.
I tested him DA is actually shot on the click event by adding an alert "DA xxxx pulled" action before the execution of work of PL/SQL action and action alert.
There is also a similar on DA click which makes the action opposite to the DA problem and it works both are configured in the same way:
Static DA, run Code PL/SQL - check waiting for result, and not repress with the same Submit and return items.
Any ideas on a possible cause/solution much appreciated
Fixed it, the question was the Page elements of return of goods on the action of PL/SQL Code:
If the target element was empty the action failed, by adding a value in the database through a normal SQL insert then the insert DA completed successfully.
Removing Page elements at the point of return of the action of PL/SQL and together action update the target element after the DA fires in all scenarios.
But thanks for the lead
-
How to run grid sql statements
Hello
I would like to run some of the grid control sql statements as tablespace freespace check.
Grid options could there be to execute the sql statement?
If so, how to set up the output of the sql for E-mail
Please I need your suggestion to proceed.
Version of the grid: 10.2.0.5.0
Platform: Sun
Thank you.Hello
no need to run the sql statement of the grid, instead of that you can configure the threshold values.
for example, if your tablespace capacity 85% complete and then he will send you the email alert that you configured in notifications.
you will find on the home page - bottom of the page - > manage settings...
check http://download.oracle.com/docs/cd/B19306_01/server.102/b14196/montune001.htm#CACCIHAB
http://download.Oracle.com/docs/CD/B19306_01/EM.102/b40002/notification.htm#sthref995
Thank you
-
How to run a SQL string to a procedure of forms?
Hello
first the background. I have a Varchar2 column in a Table with a SQL string.
Now I want to read this chain in forms and run the SQL statement - but I don't know how.
This is the SQL string:
Select the country from p_1 from countries where country_nr = p_2
P_1 and p_2 are Variables in the procedure of forms.Most people forget that groups Records are excellent tools for dynamic queries like this. Search for Populate_group_with_query.
Only you need to change your sql, it is not in the sentence, like this:
Select the country as P_1
country
where country_nr = p_2
and p_3 = p_3
and p_4 = p_4Select name as P_1
of the customer
where customer_nr = p_2
and country_nr = p_3
and p_4 = p_4Your rec group would have a single column, P_1, where the data would be accessible after the query. Get_group_char_cell allows you to retrieve the value of P_1. I don't know, but you should not "AS P_1" expression in the select, as long as you have created the record group initially with a specific column name.
The only thing that is not clear, however, is your use of variables in the where clause. You can either hardcode the literal values in the SQL string, like this:
'where country_nr = ''123'' and...'
Note as you build your text string SQL, you use two apostrophes instead of one, given that pl/sql uses the apostrophe of beginning and end of the string.
Or alternatively, you can use bind variables for your where the variables paragraph as follows:
where customer_nr = :Parameter.var_2
and country_nr = :Parameter.var_3Then, you can move a value in the: parameter values before completing the Group rec. You can use elements in a block of control rather than the settings, too.
Here is an example of using dynamic query in a record group: Re: dynamic query
-
How to run script on the web using HTTP web page?
Hi guys
Please let me know how to execute script on the web using HTTP web page?
Concerning
FrankHi Jos,
ODI provides web-based UI to run scenarios using metadata (read only your components ODI) Navigator and designer Lighweight (you can change the mapping here).
If please review how to install the metadata browser in ODI and take a look at the document ODI Setup for more information.
Thank you
Guru -
How to run a SQL statement to use a specific implementation plan
Hi all
I have a SQL that has recently been run badly. I tried the Advisor tuning SQL for the given SQL query and it gives the following information:
GENERAL INFORMATION SECTION
-------------------------------------------------------------------------------
Name of the task of tuning: 2q94zb7djr2xn
The owner task of tuning: LMDBPROD
Type of work: single SQL statement
County of execution: 2
The current run: EXEC_8869
Type of execution: TUNE SQL
Scope: COMPLETE
Time Limit (seconds): 60
Status: COMPLETED
Started on the: 03/02/2014-20:43:39
To the: 03/02/2014 20:44:25
-------------------------------------------------------------------------------
Name of the schema: LMDBPROD
SQL ID: 2q94zb7djr2xn
SQL text: SELECT NPCOMMON. FGET_ACTION_CODE (ORDNUM) ACTIONCODE, STATUS,
SUMA COUNT (*) FROM SORDER, WHERE HEADORDNUM IS NOT NULL AND
NPCOMMON. FGET_PRODUCTOFFER4ORDER (ORDNUM) IN (SELECT ID FROM)
PRODUCTOFFER WHERE PPSPECIFICATION_ID IN (SELECT ID FROM)
PPSPECIFICATION WHERE PCLASS_CODE IN (SELECT PCLASS_CODE FROM)
ARUSERGROUP WHERE CODE IN (SELECT ARUSERGROUP_CODE FROM)
ARUSER_ARUSERGROUP WHERE ARUSER_USERNAME =: B1 AND STATUS = '1')
AND STATUS = '1'))) GROUP BY NPCOMMON. FGET_ACTION_CODE (ORDNUM),
STATUS
-------------------------------------------------------------------------------
RESULTS SECTION (1 result)
-------------------------------------------------------------------------------
1-alternative Plan conclusion
---------------------------
Some implementation plans alternative for this statement was found by searching
performance data in real-time and historical of the system.
The following table lists these plans sorted by their average time.
See "SECTION of ALTERNATIVE PLANS" section for detailed information on each
plan.
plan ID hash last visit elapsed note of origin (s)
-- ---------- -------------------- ------------ --------------- ----------------
1 617797893 2013-07-11/07: 45:20 9.555 no reproducible STS
2 1311086720 2014-01-31/04: 00:44 19.569 AWR
3 1226863820 2014-01-31/18: 00:24 AWR 21.158
4 1359606848 2014-02-03/16: 00:34 21.492 AWR original plan
The plan with hash 617797893 seems the most efficient one and is based on some specific SQL Tuning Set I ran on this time. But the note says that the plan is not reproducible. Is there anyway how can I force the SQL statement to execute the plan? The database version is Standard Edition 11.2.0.1.0
Best regards
Rodriguez
Hello
I think you can use this
before 11 g, we used to create an outline stored for this.
concerning
-
How to run a sql on page load.
I am trying to run sql that populates a field when the page loads. How can I do this on the page attributes-area html header and body attributes?You can create a process plsql as follows:
Process > PLSQL > On Load (after the header) > put your code
Sam
-
Dear friends,
As I recently started working with SQL more, I realized that my opinion on this has changed.
andselect first_name, last_name from personal_details
andselect first_name, last_name from personal_details, education_details
andselect first_name, last_name from personal_details a , education_details b where a.id =b.id
is it different? or make the same result?select first_name, last_name from personal_details a , education_details b where b.id =a.id
Won't return the same result.
Just started to wonder, how it actually works of in.
Can anyone shine some light on this issue?
Thank you.
Benard>
...By default, I think that oracle starts executing the last where condition and so queries can take different time, depending on which is the primary key, or if any column index created on this subject.
This statement is almost always wrong. Oracle evaluates what query condition is the best to run first. This is done by the optimizer cost based using statistical information about the tables, columns and the indexec on these columns. There had been questions back in the day Oracle 7 and the RBO (rule based optimizer) where the order in the clause from and where clause was important. But in general, do not care anymore to this topic.
-
How to run Execute javascript code.
Hello Gurrus,
Here's what I try to do in my application...
I have a text field where the user can enter any url it wants. Once save the url, the user can click on it and open in the web browser.
Now, I've was looking for advice on how to call a javascript function in the blackberry browser or is there another way?
My app has a different version based on BB OS, so in short I'm building three COD files
(a) BB OS 4.2
(b) BB OS 4.3 to 4.6
(c) 4.7 n upward.
Kindly help me or guide me in the right direction...
Thanks for the help.
Dunn worry guys, I understand that. Ask me if any of you experience the same problem.
I'll be happy to help you.
Thanks again.
-
How to run the SQL...
Hello
It's embarrassing... I've been around my old files post v2 migration SQL encoding problems... but now the statements will not work! In fact I don't get the run option in the spreadsheet at all. With this newly created net of such statements will run. The options at the top of the tab are grayed out. I tried to highlight the SQL, the F9 shortcut block, pull down menus, etc.. No luck.
Any comment appreciated... Please be kind :-)
AIt is something that they went out in 2.1 and there is now an enhancement request to add it to (see Re: 2.1EA2: dialog box connection select is no longer used if no connection).
theFurryOne
-
How to run the .sql file
Hello
I want to execute .sql files in sql, as well as a fixed location, it may be the network location or to the system drive. so that I can use it on other computers when I'll work on another pc.
so please tell me for the localization of network and disk solution. by default it look in the BIN directory
I use oracle 10g.
Thank youApart from William Robertson's response:
I'll make sure that I put it for everyone on a network share and map theirin their connection to this directory, so it can be accessed as g: or letter that everything that you want. That would keep things manageable. For the question of privilege, please set up a separate thread.
----------
Sybrand Bakker
Senior Oracle DBA -
Examples of pl/sql code that can be used in training for new developers
Hello
I'm working on a training ride on the pl/sql to some developers who are totally new to PL/SQL. Although they are experienced in another language. I have power point on pl/sql presentations, but they especially the theory oriented with just a few examples. I'm looking for more help to have a few example pl/sql that can be given to interns as the code for example and also to practice. It should be a bit detailed and like to print the odd numbers or print "hellp world." Can anyone help to suggest if there is an example of code that is a bit detailed with a kind of complex problem which will give students a hands good example? I see a nice example at this link: http://tucano.tucanowebdesign.com/oracle/tutorial5.html - on an inventory system. It gives the feeling of being one on the issue of real-world work. So that if anyone knows of some other example say about 150 t0 300 lines or so of the code, I'll be grateful if it is shared.
Thank you
OrauserN
That said, I feel again (my perception) that more code a person writing/comments the better he gets. So, I want students to examine several code examples. I guess I need to see some books to bring out some really long piece of PL/SQL - like case studies.
. . .
But these guys are too busy and so I try to find the net / books some really detailed examples.But you seem to be overlooking that PL/SQL is supposed to be used for: PL means "procedural language.
So, PL/SQL must be used to 'procedure' treatment; This is typically several process steps. For example, when you want to run three applications as a "TRANSACTION". If all three completed successfully you COMMIT and if any of the three you don't ROLLBACK.
You can do this by using SQL only. And a developer doesn't have to write the code until they have a technical requirements doc that explains what problem the code is supposed to solve and the constraints and requirements that the code must implement.
So, my suggestion is the following:
1. identify and teach the types of issues that PL/SQL is used to help solve. Multi-step transactions, I mentioned above is an example
2. use the documentation and the code of your own organization in the form of samples. These 'guy' is perhaps too busy, but they should be able to provide to you all the documents for the code they wrote and that you use which would be good to use as examples. If they have no documents technical requirements so you just identify a MAJOR gap in the operations of your org that you must bring to the attention of management.
3. you can provide value added a lot more if you use code from your own org as a basis for what you are doing. A very useful training exercise is to ask students to perform 'code review' of a code (a procedure or function) and write simple comments, one line that explain, in plain English, what makes each piece of code.
4 comments, students create to step #3 can actually be incorporated into your code then existing so that future developers can use these comments to understand what the code actually does.
5 part of your 'education' should be on the way to 'test' correctly a piece of code PL/SQL to make sure it is doing what it is supposed to do. Again, if your students actually your own org code allows to create tests, these tests can then be added as a result of 'test' for this application and that adds value. A lot of times those developers 'busy' will not create the actual test cases and that your students can help remedy that. In addition, it does no good to know how to write PL/SQL code if you don't know how to test properly.
Maybe you are looking for
-
I always use (and will not update) Windows XP. The details of an update of Firefox indicate that the new version (that I don't need) can interfere with XP. I want to have Firefox stop invites me for an update. How can I do this? I just continue to se
-
SIDEBAR does not load because another process
I have my computer sidebar charge whenever I start windows. As of recently I get an error message that indicates "Settings.ini is being used by another process. Close other programs and then click Retry, or click Cancel to exit the sidebar". I search
-
Carbon X 1-Suggestions please - i5 with 8 GB GOLD I have 7 with 4 GB?
Hello I'm stuck on the specifications to purchase. I wish X 1 can come with i7 with 8 GB of ram = / but I can't wait until this generation comes out because of the school from 3 weeks. Things that I do every day are: I plan to do the usual Microsoft
-
How to recover Windows 7 on Latitude 3540
I bought a Dell Latitude 3540 with Windows 7 Pro. I installed Windows 8 with the recovery media, but I would like to recover my installation of Windows 7. Thank you for your time.
-
Network Concentrator VPN access.
We have a 3000 Concentrator and is configured with a remote vpn on it. All inside network is allowed once a connceted to the vpn user. It is quite behind firewalls. I can access an external IP. But I can't log in to the vpn from the inside network. I