fusion of procedures in the package and calling with common proc?
HelloI wrote similar procedures... and I'm calling each procedure separately and transmitting his values...
something like that
begin
mov_tbl1(1234);
end
then again similarly for
begin
mov_tbl2(1234);
end;
My question is how to merge these two procedures in one package and call them with a common procedure and pass the value (var_id) once for procedures?
create or replace procedure mov_tbl1 ( var_id number) is
cursor tbl1_cur as
select src.col1,
src.col2,
from abc_tbl1 tbl1,
abc_tbl2 tbl2
where tbl1.no = var_id -- this is variable i m trying to make it as a paramter in common proc
tbl1.id = tbl.id
-- the record variable declaration is implicit in FOR LOOP
begin
for tbl1_cur_rec in tbl1_cur
loop
begin
insert into tgt.tabl1(col1,col2)
values (tbl1_cur_rec.col1,
tbl1_cur_reccol2,
);
exception
when others then
null;
end;
end loop;
end;
create or replace procedure mov_tbl2(var_id number) is
cursor cur_tbl2
select col3,col4, col5
......
from abc_tbl1 tbl1,
abc_tbl2 tbl2,
abc_tbl3 tbl3
where tbl1.no = var_id and --this is variable i m trying to make it as a paramter in common proc
tbl1.id = tbl.id and
tbl2.dept = tbl3.dept
begin
for ...
loop ...
insert into ...
values....
....
end;
I m bit confused, if you want to use the parameter or parameter... .i am beginner in writing packages... :))Ideas or examples is greatly appreciated! Thank you very much!!
Check if all parameters have been assigned to certain values.
And call the procedure that is packaged with the following syntax.
Begin
.(parameter_value);
end;
i.e.
Begin
TEST_PACK.COMMON_PROC(1234);
End;
Can you post the code here so that we can have a look at what goes wrong.
Here is a test package I ran
PRAZY@11gR1> create or replace package test_pack as
2 procedure common_proc(var_id number);
3 end;
4 /
Package created.
Elapsed: 00:00:00.00
PRAZY@11gR1> create or replace package body test_pack as
2 procedure private_proc1(var_id number) as
3 begin
4 dbms_output.put_line('FROM PROC1 :'||var_id);
5 end;
6
7 procedure private_proc2(var_id number) as
8 begin
9 dbms_output.put_line('FROM PROC2 :'||var_id);
10 end;
11
12 procedure common_proc(var_id number) as
13 begin
14 private_proc1(var_id);
15 private_proc2(var_id);
16 end;
17
18 end;
19 /
Package body created.
Elapsed: 00:00:00.04
PRAZY@11gR1> begin
2 test_pack.common_proc(100);
3 end;
4 /
FROM PROC1 :100
FROM PROC2 :100
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
Kind regards
Prazy
Tags: Database
Similar Questions
-
Debug/run procedures within the package
Debugging with SQL Developer was generally very nice and I have come to rely on these tools. Today, I've written a procedure in a package and I want to debug this process, but I don't see it in the list of targets. It seems that I see only functions in the target list. I understand that the procedures need not have the same kind of output in function, but sometimes I like to create procedures that have multiple SETTINGS, especially when it comes to an exit very closely related.
The interesting thing is that I can create this same procedure as a stand-alone procedure and the run/debug works great. Apparently I'm missing something obvious in SQL Developer somewhere I thought it was there all the time (I guess for a while since I've written a procedure with OUT parameters) but maybe I'm wrong. Any ideas or help someone?
Earl
It should work.
Is that you can create a package of simple heel with just a function procedure that is a NULL; and use it as a test?
If this does not work there either, please send a screenshot so we can see what you see in the debugging with the missing procedure dialog box.
-
I use iphone 5 s updated to 9.2, but I can't use the network and call someone help me please
What happens when you try to use the network?
-
Help! My iPod Classic 120 G froze. Pale = 'Media-In' and display the screen = "OK to disconnect with a bar in the middle." Tried the reset procedure, press the "Menu and Center." Without success. Any ideas?
See Re: corrupted iPod classic. If she does not really have a reset set it aside and let the battery completely discharge. It should reset itself when you load again.
TT2
-
I broke the seal on the package and it doesn't have the product key inside as management on the State of the computer. There are several codes outside of the package, but none of them work. The seal have the CD number. VUT01.015 second line LD00800D000. There is a sticker with W148629. Barcode here 88222427124. I bought the computer from Circuit City about 2 years ago.
Help, please. I need to reinstall Vista as soon as possible.
I broke the seal on the package and it doesn't have the product key inside as management on the State of the computer. There are several codes outside of the package, but none of them work. The seal have the CD number. VUT01.015 second line LD00800D000. There is a sticker with W148629. Barcode here 88222427124. I bought the computer from Circuit City about 2 years ago.
Help, please. I need to reinstall Vista as soon as possible.
The product key is outside the body of the computer and, possibly, in the battery of your laptop.
-
[Training] The package and the launch does not work
I try to use the "Package and launch" option in the drive and doesn't seem to work.
I've specified that correcting the IP and the password as the playbook in the settings. I get the message "Build successful" but the Simulator does not launch the app. He remains in the home screen.
REF: I checked and the Simulator is sensitive.
Thank you.
Reset the Simulator toured (took a few resets for me).
-
Hello. Accidentally, I bought the Adobe Lightroom 6 box set (CD ROM) support when I need to download the application. I opened the package and now can not return it. Is there a way I can be provided with a license so that I can download the software and avoid paying twice for the product? I can return the package open, if necessary. He was ordered on Amazon.ca. Thank you
Use the serial number located inside the retail box to save the download version
Download & install instructions https://forums.adobe.com/thread/2003339 can help
-includes a way to go to a page to download the Adobe programs if you do not have a disk or drive
-
Can only establish us a specific procedure in the package body?
Hi experts
Say we have a package as follows:
package my_package
a procedure;
procedure b;
procedure c;
end packege my_package;
my_package package body
procedure a
is
....
end;
procedure b
is
....
end b;
procedure c
is
....
c end;
end of packet my_package;
I want to only change the procedure has, should I compile the body together for this? Can I do to compile the procedure like the following?
create or replace the my_package.procedure one
is
....
end my_package.a;
Thank you
Hello
No, you must recompile the entire body. There is no way to compile a procedure in the package.
-
Can not connect with the Adobe server to upgrade the PS. Tried with fiervall and the router and called my provider. She is also only CC there are problems!
Check your hosts file.
help for that and other adobe.com sure common connection problems read, http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
-
What is the difference between the function declared in the package and the CIP
What is the difference between the definition of a function in the package and package body?
Published by: user10641405 on November 19, 2009 13:29If you describe a package, you will see only the functions declared in the spec.
If you declare only in the body but are not available to other packages (they are private to the package, non-public) -
I am a representative of Microsoft online. I write on behalf of the client.
When I try to download the patch of day light savings time I get message saying to mistake my "files from the package are incompatible with files on your system. It is a valid installation of Windows XP Home Edition and the disc. Laptop has code and valid sticker. I need the advance of patch.
Pat
Hello
What region are you located?
I suggest you follow the steps described in the following link:
http://support.Microsoft.com/GP/dst_webcasts
Check also on the following link:
-
I've updated VIA / S3G UniChrome IGP plug-and-play reverse, but the update still no resolution 1600 x 1200 with the exception and others with the same ratio of 4 x 3. That did not help.
Hello
- What version of Windows are you using?
- What is the brand and model of the computer?
I suggest to run the patch from the following link and check the status of the issue.
Hardware devices do not work or are not detected in Windows.
http://support.Microsoft.com/mats/hardware_device_problems/en-us
If the problem persists, I suggest you to send us more information to help you better.
-
original title: administrator problem
I am the administrator with a password (in fact the only user of my computor) but continue to receive messages telling me that what I want to do is forbidden by the administrator and verify with the system administrator. How to work around this problem? My os is Vista Home Premium.This happens more frequently when I try to remove a program
According to what "program", you tried to 'delete '.
If one of these programs to the system, you will get the message.
If it's one of those programs that you have installed from the web, try one of these programs to "Uninstall" part 3:
Revo Uninstaller 1.91
http://download.CNET.com/Revo-Uninstaller/3000-2096_4-10687648.HTML?tag=mncolIObit Uninstaller 1.1
http://download.CNET.com/advanced-uninstaller-free/3000-2096_4-75157230.HTML?tag=mncolAdvanced Uninstaller Free 10.1.1
http://download.CNET.com/Revo-Uninstaller/3000-2096_4-10687648.HTML?tag=mncolFor the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.
-
Need to insert the Date and time with AM or PM
StartDate form has ' 25/07/2006' and Starttime "13:07.
I need to add this field in the database to display the Date and time with the AM or PM. But the result I get is false.
<! - concatenate fields - >
"< cfset Startdate = #Startdate # &" "& #starttime # >.
< cfset startdate = #DateFormat (CreateODBCDateTime (Startdate), ' mm/dd/yyyy hh: mm: tt ') # >
Here is my production. This is not the AM or PM conversion part of the chain.
25/07/2006 01:07 am
My database is SQL 2000
You use any of dateformat. The createodbcdatetime sends the correct your DB value if you do it right.
-
How to call the procedure in the package
Hi all!
The situation!
I received a package with body priview 'Change_utility '.
In this package, I had procedure, changing the data when triger calls a package, it is all ok and working
Now, I need to call a procedure in a single package gave him.
I need to run the sta_death procedure in the 'Change_utility' package with no code 112233-4455
How do I run that?
Thanks for the help!
IDMaybe (guessing)
begin change_utility.sta_death('112233-4455'); end;
Concerning
Etbin
Maybe you are looking for
-
The Windows Developer Preview expires in 2013/115?
my windows 8 dev. Prev. expire in 2013/115 my is that beta? normally it will be completed in March .photo of cabin of the image:http://desmond.imageshack.us/Himg23/scaled.php?server=23&filename=64074771.png&res=medium
-
I am trying to print a directory listing
I added to my Windows XP Printdir.bat file; However I am still not able to print a directory listing. When I right click on the folder, I get the following message: Cannot find the file c:\Docume~1\***\Locals~1\TempListing.txt He wants to go in this
-
How can I set up SCAN TO EMAIL using GMAIL for 3520e Deskjet AIO?
I have the gmail warning system installed for to send the links to open a Gmail composition window. I thought that would be enough. I watched the default parameters of the program, but that doesn't seem to apply, probably because I don't have an emai
-
Windows 7 is installed, now missing "Mass storage controller" driver (Code 28)
I installed Windows 7 (32 bit) and Bishop of device under the heading "Other devices" Windows could not find the device driver for the "mass storage controller". My motherboard is an Asus P5AD2 - E Premium. Device type: other devicesManufacturer: un
-
Hi people,I do a review of the book and need to compare the old (April 2015) and new files (November 2015) PDF. I get a crash every time. I tried to isolate very small segments (two pages) of the files and compare them. Still crashes.Here is the vers