Calling Procedures from Packages
Hi All,
I got stuck up with this problem,
I got some overloding procedures to be migrated from DB2 to Oracle so i created Package put all the overloding procedures and it is fine, but since the existing front end uses just the procedure names,and they dont want to add a package tag for that.
How to solve this problem,,, without using package name i want to call the procedures...
Please can anybody help me out in this...
Thanks
Chandra
Hi Ahmed,
Thanks for that,, But you can overload procedure or function
without package only in local subprograms..I mean in ananumous block.. But not the stored procedure or stored function.
i want this procedures to be stored in databse since they are calling many other procedures from them.
can you please help me out iin this...
Thanks
Chandrakant
Similar Messages
-
How to find the name of calling procedure or package?
Hi all..
Is it possible to find the name of the calling procedure or package?
I mean..if proc_1 is calling proc_2 How can i find in proc_2 that proc_1 is calling?
Proc_2 is being called from different procedures? I need to write to small code which needs to fire depends on the Proc it is calling?
Please help me to solve this.
ThanksNot sure, if this is what you're looking for
SQL> create or replace procedure p0 as
2 begin
3 dbms_output.put_line(dbms_utility.format_call_stack);
4 end;
5 /
Procedure created.
SQL> create or replace procedure p1 as
2 begin
3 p0;
4 end;
5 /
Procedure created.
SQL> create or replace procedure p2 as
2 begin
3 p1;
4 end;
5 /
Procedure created.
SQL> set serveroutput on
SQL> begin
2 p2;
3 end;
4 /
----- PL/SQL Call Stack -----
object line object
handle number name
3a7f2d618 3 procedure INV_ADM.P0
39abfeef0 3 procedure INV_ADM.P1
39c5ae7a0 3 procedure INV_ADM.P2
3a0f3a538 2 anonymous block
PL/SQL procedure successfully completed.
SQL> -
Is possible to call procedure from vorowimpl class
Hi,
please tell me how to call procedure from vorowimpl class.
Thanks in advance,
SANHi cruz,
Thanks for your reply.
I checked that link and they given for controller.
But i want to call that from the vorowimpl class. but i tried similar like calling in the controller.
here my code, please correct it if it is mistake.
public AssessmentsAMImpl xxam;
public String getXXCompName() {
//return (String) getAttributeInternal(XXCOMPNAME);
OADBTransaction txn=(OADBTransaction)xxam.getDBTransaction();
String compName=getCompName();
String xxName="";
CallableStatement cs=txn.createCallableStatement("DECLARE OUTPARAM VARCHAR2(100);begin apps.XX_COMP_ELEMENTSVO_PROC(:1,:2);end;",0);
try{
cs.setString(1,compName);
cs.registerOutParameter(2,OracleTypes.VARCHAR,0);
cs.execute();
xxName=cs.getString(1);
catch(Exception e){
try{
cs.close();
catch(Exception e){
return xxName;
} -
How call procedure or package from Oracle BI Publisher 10.1.3.2.1
Hi Gurus,
I need to call a procedure or package from Oracle BI Publisher 10.1.3.2.1 by passing parameters, I do it because it would be easier to fill a table as the report that asks for is too complex (8 breaks, 5 dblinks, 20 tables, etc).
I'm not using the Oracle XML. Review include the following solutions:
Re: Stored procedures and dynamic columns
Re: Is it possible to use Stored Procedures in BI Publisher GUI?
Re: PL/SQL Stored Procedure w/ XML Template?
But none of them useful for me was the level of complexity.
Best regards.Hi Vetsrini,
I write the sentence as it showed in the previous thread
select from whc_kk_v2.whc_p_kk_publisher (pv_msgerror =>: msgerror,*
pv_pro1 =>: prov_1,
pv_pro2 =>: prov_2)
run when I get the error BIP
ORA-00933: SQL command not properly ended
Show me I'm doing wrong, or who may be causing the error. I tried everything but does not leave, please your help.
Best regards -
How to move functions and procedures from packages into a schema?
Hello,
I have below requirements for a homework and my question is if someone can point me in the right direction to find documentation which can help me solve the below. Any information will be very much appreciated. Thank you.
Write procedures and functions (included or not in packages)under the form scripts .txt or .sql . Once they have been launched in SQL developer they should more the functions and the procedures from the packages in the current schema. If the current schema contains only 2 packages, pac1( with procedures p11,p12 and the functions f11,f12,f13) and pac2( contains the following procedures p21,p22,p23 and the functions f21 and f21( overloading cases), the execution of the scripts will generate the following effects:
The procedures p11,p12,p21,p22 ,p23 and the functions f11,f12 and f13 will be created in the current schema.
pac2 will contain 2 instances of the overloading function- f21; they will be kept in the package, without being created in the current schema; so all the procedures/functions overloaded will be kept in the original packages
If pac1 contains variables, cursors and public types, we will keep only the package specifics( and delete the body);generally if the packages do not contain procedures or functions overloaded the body will be deleted and if no variables, cursors, public types then we will delete the header.
If in the triggers, procedures, functions we will call procedures/functions from the packages(the procedures and the functions moved in the current schema) they reference will need to be updated ( via amending the body or recompile) for example if pa1.p12 will need to be replaced with p12.
The scripts will have to have numbers in the following series( 01....n) and characters that explain the content.My only advice would be to remember that these are public forums and if YOU can find them, so can your instructors.
Also, those are horrible procedure and function names
This assignment seems to be around overloading pl/sql objects and order of precedence...do a search on the Oracle Docs around overloading and inheritence
http://docs.oracle.com/cd/B28359_01/appdev.111/b28371/adobjplsql.htm#i21148 -
Calling procedures from table and apex
Hi
I have a stored procedures and I want to put my stored procedures in table and I want to call store procedure from table in apex. how can I do this?
For example
I have stored procedures like Students(year number,birimno number)
GPA(birimno number,studentno number ) Student Procedure and GPA proecdure retrieve name and lastname
and I want to create a table
table has
Id Package Procedurename Arguments Header
1 GPA birimno, studentno name, lastname
2 Students year, birimno name,lastnameSo how can I do like this ? I want to call storeprocedures on APEX with selectlist. Selectlist will has a storeprocedures .
Edited by: esra aktas on 06.May.2011 01:48
Edited by: esra aktas on 06.May.2011 01:48
Edited by: esra aktas on 06.May.2011 04:08I am beginner pl/sql .
I had searched execute immediate for helping my problem.
My purpose is that I want to collect all of procedures in one table. And I must retrived which I select procedure on APEX Selectlist.
So I started to create a table which name is procedures and I put my procedures names on it.
Now how can I execute to procedures that name is in table?
create or replace
procedure "ISINIF_BASARI"(normalyariyil number,birimno number )
IS
ogrenci_no VARCHAR2(12);
ders_kodu VARCHAR2(12);
ders_adi VARCHAR2(50);
harf_kodu VARCHAR2(4);
CURSOR c_basari IS
select dk.ogrenci_no,da.ders_kodu,da.ders_adi,dk.harf_kodu
into ogrenci_no,ders_kodu,ders_adi,harf_kodu
from ders_aktif da,ders_tanim dt, ders_kayit dk
where da.ders_kodu like birimno ||'%'
and (dt.normal_yariyili=normalyariyil
OR dt.normal_yariyili=normalyariyil+1)
and (da.acildigi_donem='1' or da.acildigi_donem='2')
and dt.ders_kodu = da.ders_kodu
and dk.acilan_ders_no = da.acilan_ders_no
BEGIN
FOR I IN c_basari LOOP
dbms_output.put_line(' OGRENCI NO '||I.OGRENCI_NO||' DERS KODU '|| I.DERS_KODU||' DERS ADI '||I.DERS_ADI||' HARF KODU '||I.HARF_KODU);
end loop;
end;I have procedure like that.
and I have a procedures table. And I put the procedure's name in table.
procedure
id procname
1 ISINIF_BASARI
Now I want to call procedure using this table .
When I call yhe procedures from table I wrote like this. But it has faults.
create or replace
PROCEDURE CALLSPFROMTABLE as
v_sql_exp VARCHAR2(100);
BEGIN
v_sql_exp :='begin'||'select p.procname from procedure p where id=1'||'end;';
end;Edited by: esra aktas on 07.May.2011 02:19 -
Call procedure from form which displays HTML
I have a form based on a table with three columns. When I press the insert button, I want to insert the data into the table and then pass the data to a procedure (wihtin a package), which will call an external java procedure and get a passcode returned to it. I then need to display the passcode to the user's screen (which I am currently attempting to do via htp/htf calls within a procedure in the package).
I tried to put the call to the package in a trigger. It succeeded in calling the external procedure, but did not display anything to the browser afterwords.
I then tried to put the call to the PL/SQL code on my Insert button. I have tried various flavors of this call, but here is the current version:
declare
v_user_key_id lcams_db.user_token_link.user_key_id%TYPE;
v_tkn_ser_no lcams_db.user_token_link.tkn_ser_no%TYPE;
v_actv_ind lcams_db.user_token_link.utl_actv_ind%TYPE;
blk varchar2(10):='DEFAULT';
begin
v_user_key_id:=p_session.get_value_as_number(
p_block_name=>blk, p_attribute_name=>'A_USER_KEY_ID');
v_tkn_ser_no:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_TKN_SER_NO');
v_actv_ind:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_UTL_ACTV_IND');
lcams_db.otp.set_otp_user_key_id(v_user_key_id);
lcams_db.otp.set_otp_tkn_ser_no(v_tkn_ser_no);
lcams_db.otp.set_otp_actv_ind(v_actv_ind);
doInsert;--- This is the default handler
lcams_db.otp.otp_utl('INSERTING');
end;
otp is the package. I have three variables in my package otp_user_key_id, otp_tkn_ser_no, and otp_actv_ind which I pull from session storage and put into the package variables. the otp_utl sets a variable and calls otp_add_user, which gets more data from the table and calls the pl/sql wrapper for the java routine to actually add the user into the external OTP database. The java routine returns the status and initial passcode and then I call a routine internal to the package to display the results to the user via htp and htf calls.
The best result was getting the table to update and the external database to update, but I never got the resulting html to diplay. With the current code, the browser goes away with a message of Connecting to... and nothing gets updated and my browser eventually comes back with a 'No data...' message.
Is there a way to do what I want? Ideally I would like to call the package, display the results, and provide a back link so the user can get back to the original form after the user has read the passcode message.
nullOkay. I put the following code in the 'On successful submission of the form...'
section of the form and I tinkered with it until it works; however, it currently assumes
the Insert button was the button clicked.
declare
v_user_key_id lcams_db.user_token_link.user_key_id%TYPE;
v_tkn_ser_no lcams_db.user_token_link.tkn_ser_no%TYPE;
v_actv_ind lcams_db.user_token_link.utl_actv_ind%TYPE;
blk varchar2(10):='DEFAULT';
my_url VARCHAR2(200);
return_url VARCHAR2(200);
begin
v_user_key_id:=p_session.get_value_as_number(
p_block_name=>blk, p_attribute_name=>'A_USER_KEY_ID');
v_tkn_ser_no:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_TKN_SER_NO');
v_actv_ind:=p_session.get_value_as_varchar2(
p_block_name=>blk, p_attribute_name=>'A_UTL_ACTV_IND');
my_url := 'lcams_db.otp.otp_utl?' | |
'p_user_key_id=' | | TO_CHAR(v_user_key_id) | |
'&p_tkn_ser_no=' | | v_tkn_ser_no | |
'&p_actv_ind=' | | v_actv_ind;
call(my_url,return_url);
end;
How do I determine which button was clicked for the 'On successful submission...' section so I can call the correct routine?
null -
Performance differce calling Procedure from sqlplus and Java
Hi ,
I have one procedure which is called from java application and its called only once from java and the entire process is running from procedure itself.Once its called there is no dependency from java to PL/SQL.Its taking long time from java.But if I execute the same procedure from SQL plus then its running in seconds.Also only one session is running in entire database.
My Oracle version 11g.
Please guide me if you get some thing based on below session event.
This is the session status for running from SQL plus
SID EVENT TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED WAIT_CLASS
2191 SQL*Net message from client 954 0 1319633 Idle
2191 direct path read 860 0 702 User I/O
2191 db file sequential read 2605 0 550 User I/O
2191 SQL*Net break/reset to client 24 0 460 Application
2191 SQL*Net more data from client 3 0 159 Network
2191 direct path write temp 214 0 74 User I/O
2191 direct path read temp 314 0 67 User I/O
2191 db file scattered read 78 0 42 User I/O
2191 db file parallel read 71 0 21 User I/O
2191 log file sync 36 0 12 Commit
2191 SQL*Net message to client 955 0 0 Network
2191 Disk file operations I/O 8 0 0 User I/O
2191 events in waitclass Other 15 7 0 Other
This is the session status for running from Java
SID EVENT TOTAL_WAITS TIME_WAITED WAIT_CLASS
1718 SQL*Net message from client 21208 7046039 Idle
1718 direct path read 2742 2327 User I/O
1718 log file sync 3748 1121 Commit
1718 db file sequential read 1533 1082 User I/O
1718 enq: TX - row lock contention 6 423 Application
1718 buffer busy waits 1 100 Concurrency
1718 log buffer space 1 30 Configuration
1718 direct path write temp 92 21 User I/O
1718 direct path read temp 138 16 User I/O
1718 log file switch (private strand flush incomplete) 6 16 Configuration
1718 SQL*Net message to client 21209 2 Network
1718 db file scattered read 2 1 User I/O
1718 SQL*Net more data from client 17 0 Network
1718 Disk file operations I/O 11 0 User I/O
1718 SQL*Net more data to client 1 0 Network
1718 events in waitclass Other 15 0 Other
Sorry I am not able to paste in proper alignment for my plain text.Hi,
you need to find which SQL is running slower, using some tools as dbms_profiler, dbms_hprof, ASH, extended SQL trace and real-time SQL monitor (caution: some of the tools may require Diagnostic Pack License).
Then you need to pinpoint difference in the plans and understand its origin -- post plans here if you need help with that (use tags to preserve formatting).
Best regards,
Nikolay -
Getting error while calling procedure from remote database
When I am trying to call child procedure from remote database I am getting below error:
ORA-02064: distributed operation not supported
ORA-06512: at "NMUSER.NEW_CUST_UPLOAD", line 740
(P.S. on line no 740 I issued "commit;" )
I checked rights,synonym on all the objects they are fine.Oracle Error: ORA-02064
Error Description:
Distributed operation
not supported
Error Cause:
One of the following
unsupported operations was attempted:
1. array execute of a remote update with a subquery that references a dblink,
or
2. an update of a long column with bind variable and an update of a second
column with a subquery that both references a dblink and a bind variable, or
3. a commit is issued in a coordinated session from an RPC procedure call
with OUT parameters or function call.
Cheers,
Manik. -
Error when calling procedure from form personalization
Hi every body
I want to call a procudre using form personalization . I made the procedure and in form personalization i call it as follow:
built in type : Execute a Procedure
Argument :
='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )'
but the following error raised when i click on Apply Now button :
the string (='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )' )
couldn't be evaluated because of error ORA-06550 :line 1 , column 43
PLS-00103:encountered the symbol ")" while expecting one of the folowing (- + ...... etc
can anyone have a solution to this problem because it made me mad .(urgent)
Or if anyone have another way to call the procedure ??
Note that i want to pass db_session_id to the procedure from the application so does anyone have a complian about the way of passing this parameter to the procedure ??See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674
-
'ORA-12571: TNS:packet writer failure' error while calling procedure from VC++
hi all,
i am writing stored procedures and calling these from vc++. I have one stored procedure in that all
in and out perameters are numeric. When i am calling these procedure i am able to get the values properly. But in another procedure one in perameter is varchar and one out perameter is varchar. When i am calling these procedure from vc++ the error i am getting is "ORA-12571: TNS:packet writer failure". I test my vc++ code on different computers but its giving the same errors. I think ora-12571 error is when i can't communicate with oracle. But other stored procedures(in and out perameters are numbers) and sql statements are running properly. Only these stored procedure which has in and out perameters as varchar is giving me the above said problem. My out perameter in this procedure strtax is of type varchar and the length 100. Is it the problem. Please suggest me how to over come this problem.
thanks in advance,
with regards
vali.Hi
We recently changed our load balancer to a new load balancer. we get this error only after the load balancer change.
When the error occurs, I could see ORA-12571 error message only in the application error log. The listener.log has only the following message about TNS 12502. It does not have any message about ORA -12571.
TNS-12502: TNS:listener received no CONNECT_DATA from client
12-MAR-2010 12:23:26 * (CONNECT_DATA=(SERVICE_NAME=AppName)(CID=(PROGRAM=c:\wind ows\system32\inetsrv\w3wp.exe)(HOST=WEB02)(USER=NETWORK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.x.x.x.x)(PORT=2202)) * establish * AppName * 0
12-MAR-2010 12:23:26 * (CONNECT_DATA=(SERVICE_NAME=AppName)(CID=(PROGRAM=c:\wind ows\system32\inetsrv\w3wp.exe)(HOST=WEB02)(USER=NETWORK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.x.x.x.x)(PORT=2203)) * establish * AppName * 0
12-MAR-2010 12:23:26 * (CONNECT_DATA=(SERVICE_NAME=AppName)(CID=(PROGRAM=c:\wind ows\system32\inetsrv\w3wp.exe)(HOST=WEB02)(USER=NETWORK?SERVICE))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.x.x.x.x)(PORT=2204)) * establish * AppName * 0
12-MAR-2010 12:24:09 * 12502
TNS-12502: TNS:listener received no CONNECT_DATA from client
Thanks
Ashok -
ORA-12571: TNS:packet writer failure while calling procedure from VC++
hi all,
i am writing stored procedures and calling these from vc++. I have one stored procedure in that all
in and out perameters are numeric. When i am calling these procedure i am able to get the values properly. But in another procedure one in perameter is varchar and one out perameter is varchar. When i am calling these procedure from vc++ the error i am getting is "ORA-12571: TNS:packet writer failure". I test my vc++ code on different computers but its giving the same errors. I think ora-12571 error is when i can't communicate with oracle. But other stored procedures(in and out perameters are numbers) and sql statements are running properly. Only these stored procedure which has in and out perameters as varchar is giving me the above said problem. My out perameter in this procedure strtax is of type varchar and the length 100. Is it the problem. Please suggest me how to over come this problem.
thanks in advance,
with regards
vali.hi,
thanks for reply,
I wanna let u know that this is my personal lappy & i have installed apps dump on it in Linux & connect it through VM player in Window environment. I have recently purchased a new Antivirus K7 & installed it on my Lappy. i wanna know does this impact your application or Dbase Bcoz the application is running fine after starting the services in linux.
The only thing is that i am not able access the database through TOAD or SQL*Plus. the same error i am facing in both.
So
shud i uninstall the antivirus on this And this is the only solution to it ?
If yes, then how do i fix it again when i'll reinstall it Bcoz i need Antivirus as well.
kindly suggest.
thanks
D -
I am trying to call a procedure from a button that will work out the total of an order and display it in the total field in my master block.
I am unsure as to how to call the prodcedure from my button. I have written the procedure in the PL/SQL Stored Program Units part like it says in the help file but am now stuck.
I assume I use a WHEN-BUTTON-PRESSED trigger but what do I write in the trigger?What about placing outputs from the procedure to fields on the form?
Here is the procedure I have created:
procedure vatTotal (Order_no IN number,Total2 OUT number)
AS
CURSOR c_vatTotal is
select order_line.quantity, gre_product.cost from ord, gre_product, order_line where ord.order_no = order_line.order_no AND
gre_product.prod_no = order_line.Product_no;
Total number;
begin
Total:= 0;
for c_record in c_vatTotal loop
Total := Total + c_record.quantity * c_record.cost;
end loop;
Total2 := Total;
end;
I believe this is correct. It compiles.
I tried using Total as an out parameter but received the "duplicate fields in RECORD, TABLE or argument list are not permitted" error. -
Call procedure from another procedure
Hi All,
I have a requirement to call a procedure from another procedure and don't want to return to the main procedure again.please suggest me how to achive this .
thanksuser13424229 wrote:
I have a requirement to call a procedure from another procedure and don't want to return to the main procedure again.please suggest me how to achive this .A very strange requirement.. that perhaps you should expand on in order to get proper technical input and advice from forum members.
Assuming a valid requirement, it should be implemented in the following way:
SQL> create or replace procedure ProcB is
2 begin
3 DBMS_OUTPUT.put_line( 'ProcB(): executing...' );
4 end;
5 /
Procedure created.
SQL>
SQL>
SQL>
SQL> create or replace procedure ProcA is
2 E_CEASE_PROCESSING exception;
3 pragma exception_init(E_CEASE_PROCESSING, -20000 );
4 begin
5 DBMS_OUTPUT.put_line( 'ProcA(): executing...' );
6 DBMS_OUTPUT.put_line( 'ProcA(): doing stuff 1...' );
7 raise E_CEASE_PROCESSING; --// typically a conditional instruction
8 DBMS_OUTPUT.put_line( 'ProcA(): doing stuff 2...' );
9
10 exception when E_CEASE_PROCESSING then
11 ProcB;
12 end;
13 /
Procedure created.
SQL>
SQL>
SQL> exec ProcA
ProcA(): executing...
ProcA(): doing stuff 1...
ProcB(): executing...
PL/SQL procedure successfully completed.
SQL> -
Problem with IN OUT parameters whiloe calling procedure from Form 6i
Hi
Could some help please? I have the following scenario.
I am calling a stored procedure from form 6i by pressing a button on the form. Procedure has two IN OUT parameters, and I am passing these two IN OUT parameters and have declared them the way they are declared passed to the procedure. But I get an error when calling that procedure with these IN OUT parameters. the procedure works fine if parameters are IN only. The error says:
PLS:00363: Expression '1' cannot be used as an assigment target.
NO matter I pass some value or leave it blank, I get the same error message persistenetly.
Please help.
Thanksmake sure you are calling your procedure with variables as parameters,
i.e.
l_v1 := 1 ;
l_v2 := 'hello world' ;
your_proc(l_v1, l_v2)
not
your_proc(1,'hello world')
Maybe you are looking for
-
Mac Mini is making crackling noises?
The Mac Mini is making crackling noises - has anyone had this issue? Thanks Miles
-
Itunes is update with 9.1 but keeps wanting to update
I have 9.1 installed, but everytime itunes opens it says it asks if I want to download and update. How do I get itunes to recognize it is up to date
-
HI folks, I created include in a program then when i want to delete the include it gives an error like this "Include cannot be deleted because references exist" waiting for ur reply, regards,
-
Hello all, We are running Business Objects 4.0 SP2 and have some users running queries to our ERP system. They say they are running them in the background, but they are still timing out after 10 minutes with an ST22 stating they are exceeding the 60
-
Can't download - error message: 'internet explorer is not working'
I can't even download AR. whenever I try to run the download I get the above error message and the dowload closes down. Running: Windows Vista Basic Dell Inspiron Laptop