How to write a procedure to run the call the custom package from backend
Hi All
Oracle 10g
Oracle Apps R12
I am working with oracle order management here we have a customize Package called (Pick Release).Due to some problem we have running this concurrent program by manually giving Route_id as parameter. The route_id is taken from the route Table. By using this query
select distinct route_id from route@DB_LINK_APPS_TO_ROADSHOW
where trunc(route_date) = trunc (sysdate+2).
so daily we have nearly 42 routes and we are running this concurrent program manually nearly times.
so now how to write a procedure for this
Step 1 Getting the route from route table.( By cursor we can get the route_id Accordingly)
Step 2 How to trigger the custom package from back end and execute accordingly to that output of the cursor(route_id)
If the cursor get 40 routes is it then the concurrent program runs 40 times according to that route_id.
can some could provide the steps to do this
Thanks & Regards
Srikkanth.M
This is about 4 or 5 lines of PL/SQL and the name of the custom package is not provided.
If you request someone in this forum to do your work for free -because obviously you didn't even try to write it, which must be considered abusing this forum- you must at least provide sufficient info so someone can do it.
And no, I won't do it for you.
Sybrand Bakker
Senior Oracle DBA
Similar Messages
-
How to write a procedure for update the table
Hi all
can any body please tell me how to write a procedure to update the table......
I have a table with about 10,000 records...........Now I have add a new column and I want to add values for that like
registration Code Creidits
13213 BBA
1232 MCS
I had add the creidit now i want to update the table.........the new value want to get by SQL like
Creidit = select creidit from othere_table...........
Hope u can understand my problem
Thanks in advance
Regards
Shayan
[email protected]Please try the following --
update Program_reg a
set TotalCreidit = ( select tot_cr <Accroding to your logic>
from Program_reg b
where a.Registration = b.Registration
and a.Enrollment = b.Enrollment
and a.code = b.code
where a.Registration in ( select distinct Registration
from Program_reg );
N.B.: Not Tested....
Regards.
Satyaki De. -
How to write such procedure?
I have a DML trigger on a table. whenever there is a change to the table, the old records will be written to another backup table created before. I want to implement this for many tables in the database. Basically, I want a procedure that takes table name as an input and creats a backup table and a trigger for the input table.
How to write such procedure?
thanks....a simple block to get you started...not tested:
declare
t varchar2(64) := 'my_table'; --your table name as a parameter
begin
execute immediate 'create table ' || t || '_bck as select * from user_tables where 1 = 0';
-- thinking you'd create the trigger on your base table, not the backup
execute immediate 'create trigger ' || t || '_dml_trigger before delete or insert or update on ' || t || ' referencing...you get the point
end;Hope this helps. If you're not the DBA you may want to discuss this train of thought with him/her.
Cheers. -
hii am new to oracle , can u help me how to write a procedure for the following query
Transfer Funds between Accounts:
Table: AccountMaster (AcctNo (primary key), AcctHolderName, currentBal
Data: 1, 'A', 1000
2, 'B', 3000
3, 'C', 4000
Function: getBalance (AcctNo)
Stored Proc: tranferFunds (FromAcctNo IN, ToAcctNo IN, Amt IN, result OUT)
The proc should use the function getBalance (AcctNo) to find out the current balance for account.
The proc should return a value of 1 if the transfer was successful.
It should return a value of -1 if the funds are not sufficient in the fromAccount to transfer.
Thanx ,
Raj0412I would start by asking your teacher to clarify the parts of the assignment that are not clear to you.
You may also want to read some books.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm -
How to write triggers on startup and shutdown of the server?
Plz advice.
How to write triggers on startup and shutdown of the server?
I could write it but nothing happened!!!Small code example for you:
[email protected]> @ connect mob/mob
[email protected]> create or replace trigger shutdown_trigger
2 before shutdown on database
3 begin
4 insert into shut_table values(sysdate);
5 end;
6 /
Trigger created.
[email protected]> create or replace trigger start_trigger
2 after startup on database
3 begin
4 insert into start_table values(sysdate);
5 end;
6 /
Trigger created.
[email protected]> @ connect "/ as sysdba"
[email protected]> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[email protected]> startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE instance started.
Total System Global Area 64036368 bytes
Fixed Size 454160 bytes
Variable Size 50331648 bytes
Database Buffers 12582912 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
[email protected]> select * from mob.start_table;
START_DAT
14-SEP-06
[email protected]> select * from mob.shut_table;
SHUT_DATE
14-SEP-06
Best Regards
Krystian Zieja / mob -
after the upgrade to 10.10.3 Foto doesn't run and call the error of the plugin PhotoFoundation
Try opening iTunes while holding down the option key. When you get a dialog box with "create a new library" or "choose a library", select the choose option and navigate to the library on your external HD.
BTW: If your external HD is not powered on and mounted before opening itunes, iTunes will create a new blank library. -
I want to cancel my New York Times subscription. How do I do this?
When I called the telephone number given on my bank statement, it referred me to this email address.
I need to cancel ASAP.You need to turn off "auto renew". This article shows you how:
iTunes Store: Purchasing and managing auto-renewing subscriptions
http://support.apple.com/kb/HT4098 -
I have 4s with 16GB storage capacity using IOS 7.1.2.
Facing hang problem after updating when i decline the call the keypad getting locked ,touch stop working unable to unlock the phone .
Then what i can do i restart the phone with pressing home key & power key together then i am able to access it.
Kindly resolve the issue as soon as possible
Ashish
[email protected]Did you already try to set it up as a new device, as explained in this article?
iOS: How to back up your data and set up your device as a new device -
when I am on a phone call in my car I can play and hear my iPhone music thru the car speakers but when I hang up from the call, the sound reverts to my iPhone speaker and longer plays thru the car speaker.
Hello, Jordanali.
Thank you for visiting Apple Support Communities.
I understand that your car will not resume playing music after accepting a call. Here is a troubleshooting article that I would recommend going through when experiencing this issue.
Get help using your iPhone, iPad, or iPod touch with your car stereo
http://support.apple.com/en-us/HT203412
Cheers,
Jason H. -
How do I personalize a form to call a custom package instead of standard
We are finding that the vertex tax package is not correctly calculating the taxes for AR late changes. The late payment charge invoices are being created without an item and we know that if we had this in there the taxes would be calculated correctly. We have a solution designed by a senior architect and would like to pursue that approach unless it has been established it is impossible.
From the Batch maintenance form ARIINR.fmb there is a generate button. It calls some pl/sql and eventually the api to create the invoice. What we want to do here is from the when button pressed trigger call a custom package (with most of the same logic intact). The problem is is that we don't want to call both the custom and standard package, only the custom one.
My question is really is there any way to avoid calling the standard package by exiting out of the trigger after the custom package completed? I know I could easily change the standard form to accomplish this but we want to accomplish this in such a way to still maintain our support with Oracle on this form. So we are looking to do this via a personalization or custom.pll change.
Any help would be very much appreciated. Thanks for your time.To my knowledge, both CUSTOM.pll and Forms Personalization execute code in addition to standard code, not instead off.
-
Is there any way to get the query used in discoverer from backend??
Hi All,
I am new to dicoverer.
Is there any way to get the query used in discoverer from backend??
Thanks,
SachinHi,
you can view the SQL from within the discoverer menu:
in desktop: View-> SQL Inspector
in Plus: Tools-> Show SQL
The SQL in the DB tables is encrypted so it's a problem getting it from there.
You can export the workbook into SQL but it is not working for every worksheet (subquery, inline pivot tables...)
you can create a batch file to export them all using the output of this script:
select null,null,'echo off'
from dual
union all
select distinct
qs.qs_doc_name Workbook_name,
qs.qs_doc_details Worksheet_Name,
'start /wait <path>\dis51usr.exe /connect '||'&p_user_name'||'/'||'&p_password'||'@'||'&p_env'||' /apps_user /apps_responsibility "&responsibility" /opendb '||
chr(34)||qs.qs_doc_name||chr(34)||' /sheet "'||qs.qs_doc_details||'"'||' /export SQL "C:\Export Discoverer SQL\'||qs.qs_doc_name||'-'||qs.qs_doc_details||'.sql" /batch'
from eul_us.eul5_qpp_stats qs
where qs.qs_doc_name is not null
--order by 1,2
union all
select null,null,'echo off'
from dual
union all
select null,null,'exit'
from dual -
My iphone hangs any time.I see a call coming but i cannot attend. My call drops anytime and i cant even end the call.The settings page doesnt respond many times.I have given the phone to Apple care , they update the software and return it back to me.IT WORKS FINE FOR 3-4 DAYS AGAIN THE SAME. Its under warranty and i am disappointed with the Apple product and service
If you used your backup to restore the data after it got returned, set it up as new device and don't use the backup data afterwards. It seems that some data inside the backup are corrupt. Follow this article and set up the account info and other setting manually after that:
Use iTunes to restore your iOS device to factory settings - Apple Support -
What is the call rate per minute from Israel to India using Global Talk Apps
What is the call rate per minute from Israel to India using Global Talk Apps by Seawolf Technologies Inc.?
$100 US, per minute or part thereof, weekends & holidays slightly higher...data NOT included .
-
Hi,
Iam new to the xml,
can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>.
Regards,
vikram.here is the your XML parse in 11g :
select *
from xmltable('//Entity' passing xmltype
'<?xml version="1.0"?>
<DiseaseCodes>
<Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
<Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
</DiseaseCodes>
') columns
"dcode" varchar2(4000) path '/Entity/dcode',
"ddesc" varchar2(4000) path '/Entity/ddesc',
"reauthflag" varchar2(4000) path '/Entity/reauthflag'
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
Using this parser you can create procedure as
SQL> create or replace procedure myXMLParse(x clob) as
2 begin
3 insert into MyXmlTable
4 select *
5 from xmltable('//Entity' passing xmltype(x) columns "dcode"
6 varchar2(4000) path '/Entity/dcode',
7 "ddesc" varchar2(4000) path '/Entity/ddesc',
8 "reauthflag" varchar2(4000) path '/Entity/reauthflag');
9 commit;
10 end;
11
12 /
Procedure created
SQL>
SQL>
SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
PL/SQL procedure successfully completed
SQL> select * from MYXMLTABLE;
dcode ddesc reauthflag
0 (I87)Other disorders of veins - postphlebitic syndrome 0
0 (J04)Acute laryngitis and tracheitis 0
0 (J17*)Pneumonia in other diseases - whooping cough 0
SQL>
SQL>
Ramin Hashimzade -
How to write a procedure with the table name as an argument
I'm very new to Oracle, usually developing in SQL server.
I would like to write a procedure that accepts a table name and then does a
SELECT * FROM [table name] order by CollectionDate.
In SQL I would build up a varchar variable and then execute it.
ThanksI often wonder why so many people new to Oracle want to do this as a first step, when most people who know what they are doing try and avoid it.
SQL> create or replace function f (p_tab varchar2)
2 return sys_refcursor as
3 c sys_refcursor;
4 begin
5 open c for
6 'select * from ' || p_tab || ' order by hiredate';
7 return c;
8 end;
9 /
Function created.
SQL> var c refcursor
SQL> exec :c := f('emp')
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 12/17/1980 800 20
7499 ALLEN SALESMAN 7698 02/20/1981 1600 300 30
7521 WARD SALESMAN 7698 02/22/1981 1250 500 30
7566 JONES MANAGER 7839 04/02/1981 2975 20
7698 BLAKE MANAGER 7839 05/01/1981 2850 30
7782 CLARK MANAGER 7839 06/09/1981 2450 10
7844 TURNER SALESMAN 7698 09/08/1981 1500 0 30
7654 MARTIN SALESMAN 7698 09/28/1981 1250 1400 30
7839 KING PRESIDENT 11/17/1981 5000 10
7900 JAMES CLERK 7698 12/03/1981 950 30
7902 FORD ANALYST 7566 12/03/1981 3000 20
7934 MILLER CLERK 7782 01/23/1982 1300 10
7788 SCOTT ANALYST 7566 12/09/1982 3000 20
7876 ADAMS CLERK 7788 01/12/1983 1100 20
14 rows selected.
SQL>Note if you pass in a value to be used in the where clause like deptno, you should not use this technique, but use bind variables intead like this -
Wrote file afiedt.sql
1 create or replace function f (p_tab varchar2, p_deptno number)
2 return sys_refcursor as
3 c sys_refcursor;
4 begin
5 open c for
6 'select * from ' || p_tab
7 || ' where deptno = :p_deptno order by hiredate'
8 using p_deptno;
9 return c;
10* end;
SQL> /
Function created.
SQL> exec :c := f('emp', 10)
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 06/09/1981 2450 10
7839 KING PRESIDENT 11/17/1981 5000 10
7934 MILLER CLERK 7782 01/23/1982 1300 10
SQL>
Maybe you are looking for
-
How do I export a SWF from CS4 and make it viewable for clients?
I'm currently using Indesign CS4 and just learned how to export an animated file as a SWF file. Once exported I have both a SWF file and a HTML file, however when I send either file to a client they don't open. How to I format the file for customer
-
I am creating a PDF form and would like to know/learn to link a database that would appear in a dropdown menu when selected (e.g., Excel spreadsheet). Can this be done? If yes, how? Thank you
-
Number Dedicated Processes running in Oracle 10g R2
Hi, How Do I Check How Many Dedicated Processes runs in my Database Oracle 10g R2? Regards.
-
I have an iPhone 4S - software up to date on all counts, operating under IOS7. I cannot open iTunes store. Tap on the icon and it immediately flashes back to its home screen. I have no problem on my iMac or my iPad 4 -- just the iPhone 4S.
-
Read and save settings from instruments
Currently, the 'save config' case saves the data read from the user interface (in the 'aggressor settings' tab) how can I change this 'save config' event so that; - Read all the insturment settings from hp8133s and hp8648 (along with GPIB addrs) - Lo