Call Sub Procedure in Main Procedure
Dear all,
I write the follow code,but it does not work. Please help, thanks !
CREATE OR REPLACE PROCEDURE CCC_BOM_PRC
IS
PROCEDURE CCC_BOM_CRE_SEQ_PRC
IS
BEGIN
xxxx.....
END;
PROCEDURE CCC_BOM_CRE_TABS_PRC
IS
BEGIN
xxxx....
END;
PROCEDURE CCC_BOM_SPLIT_PRC
IS
BEGIN
xxxx........
END;
PROCEDURE CCC_BOM_UPD_DATA_PRC
IS
BEGIN
xxxx.....
END;
BEGIN
CCC_BOM_CRE_SEQ_PRC;
CCC_BOM_CRE_TABS_PRC;
CCC_BOM_SPLIT_PRC;
CCC_BOM_UPD_DATA_PRC;
END;
SQL> @D:\CCC_BOM_PRC
已建立程序.
SQL> EXEC CCC_BOM_PRC
PL/SQL 程序順利完成.
SQL>
you can create 5 procedure in a package (Pakage1). All of the procdures are independent in package. You can call 4 procedure in the 5th (main) procdure in the same way like
CREATE OR REPLACE PROCEDURE CCC_BOM_PRC
IS
BEGIN
CCC_BOM_CRE_SEQ_PRC;
CCC_BOM_CRE_TABS_PRC;
CCC_BOM_SPLIT_PRC;
CCC_BOM_UPD_DATA_PRC;
END;
To run this code your statement in SQLPLUS will be like that
Exec Pack1.CCC_BOM_PRC ;
Similar Messages
-
How to trace/debug main workflow calling sub workflow.
Guys,
I am calling Sub workflow from MAIN workflow.
I am able to trace till beginning of sub workflow, with the help of workflow log.
But, is it possible to trace/debug the sub workflow as well(in single stretch).
Please guide with t-codes & procedures(links).......
Regrads.
santosh.Hi Santosh,
You should be able to see the technical log for the subflow as well - but perhaps that's not what you are asking.
First, you should always be able to 'trace' your subflows by starting them directly via SWUS. Then you will have the log to review.
You can also set the workflow trace on via SWU9.
Hope this helps,
Sue -
Calling Procedure B from Procedure A having parameters
Hi,
I have two procedures, I m registering first procedure as a concurrent program like XXXpackage.main
I want to call Procudure new_segments_id from Procedure main.
I need l_old_id parameter for new_segments_id procedure, so I m passing to main procedure.
Now, how should i call new_segments_id procedure from main procedure.
Procedure main(
errbuf OUT VARCHAR2
,retcode OUT VARCHAR2
,l_old_id IN NUMBER
Procudure new_segments_id(l_old_id IN NUMBER
,l_new_id OUT NUMBER
Thanks.Not sure if this is what exactly you want but below is an example of propagation of OUT parameters of one procedure as IN parameters to the another procedure within the same package.
SQL> CREATE OR REPLACE
2 PACKAGE PACKAGE_TEST
3 AS
4 PROCEDURE procedure_1(
5 out_ename OUT VARCHAR2);
6 PROCEDURE procedure_2(
7 v_ename VARCHAR2);
8 END PACKAGE_TEST;
9 /
Package created.
SQL> CREATE OR REPLACE
2 PACKAGE body package_test
3 IS
4 PROCEDURE procedure_1(
5 out_ename OUT VARCHAR2)
6 AS
7 v_ename VARCHAR2(200) := 'SMITH' ;
8 BEGIN
9 SELECT
10 ename
11 INTO
12 out_ename
13 FROM
14 emp
15 WHERE
16 ename = v_ename;
17 DBMS_OUTPUT.PUT_LINE('PROCEDURE 1');
18 procedure_2(out_ename);
19 END;
20
21 PROCEDURE procedure_2(
22 v_ename VARCHAR2)
23 IS
24 v_count number;
25 BEGIN
26 DBMS_OUTPUT.PUT_LINE('PROCEDURE 2');
27 dbms_output.put_line(V_ENAME);
28 select count(*) into v_count from emp where ename = v_ename;
29 dbms_output.put_line('COUNT is ' || v_count);
30 END;
31 END;
32
33 /
Package body created.
SQL> DECLARE
2 ENAME VARCHAR2(5);
3 BEGIN
4 package_test.procedure_1(ENAME);
5 END;
6 /
PROCEDURE 1
PROCEDURE 2
SMITH
COUNT is 1
PL/SQL procedure successfully completed.
Ishan. -
Passing parameters to sub report's stored procedure
I'm attempting to pass values from the main report to a linked sub report's stored procedure, but I haven't been successful yet.
I know how to filter the parameters on the return set of the stored procedure, using parameters from the main report. However, I would like the stored procedure executed for each record of the main report, using those values passed.I was getting "missing parameter values" trying to send parameters to a stored procedure in the subreport. Turns out there is a hot fix for my issue. Not sure if it matches what you're trying to do; you need to give more information on what you've already tried.
I was using CR XI, and also CR for VS 2005. The problem seems to be fixed with CR VS2005 SP1, for Visual Studio CR.
Look up under Business Objects Downloads: Crystal Reports > .NET > Hot Fixes
Files:
CRRedist2005_x86.msi
crvs05sp1.exe
Then open the report again, and re-save it.
This has fixed the problem for me.
Good luck! -
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 in Calling Sub VI remotely from a main VI in a Web Browser.
Hi i am Calling Sub VI remotely from a main VI in a Web Browser.
My task details:
I my project i am fechting data from a MySQL data base and storing in a table on the main VI front panel.For User help i am calling a sub VI front panel which is consisting of a progress bar and percentage indicator.It indicates the user that the data is loading from the DB.The main purpus of a subVI is to make the GUI more user friendly..by displaying the SubVI front panel until whole data is loaded into the table and closing Immediately after load complete.
What i did?
To call a SUB VI i just right clicked on the subVI icon on the main VI >> SubVI node setup>> Show front panel when called.
In main VI Execution property i have seected Preallocated clone reentrant execution
In Sub VI Execution property i have seected Non- reentrant execution.
If i select Preallocated clone reentrant execution in Sub VI while calling sub VI i am getting warning message saying subVI front panel cannot be controlled remotely.
Promblem I am facing:
It is working perfect in a server machine(as a stand alone) but when i call the same VI or application in remote system i abserved two issues
1. When i call a sub VI every time the front panel is coming in both server and client machine.I want the subVI panel to display only in the client machine, other wise the user sitting in front of the server will be confused by seeing many popups(SubVIs) in his system.
2. When one client is calling a SubVI, the other user should wait until the the sub vi displayed and closed in the 1st client.Means the simultaniously more than one client cant access the SubVI.In this case i can access the main VI simultaniously but not the SubVI.
Please give me the solution.It wil be very helpful for me.Thank You in advance.
Thanks & Regards
GundappaI did some prijects with Siebel, but we used JMS for sending and retrieving message between Siebel and BPEL. Can you use this solution? This also gives you the advantage that you can guarantee that the transactionis committed and placed in a queue. You can also bring down the BPEL environment without interfering the Siebel environment, because the communication is done via JMS (queueus)
-
Calling SQL * LOADER in stored procedure
Hi Experts,
Can we call sql*loader in stored procedures? . If yes , please let me know the syntax.
Any help will be highly appreciated.
Thanks.You can also use dbms_schedular to execute any shell or batch file - i guess ->
BEGIN
-- UNIX
DBMS_SCHEDULER.create_job(
job_name => 'unix_command_job',
job_type => 'EXECUTABLE',
number_of_arguments => 1,
job_action => '/bin/ls',
auto_drop => FALSE,
enabled => FALSE);
DBMS_SCHEDULER.set_job_argument_value('unix_command_job',1,'/tmp');
DBMS_SCHEDULER.set_attribute('unix_command_job', 'credential_name', 'TIM_HALL_CREDENTIAL');
DBMS_SCHEDULER.set_attribute('unix_command_job', 'destination', 'marge.localdomain:65001');
DBMS_SCHEDULER.enable('unix_command_job');
END;For details ->
http://www.oracle-base.com/articles/11g/SchedulerEnhancements_11gR1.php
http://www.oradev.com/dbms_scheduler.jsp
http://www.psoug.org/reference/dbms_scheduler.html
Regards.
Satyaki De. -
How to call sqlldr utility in stored procedure
Hi,
i want to call sqlldr exe from stored procedure.
Regards,
Tushar Josihuser12044491 wrote:
currently i am working on oracle release 10g R2.
i am not very much sure whether all CTL option are available in the external table.Before you decide on the method you should clearly understand the following. SQL*Loader is client side tool while job and external table are server side tools. Therefore, unless you are connecting to oracle from database server or file you are loading is accessible from database server, neither job nor external table will help you. And now back to your question - yes, not all SQL*Loader features are available for external tables but most of the time there is a way around it.
SY. -
How to call PL-SQL script/stored procedure from Java?
Assume I want to call a PL-SQL stored procedure from external Java program.
How can I do this?
Is there a simple "Hello world" example for this?
PeterThis forum is for Oracle only not for java
Ug -
How to call PL-SQL script/stored procedure from BPEL?
Assume I want to call a PL-SQL stored procedure from BPEL.
How can I do this?
Is there a simple "Hello world" example for this?
PeterThe database adapter supports calling stored procedures. There is an example called "File2StoredProcedure" that you can use as a reference to get started.
-
Can crystal allow to call procedure from a procedure?
Hi,
Currently I am using crystal to call a procedure. The procedure will call another procedure by doing some insert statement in the second procedure. I heard that this could not be work, is that true? Is there any other way to do?here is an example of a procedure calling another procedure to do the insert:
SQL> create table test_tab
2 (id number);
Table created.
SQL> create or replace procedure procedure_1 as
2 begin
3 insert into test_tab
4 select nvl(max(id),0)+1 from test_tab;
5 end;
6 /
Procedure created.
SQL> create or replace procedure procedure_2 as
2 begin
3 -- now we call the other procedure
4 procedure_1;
5 commit;
6 end;
7 /
Procedure created.
SQL> execute procedure_2;
PL/SQL procedure successfully completed.
SQL> select * from test_tab;
ID
1
SQL> execute procedure_2;
PL/SQL procedure successfully completed.
SQL> select * from test_tab;
ID
1
2 -
Calling a Function inside a procedure
Can you call a function inside a procedure?...if so....how?
Not all built-in functions can be used directly in an assignment.
SQL> CREATE PROCEDURE p (p_val IN VARCHAR2) AS
2 l_v VARCHAR2(10);
3 BEGIN
4 l_v := DECODE(p_val,'YES','TRUE','FALSE');
5 END;
6 /
Warning: Procedure created with compilation errors.
SQL> show error
Errors for PROCEDURE P:
LINE/COL ERROR
4/4 PL/SQL: Statement ignored
4/11 PLS-00204: function or pseudo-column 'DECODE' may be used inside
a SQL statement onlyTTFN
John -
Function called by what PL SQL procedure
Hello.
I want to see all the callers of a PL SQL function. I know it is called by some PL SQL procedures in a package. How do I see who calls the function?
Thanks.i think you can try this : select * from
user_dependencies where type = 'FUNCTION' actually, that what should what things are referenced by your function
and you'd be better off with ALL_DEPENDENCIES, since references can cross schemas.
select name, type from all_dependencies
where referenced_owner= 'ME'
and referenced_name= 'MY_FUNCTION'
and referenced_type ='FUNCTION'
this will show what other things are using your function. if it's used by a package, it will not show the exact procedure or function within that package. -
How to call a sql server stored procedure from oracle
Hi all,
Please anybody tell me how to call a sql server stored procedure from oracle.
I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
"dbo"."CreateReceipt"@hsa
where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
my database version is 10g
Please help me how can i call it... I need to pass some parameters too to the SP
thanking youhi,
thank you for the response.
when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
my code is,
declare
c INTEGER;
nr INTEGER;
begin
c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
end;
Create_Receipt is the sp which requires two parameters.
please give me a solution
thanking you
sreejith -
Call a procedure within a Procedure
hi
How can i call a procedure within a procedure
Thanks in advanceSQL> create procedure b as
2 begin
3 null;
4 end;
5 /
Procedure created.
SQL> create procedure a as
2 begin
3 b;
4 end;
5 /
Procedure created.
SQL>
Maybe you are looking for
-
My rescue email is a deleted email and i have no idea what the answers are to my security questions- what do I do? How do I change the rescue email?
-
Hp 7510 Printer Still not able to access eFax!?
Why it is taking so long for HP to fix the issue regarding the eFax function on this printer? The reason I purchased this printer because of the fax funtion. But now, it keeps on saying "Connect to a Network"? will it is printing wireless from my pho
-
Files in NFS share not visable
I'm trying to install Solaris 10u4 from a Netra T1-200 install server. The client is a Sun Enterprise 5000, it boots fine during the network install but gives the error "The directory you specified doen not contain a valid Solaris OS image". If I mou
-
Internet Suddenly Stopped Working
Hi, My eMac, running 10.2, suddenly stopped working with my Internet. It shows my router, but when I open a browser, it says it can't find the server. However, my iTouch and laptop can both load with the same router and modem. Does anyone know what I
-
How can I turn off the mirroring image function at facetime
Hi there, I found that the FaceTime is showing a mirrored image and there is no option to turn off in there. Is there any way that I can turn off this function. FYI, I have to connect a new webcam as a front camera on my Macbook Air and show the whit