how many functions and Procedures are exist in Package. Is it possible to identify through query.
Eg: I have one Package:- ABC. This ABC package having 2 functions and 3 procedures. I want, total no.of functions and total no.of procedures through query.
Why do stored procedures and functions improve performance?
A. They reduce network round trips. B. They reduce the number of calls to the database and decrease network traffic by bundling commands. C. They reduce the number of calls to the database and decrease network traffic by using the local PL/SQL engine. D. They allow the application to perform high-speed processing locally. E. They postpone PL/SQL parsing until run time.
I think the answer should be A and B but i came across answers as B and E Can u explain me what is the difference between option A and B and does it postpone parsing till run time?
I'm trying to determine which procedures (in or out of packages), triggers or functions insert to or update particular tables in Oracle 10.2.0.4.I've got a far as looking at user_dependencies, and have written the following sql based on that:
This isn't how I'd write the code for production, it's just research code at the moment.
This tells me most of what I need to know, but it doesn't allow me to remove those procedures etc that just select from the table I'm interested in. The vast majority of the dependencies are just selects. In a previous role I used SQL Server 2000 and I could get this information from sysdepends, filtering on the resultobj column to remove the select only dependencies - so I'll be a little surprised if Oracle doesn't have this facility.
I have my database structured to where i have my tables, constraints, and Rows populated in each table which is 4 tables in particular. for one I want to be able to List all four tables with its content and constraints all at once. What i want to with the PL/SQL is to be able to program a prompt to where the user can just enter the individual order information and the data goes to what ever appropriate column or Table it needs to go to. Now should I be mostly be using procedures, functions or triggers to make this possible.
I could execute a package for eg if i had a package with procedures related to statistics and i run them each night, could i just do an exec on the package and it would run all those procedures??
Its not possible but i could call each procedure from ONE procedure
By referring through net I have written the following PCK file. I have installed my Oracle 11g database in VirtualBox(Win XP). I can able to select the tables using query from the host(Windows 7)
CREATE OR REPLACE PACKAGE APEX_SYS_PCK AS TYPE refcursortype IS REF cursor PROCEDURE GET_USER_DETAILS( D1 OUT refcursortype, P_USER IN VARCHAR2, P_PASS IN VARCHAR2);END APEX_SYS_PCK; / CREATE OR REPLACE PACKAGE BODY APEX_SYS_PCKAS PROCEDURE GET_USER_DETAILS( D1 OUT refcursortype, P_USER IN VARCHAR2, P_PASS IN VARCHAR2) IS BEGIN OPEN D1 FOR SELECT * FROM APEX.PERSONS; END GET_USER_DETAILS; END APEX_SYS_PCK;/
When I try to run the script I am getting the following error. How to solve this problem?
Project: sqldev.temp:/IdeConnections%23vAPEX.jprF:PACKAGESAPEX_SYS_PCK.sqlError: PL/SQL: Compilation unit analysis terminatedError(1,14): PLS-00905: object APEX.APEX_SYS_PCK is invalidError(1,14): PLS-00304: cannot compile body of 'APEX_SYS_PCK' without its specification
i want to do a schema export from Database A. There are hundreds of users under this schema.I have to import this schema into other database say B. My question's are:
1) Do i need to pre-create only schema user or all the users under it.
2) Will the schema export all the roles,procedures,packages,synonyms,funsctions and triggers?
I have huge package having numerous procedures. Therein there is one wrapper procedure which is invoked from front end and which in turn calls other stored procedures within the package. The stored procedures called return the result to the wrapper procedure which in turn calls other stored procedures.
The ultimate result is returned to the calling environment by the wrapper procedure itself.I need to know the time taken in totality by the wrapper procedure along with the individual execution time of each procedure called by the wrapper procedure. I am not allowed to modify the code for adding timestamp capturing though.
1- I do not have access to TOAD for Oracle yet 2- I can connect to SQLPLUS: Release 9.2.0.1.0 3- We have many stored procedures in packages that are available from the TOAD for Oracle interface 4- I need to be able to see the specs/body of some packages containing some procedures. 5- I am connected to the appropriate DataBase1 (for example), but from here what to do from SQLPLUS command prompt ?
For example: SchemaName1.PackageName1.ProcedureName1
I'm trying to create multiple functions, add them then minus 1 in a package. I'm at my wits end as to what I'm not doing correctly as the package gets created fine but the package body is giving me compilation errors.
create or replace package addfunction as function q1 (num1 IN NUMBER, num2 IN NUMBER) return number; function q1 (num1 IN NUMBER, num2 IN NUMBER, num3 IN NUMBER) return number; END; /
[code].....
Warning: Package body created with compilation errors
I have a table which contains 2 main columns apart from other columns. These two columns are REC_ID and ENTRY_DATE_TIME.
In this table data is inserted through a data load process using SQL Loader. REC_ID is populated to table through a sequence and ENTRY_DATE_TIME is populated as a sysdate.
select rec_id, to_char(entry_date_time, 'dd-mon-yyyy hh24:mi:ss') entry_date_time from itpcs_grt_oa_tran_rdpk_stock order by 1;
If we see the data, then time for REC_ID 4 is less than REC_ID 3.
Now the question is if REC_ID is populated through a sequence then sequence 3 must have been created before REC_ID 4 and if so then why the ENRTY_DATE_TIME of REC_ID 4 is less than REC_ID 3.
Further to the question, how data is written in tables. What steps are performed by at database level when we any DML(insert) is performed.
My DB Version : Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
SQL> CREATE OR REPLACE TRIGGER TRI_COMPL_FEATURES 2 AFTER INSERT OR UPDATE ON COMPLEMENTS FOR EACH ROW 3 DECLARE 4 v_fno NUMBER; 5 v_tab VARCHAR2(30); 6 v_unique_id VARCHAR2(40); [code]....
Trigger created.When I am trying to insert into complements table it is throwing error as follows:
SQL> insert into complements values(19,NULL,'5',6,7,NULL,'W2023648',NULL,NULL); insert into complements values(19,NULL,'5',6,7,NULL,'W2023648',NULL,NULL) * ERROR at line 1: ORA-20010: ORA-04091: table TEEMNGWS.COMPLEMENTS is mutating, trigger/function may not see it ORA-06512: at "TEEMNGWS.TRI_COMPL_FEATURES", line 19 ORA-04088: error during execution of trigger 'TEEMNGWS.TRI_COMPL_FEATURES'
I can understand that I am trying to perform DML operation(i.e select) on table which trigger is fired.But how can I implement the same logic when AFTER INSERT OR UPDATE trigger is written.
I just want to know whether can i create a trigger where the sysdate can be automatically written into a table? for ex: if to_char(sysdate,'HH24:MI:SS') = 18:00:00 then it should be written in a table..?? is there anyother way instead of triggers??
I am trying to find if there is a way to know how much data has been written on tape on a 'in progress' rman backup. rman session is also connected with recovery catalog.
is there a way to find-out how much data is transferred per rman channel onto tape? what is backup speed we are getting?
I want written English characters only in text item (I want control in one text item), in my form 10 g but, in same form can be written other language in other text item.
I need to find out in DB Package where this Package is installed (in which schema). The problem is this DB Package can be installed in various schemas. This means that I can't use select user from dual or system environment SYS_CONTEXT('USERENV', 'OS_USER').
I have a package with several procedures which raise and catch an error if a foreign key constraint has been violated. I put the the following code in my package body:
Now all the procedures inside the package which catch this exception in the EXCEPTION block work fine. I would like to be able to use that exception outside of my package as well though, how would I do this?
whats the best way to modify a table via a procedure for example if i have a table with records: id, fn, ln, address, tel, dob
how would i go about creating a procedure that modifies a record. The problem is what param needs to go in? i could certainly have different procedures that modify different things like one for modifying tel, one for modifying address, but is there a way to combine it all into ONE procedure so that if user wanted he could put in exec modifyTable(2, 099898787) to modify tel and then modifyTable(2, 'a new address') to modify address... ?
we are doing a performance tuning on a large database. Our main aim is to capture all the packages/procedures/view that are running on database. Below given is the format we have prepared
Eg: SPIdSP_Name CPU TimeI/OLine Executed 1Emp_AllDetails221 1Emp_AllDetails582 1Emp_AllDetails25103
[code]...
Requirement:Write an Procedure that captures the above given information in the background of database and stores the information in a table.write the procedure to capture the above given information.
I come from a Microsoft SQL background and am having trouble adjusting to the PL/SQL syntax. I'd like to build this up to pass back a certain value back into a web form.
IF (SELECT COUNT(*) FROM EXCURSION WHERE EXCURSION_ID = 75)= 1 THEN DBMS_OUTPUT.PUT_LINE 'True'; ELSE DBMS_OUTPUT.PUT_LINE 'False'; END IF;
I'm having trouble writing values out at the moment