Check if target schema procedure/view/relax/package name...
As part of the dismantling of the schema, I'm in the process of validation if the schema (say X) is referred to in the procedures/relaxation/view/package in the schema to another (say Y or A or B).Schema X is ABOVE in diagrams 'Y' and 'A' in the code of procedures/relaxation/view. Because this scheme X is removed, I want to make sure that the 'X' schema is not mentioned in others.
Please highlight how I can validate for the above scenario
Hello
According to me you should check
select owner, synonym_name from dba_synonyms where table_owner = 'Schema to be deleted'
select owner, name from dba_source where upper(line) like '%Schema to be deleted%'
Due to the first query can be an object becomes invalid, and then check which packages voided, or you can use dba_dependencies view to find the object
Concerning
Anurag Tibrewal.
Tags: Database
Similar Questions
-
ODP 12 c version 3 with EF 6.1.1 I can't add Stored Procedure of a package to my model
I use the ODP 12 c Release 3 (12.1.0.2.1), with Entity Framework 6.1.1 with the first database in MS Visual Studio 2013 update 4
I have a MVC 5 (.Net Framework 4.5.2) project that connects to Oracle 11 G R2 Database server, an existing database (Tables, views and a pack of Stored procedures)
I can add tables and use them successfully in my model
I can add a simple stored procedureHere's the problem:
I have my .edmx file right click and click on "update model from database...". «, on the 'Add' tab, I chose «Stored procedures and functions»
I can see the list of procedures stored in the package (format packageName.usp) and check the box for the stored procedure of my package, then click 'Finish' to start the update process.No stored procedures have been added to my Model.Store
The only possible exit I get the 'entity data model' is:
Generated template file: Model1.edmx.
Loading metadata from the database took 00:00:00.5803351.
The model generation took 00:00:00.3761861.How to add a stored procedure from a package with the Entity Framework 6.1.1?
I found the answer.
When in the edmx model and you right click "Update Model database.
Uncheck "Import selected stored procedures and functions in the entity model", select the package and update procedures. (It works)
Then in "Model Explorer" under "Model. Store\ stored procedures/functions" you will see your procedures in the package (finally). Then their card in "Function Imports".
I don't understand why unchecking import stored procedures works, but it does.
I also found easier to simply call the procedure directly and not using Entity Framework, as all my procedures are: insertion, update and deletions and not all parameters mapped on the model for the view.
-
Error schema and PL/SQL package?
Dear experts,
I use Oracle SQL Developer. When I compile the following procedure in my package, I get errors:
- Error (5.5): PL/SQL: statement ignored
- Error (7,18): PL/SQL: ORA-00942: table or view does not exist
create or replace - line 1
PACKAGE BODY TEST_AUTO_COOP AS
procedure testDBAccess AS
Start
with maxlinenum as)
Select APPLICATION_ID, max (NAME_NUM) as max_ln
of KPPCM. V_ADD_COENT_GGPL_SOLD APPLICATION_ID group
After max (NAME_NUM) > 1
),
coApps like)
Select tmp1. APPLICATION_ID as APPLICATION_ID2, tmp1.max_ln,.
TMP2. APPLICANT_SSN as Co_SSN
of tmp1 left join maxlinenum
KPPCM. V_ADD_COENT_GGPL_SOLD tmp2
on tmp1. APPLICATION_ID tmp2 =. APPLICATION_ID
and tmp2.NAME_NUM = 1
)
Select count (*) in the countrow of coApps; -line 19
end testDBAccess;END TEST_AUTO_COOP;
I have all access. When I copy the code from line 5 on line 19 in a different worksheet SQL (Oracle SQL Developer), it works well.
KPPCM is not my schema. How to fix the error?
Thank you
Make sure your username have direct grant select on the table or view, without going through a role.
Select * from user_tab_privs where table_name = 'V_ADD_COENT_GGPL_SOLD '.
-
Mergeing multiple procedures in one package?
Hello gurus,
I m moving data from a diagram i, e la source (SRC) schema to the schema an another i, e target (trg) table, only selected columns of a few tables (i, e for 4 tables)
I m, writing procedures to achieve and maintain this procedure a planner on a daily basis to load
I m 4 procedures of writing for each of the table... is the procedure that I got
same procedures for table 3 and table 4...create or replace procedure mov_tbl1 is cursor tbl1_cur as select src.col1, src.col2, src.col3, src.col4 from source.tbl1 src where col1 = ' xyz' tbl1_cur_rec tbl1_cur%rowtype; begin for tbl1_cur_rec in tbl1_cur loop insert into tgt.tabl1(col1,col2,col3,col4) values ( tbl1_cur_rec.col1, tbl1_cur_reccol2, tbl1_cur_rec.col3, tbl1_cur_rec.col4); commit exception when others then rollback; end loop; end; ---for table 2 create or replace procedure mov_tbl2 is cursor tbl2_cur as select src.col1, src.col2, src.col3, src.col4 from source.tbl2 src where col3 = ' abc' tbl2_cur_rec tbl2_cur%rowtype; begin for tbl2_cur_rec in tbl2_cur loop insert into tgt.table2(col1,col2,col3,col4) values ( tbl2_cur_rec.col1, tbl2_cur_reccol2, tbl2_cur_rec.col3, tbl2_cur_rec.col4); commit exception when others then rollback; end loop; end;
Here's my question...
I m back to writing packets... all help is greatly appreciated... Thank you so much gurus!1.How can i build a single package for all these four procedures in one package ??? 2. ANd i don't want to call each procedure every time ...so can i do it by passing parameters ??? how can i accomplish that ??
First your code does not compile because the exception block is inside the loop while begin and end are on the outside.
You must decide whether a row error should invalidate the full load or if the wrong single line must be rejected, but all other lines have been downloaded.
I guess you need that last so I change the code as follows:create or replace procedure mov_tbl1 is cursor tbl1_cur as select src.col1, src.col2, src.col3, src.col4 from source.tbl1 src where col1 = ' xyz' -- 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,col3,col4) values ( tbl1_cur_rec.col1, tbl1_cur_reccol2, tbl1_cur_rec.col3, tbl1_cur_rec.col4); -- REMOVED COMMIT, Commit outside or at the end. exception when others then null; -- May be is better to (somehow) log the error ... end; end loop; end;
On the package, create you it in this way:
create or replace package p is procedure upd (tab1 in boolean, tab2 in boolean, tab3 in boolean, tab4 in boolean); end; / create or replace package p is procedure upd (tab1 in boolean, tab2 in boolean, tab3 in boolean, tab4 in boolean) is begin if tab1=true then mov_tbl1; end if; if tab2=true then mov_tbl2; end if; if tab2=true then mov_tbl2; end if; if tab2=true then mov_tbl2; end if; end; procedure mov_tbl1 is cursor tbl1_cur as select src.col1, src.col2, src.col3, src.col4 from source.tbl1 src where col1 = ' xyz' -- 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,col3,col4) values ( tbl1_cur_rec.col1, tbl1_cur_reccol2, tbl1_cur_rec.col3, tbl1_cur_rec.col4); -- REMOVED COMMIT, Commit outside or at the end. exception when others then null; -- May be is better to (somehow) log the error ... end; end loop; end; procedure mov_tbl2 is ... procedure mov_tbl3 is ... procedure mov_tbl4 is ... end; /
You can call the procedure upd (calling others) this way:
begin p.upd(true,false,true,false); end; /
Update only table1 and table3.
Max
http://oracleitalia.WordPress.com -
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.
-
fusion of procedures in the package and calling with common proc?
Hello
I wrote similar procedures... and I'm calling each procedure separately and transmitting his values...
something like that
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?begin mov_tbl1(1234); end then again similarly for begin mov_tbl2(1234); end;
I m bit confused, if you want to use the parameter or parameter... .i am beginner in writing packages... :))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;
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 -
Is it possible to have the source and target schema in the same instance of DB?
Hi all
I'm using Oracle 11 g 1 material.
I spent another source than with OWB server locations.
In the course of deploy I get VLD-3064 and I can't deploy mapping due to the many warnings "table or view does not exist.
Is it possible to have the source and target schemas in the same case?
How to do?
Kind regards
MartinHi Martin!
1. the target schema have select rights for source-tables/views.
(Run as a user with dba rights: grant select onto ;). 2 «.. . none generated code will use the link dataabase...'.
This is only a warning and means there is no need to use a database link. If your mapping will be executed faster as using a database link.Greetings
Guenther Herzog -
Original title: microsoft difficulty 50747
I can't uninstall microsoft silverlight. I get the message that I need to check with the installer of the hotfix package. Pls help!
Hello
Because the problem is related to Silverlight, I suggest you post this question in the Microsoft Silverlight forum.
-
Procedure call to the procedure in one package
Hello
I need help to call a procedure within a package.
I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.
Thanks in advance
I need to call the procedure procedure Y X that belongs to the same package.
Just make sure that this procedure that is has been defined before the X procedure in the package body. However, there no need this if the two procedures are also defined in the package specification.
-
Hello
I need help to call a procedure within a package.
I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.
Thanks in advance
I have an ABC package in which I have 3 X Y and Z I procedures I need to call the procedure procedure Y X that belongs to the same package.
This forum, as the title suggests, is for developer Sql questions only and NOT for questions of SQL or PL/SQL.
If this is not related to Sql Developer then please mark ANSWERED and repost it in SQL and PL/SQL forum
https://community.Oracle.com/community/Developer/English/oracle_database/sql_and_pl_sql
During the validation you must provide your name and full version.
You must also explain why even need help because procedure X can call just procedure Y directly since they are in the same package.
For an Oracle DB, see documentation and examples of ' packages of PL/SQL to help "in the doc of the PL/SQL language
http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/packages.htm#CIHIJECJ
-
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.
-
Execution of a procedure in a package
Hello
How to run a procedure in a package? Here is the package
CREATE OR REPLACE PACKAGE BODY POPULATE_GLTD_TABLES
IS
-LOCAL VARIABLES
VARCHAR2 (10) val1;
-Create work items:
v_job1_str VARCHAR2 (4000);
v_job1 XXMCK. XXMCK_JOB_OT;
PROCEDURE populate_gltd_tabs1
IS
BEGIN
dbms_output.put_line ('Get_status = > v_job1: ');
val1: = F_CHECK_GLTD_RECORD_EXISTS ('MCK_GLTD_1');
IF Val1! s ="THEN
--
-Understand the value of details message - TRUE if yes and FALSE if no
--
xxmck.mck_write_log_msg.set_msg_tail (true);
--
xxmck.mck_write_log_msg.purge('GLTD-TASK1');
--
-together framework will define the source so that inserts data into the table of output cont
--
xxmck.mck_write_log_msg.set_Context(v_parent_program,v_prog_desc,'GLTD-TASK1');
--
xxmck.mck_write_log_msg.log (v_parent_program, "enter in LOAD_GLTD_TABLES.populate_gltd_tabs1', 'prg', 'GLTD-TASK1', 1");
--
xxmck.mck_write_log_msg.log_tail (v_parent_program, "enter in LOAD_GLTD_TABLES.populate_gltd_tabs1', 'prg', 'GLTD-TASK1'");
--
v_job1_str: = ' XXCOGNOS. LOAD_GLTD_TABLES.populate_gltd_tabs1;';
v_job1: = NEW XXMCK. XXMCK_JOB_OT ('GLTD-TASK1', v_job1_str, ' test of substantive work: LOAD_GLTD_TABLES.populate_gltd_tabs1 ', INTERVAL ' 60' SECOND ');
v_job1. PRINT(); -Display of the basic information about the work
v_job1. SUBMIT(); -Propose in the background
v_job1. WAIT();
v_job1. PRINT();
v_job1.get_Status (v_code, v_message);
dbms_output.put_line ('Get_status = > v_job1: ' | v_code |) ':' || v_message);
-SELECT DECODE (cont_exit, 'cont', 'cont', 'err', 'err', 'cont') IN v_result of MCK_LOG_CONT_EXIT_CHK WHERE source = 'GLTD-TASK1;
-IF v_result = "err" THEN
-raise_application_error ("-20000, ' program Aborted");
-END IF;
END IF;
EXCEPTION
WHEN OTHER THEN NULL;
END populate_gltd_tabs1;
PROCEDURE mainproc
IS
BEGIN
populate_gltd_tabs1; -CALL to FILL in mck_gltd_1 TABLE
--
-Mailing
--
xxmck.mck_write_log_msg.send_mail (p_source_prg = > v_parent_program)
, p_source = > 'GLTD-TASK1.
, p_msg_type = > 'prg '.
, p_from = > '[email protected] '.
, p_to = > '[email protected] '.
, p_server = > 'mailhub.mckinsey.com '.
);
EXCEPTION
WHEN OTHER THEN NULL;
END mainproc;
END POPULATE_GLTD_TABLES;
/
And here's my anonymous block to run above package
BEGIN
POPULATE_MCK_GLTDFILE.mainproc;
EXCEPTION - begin exception handler
WHEN OTHER THEN NULL;
END;
I am trying to run above the code into a toad. But I get the error message like: identifier 'POPULATE_MCK_GLTDFILE.mainproc' must be declared.
There is no parameter to pass.
The package is compiled successfully.
I think this must be the easiest question anyone I can ask, but I can't understand the solution.
Help, please
AdityaTry this (you are using the wromg package name)
BEGIN
POPULATE_GLTD_TABLES.mainproc;
EXCEPTION
WHEN OTHER THEN NULL;
END;Published by: Saran on January 13, 2012 01:38
Published by: Saran on January 13, 2012 01:38
Published by: Saran on January 13, 2012 01:40
-
How many procedures in a package?
Could you tell me if there is a limit to the number of procedures or kilobytes that can hold a package? I have an old Oracle version 8.1.7.
Thank you!Mark1970 wrote:
But this means that there is not a real limit in kilobytes for the insertion of procedures in a package?
No it does not mean that this means there is a limit of 64 KB and this is measured in knots of DIANA, and DIANA nodes are not easy to count.
In the shared pool, a package spec, specification of object type, stand-alone subprogramme or anonymous block is limited to 64 nodes DIANA K.
>
At the theoretical level, I can write and compile a package og several procedures and many MB?
Regardless of technical limitations, it is not a good idea to create code units that are as big as possible.
-
Is it possible to create a schema bound view.
A view with SCHEMA BINDING option locks the tables being referred to by the view and prevents any changes that could change the schema of the table.N ° Oracle doesn't have such a feature.
I would be very interested, why SQL Server is this?
What are the cases of using this feature?I do not think we, Oracle-Land, need this feature.
-
How to extract the version no of application by its package name or app
Hi all
I want no application by its package name or app version, how can I do please suggest.
Type 'version number' in the search box and watch Threads that arise.
Maybe you are looking for
-
Need win 7 drivers for Qosmio X 300
Hello I had to format my laptop and I need some drivers for Windows7.Is someone can give me those? Can't find them on the Pages of pilot. Drivers for:/ Manager of controllers with remote-Touch Pad Driver Can someone help me with this?
-
Satellite A300 - whenever it recharges
I have an A300 T9400 / 4GB / 320GB with Vista 32. Whenever it starts on windows, it shutsdown detecting and resart again. Sometimes it can take a few seconds, enough to give the user and the password on Windows, but if I boot to safemode with network
-
For a long while now my desktop iMac product a light but frequent or the gurgling. Usually when he treats, but sometimes it just keeps going. It existed long before El Capitan and now with it. The Mac is 5 years, 27 inches. I assumed it was normal, b
-
Numerical integration of acceleration and speed
I control a differential robot mounted by two motors. I use encoders to detect the movement of the robot. I kinematic equations for the linear and angular speed of the robot using wheel from coders speed reading. Now, my problem is how to make digita
-
I have acauired a few analog signals by A/D (3 channels). I put each scanned data on 3 digital output with a microcontroller. I want to see if it is possible to import these digital outputs 3 to a PC via a USB-6008? It's like the connection of the ou