PL/SQL :: Difference Using Cursor In Specifications And Body In Packages
Jun 24, 2013what is the difference using cursor in specifications & body in packages?
View 1 Replieswhat is the difference using cursor in specifications & body in packages?
View 1 Repliesi found this difference between ref cursor and sys_refcursor.
If you specify return_type, then the REF CURSOR type and cursor variables of that type are strong; if not, they are weak. SYS_REFCURSOR and cursor variables of that type are weak.
my situation is i have to write many stored procedure for reports and also for entery pages. few enter pages use typed datasets and few does not.
which one is better in terms of performance and maintainability in above three conditions?
what is the difference between using a cursor and using a normal for/while loop to retrieve and process the result set.
View 3 Replies View RelatedWhat is the difference between implicit cursor and explicit cursor in PL/SqL?
And what is ref cursor ?
difference between between these two constructs. Finally when i read the asktom.oracle.com , I was totally confused. The reason is thatTom says...we can retrieve more than one row in implicit cursor. If that would be case, what's the difference between these two cursors?? when to use?? My understanding was implicit cursors" ---> single-row queryExplicit cursors ---> multi-row query Experts
View 10 Replies View Relateddiffernce between strong ref cursor and weak ref cursor
View 4 Replies View Relatedcreate table eml(num numner(10),email varchar2(100));
begin
for i in 1..20 loop
insert into eml values(i,'email.'||i||'@mmm.com');
end loop;
end;
I just want to know what is the difference between below two pl/sql block, in one block i am passing the p_email_id as paramter to cursor.Both block are working fine and giving the same result.first thing , i want to know how the p_email_id is passing to cursor get_emil_info without paramter.and which is good to use, i mean without paramter or with paramter.
--without paramterised cursor
declare
v_cnt number;
p_email_id number;
TYPE email_tab is TABLE of NUMBER index by binary_integer ;
eml_id email_tab ;
CURSOR get_eml_id is select num from eml;
[code]...
--with paramterised cursor
declare
p_email_id number;
TYPE email_tab is TABLE of NUMBER index by binary_integer ;
eml_id email_tab ;
CURSOR get_eml_id is select num from eml;
[[code]...
Any ways for Debugging in PLSQL.
Ex:In a package or procedure i have thousands lines of Code how can i Debug.
I'm not sure if this belong to this place. move it to the proper place.
I'm having an annoying problem: (I'm not sure if it is a problem)
- In a package body I'm trying to delete/update/insert/select the contents of a table in other schema.
- The respective synonym exists.
- I had created a role with the respective privileges over the synonym.
- I granted the role to the package's owner.
- I try to compile the package, but it keeps returning compilation errors. (Not table found)
- In standard SQL, I can delete/insert/update/select over the table.
- The only way to compile the package, without errors, is to grant the privileges directly to the package's owner.
Is it supposed to work in this way?
NAME package
---------- --------------
Anand basic Anand pascal Juliana cobol Kamala dbase Mary oracle Mary c Partick c++ Qadir assembly Qadir c Ramesh dbase Remitha c Remitha assembly Revathi pascal Revathi basic
I am unable to locate the asm packages for rhel 5 :2.6.8-128 kernel of 32 bit.
Only 64 bit rpm are availbale on OTN.Can ayone suggeet me the URL for 32 bit>
Get following output using user_source(or other) view?
Package_nameProcedure_nameline_startline_end
ABCXYZ1022
In procedure_name column it could be any procedure, function name or any object name exist in package body.
Wanted to know whether it is possible to know a trigger is getting fired due to which all packages/procedures. If it has got fired for a particular transaction say multiple times, then wanted to get details of the packages/procedures which caused an event so that trigger got fired?
View 2 Replies View RelatedWe are experiencing an issue with ORA-04068: existing state of packages has been discarded. We're running Oracle 10.2.0.4 on Solaris 10.
I'll provide the timeline of what occurred:
1.) Last night during a maintenance window I recompiled a package and package body. I ran "create or replace" statements from a script via sqlplus to recompile both package and package body. Because I am required to do all DDL under my own login (and not the schema owner login) the scripts require that the schema name be included in the "create or replace" statements. Otherwise an object will be incorrectly created in my schema. This is what happened with the package body. I discovered this when the package body would not compile.
2.) I ran a "drop package body" statement to drop the package body from MY schema.
3.) I added the proper schema name to the script and recompiled both the spec and body under the proper schema.
4.) I ran a script to check for any invalid objects under the application user schema. There were none.
5.) During the night a batch process ran which executed the package. There were several failures with the error ORA-04068: existing state of packages has been discarded.
6.) During the early AM today the error stopped. Not knowing this at the time and believing that the issue was still occurring I began searching the internet for information regarding this issue. One site I found said this could be due to DDL being done on the object (which was the case for us) and there could be an entry in the shared pool marked as invalid which our application's session may be accessing. It recommended running "alter package recompile" for the spec and body. I did this but it seems to have triggered the event again.
I also ran utlrp.sql.
I found some information suggesting the use of DBMS_SESSION.MODIFY_PACKAGE_STATE and/or RESET_PACKAGE but I'm not seeing mention of the risks/implications.
I can verify that the object is no longer in my schema and that the proper object owner has no invalid objects. I am not sure what to do to resolve the issue or keep it from occurring again.
I am trying to use dbms_jobs in Oracle 8i database.
This is the syntax I am using:
begin
dbms_job.submit(:jobno, 'SYSTEM.SHRINK_ROLLBACK_SEGS', '07-FEB-2007', NULL);
commit;
end;
i have defined the variable jobno as number!
And i am getting the error :
*
ERROR at line 1:
ORA-04068: existing state of packages has been discarded
ORA-04063: package body "SYS.DBMS_JOB" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 2
I then go and look at the Sys.dbms_job package and see its not compiling
I have this error:
(1): PLS-00201: identifier 'ANY_INSTANCE' must be declared
(2): PL/SQL: Item ignored
(3): PLS-00801: internal error [21076]
(4): PL/SQL: Item ignored
i dont have access to any Oracle XML related pacakges, however I have to pull the data from the following xml.Eg: The alternativeIdentifier.Name should be a column and the value should be the data for the column. Same applies to other tags under characteristics tag.
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="[url]http://www.w3.org/2001/XMLSchema-instance[/url]"
xmlns:SOAP-ENV="[url]http://schemas.xmlsoap.org/soap/envelope/[/url]"
xmlns:xsd="[url]http://www.w3.org/2001/XMLSchema[/url]"
xmlns:SOAP-ENC="[url]http://schemas.xmlsoap.org/soap/encoding/[/url]"
[code]....
we have a database application which is done frequently.in these we load data throught Sql loader, we create an DB instances, we do several DML operation on the database.
now for such task in an application we need to keep an logging track of each task performed in PL/SQl procedure packages.
I am really wondering about data loading to the cloud, I've just read the documentation, but regarding the packages, I have more than 100 package and I have to "add to cart" one by one the problem is that the package body is not added by default, so you have to expand the packages one by one then select the package body right click and add to cart. This task is very tedious, is there any other options.”
View 8 Replies View RelatedI'm trying to install 11g Release 2 on a CentOS (4.9) box, but the pre-req check shows that I'm missing the following packages (I had 9 to begin):
gcc-3.4.6 (X86_64)
gcc-c++-3.4.6(X86_64)
libstdc++-devel-3.4.6
Tried to use the yum command "yum install gcc" but get the following error.
Error: cannot find a valid baseurl for repo:update
I think this is due to the "CentOS-Base.repo" file, which I've tried to update by changing the mirror URL's but no success.Then tried to find the rpms online ([URL]...
INFO: Start output from spawned process:
INFO: ----------------------------------
INFO:
INFO: rm -f ntcontab.*
[code]....
I need to figure out which Oracle Database packages are installed on a certain server.
First problem: no Enterprise Manager available. So I need some command line tools or SQL statements.
I've already found some with them I was able to spot RAC, partitioning and so on. But I'm still missing a option/command to spot
- diagnistic pack
- tuning pack
- web logic
- web server
How to export the procedure,views,function and packages in a database, by using Export commmand.
View 2 Replies View RelatedI am getting the error (ORA-29266: end-of-body reached) at utl_http.read_text. below is a code
create or replace procedure sendMail(p_fromaddress IN VARCHAR2, -- Optional
p_toaddress IN VARCHAR2,
p_bcc IN VARCHAR2, -- Optional
p_cc IN VARCHAR2, -- Optional
p_subject IN VARCHAR2,
[code]....
I'm trying to create a package body but i keep getting an error message saying package created with complication.
CREATE OR REPLACE PACKAGE BODY MY_PACK
IS
PROCEDURE MY_PROC(A NUMBER, B NUMBER)
IS
C NUMBER(4);
BEGIN
C:=A+B;
[code].......
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 am sending email with attachment (word, pdf) without any problem. Now what i want is, instead of attachment that pdf / word file should come in body part , like means in internet explorer pdf open inside the browser itself while surfing. so means as soon as user open email, content of word / pdf should display in body part. how can i do this. using forms 6i, and database 10g.
View 7 Replies View RelatedUp until today we assumed that compiling a package BODY-only would not cause invalidation of other code. However when we compiled the body of the HTP package, the OWA package became invalid and required re-compilation.
Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
PL/SQL Release 10.2.0.4.0 - Production
CORE10.2.0.4.0Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I want to see a stored procedure definition which is inside the body of a package and the package is wrapped.So I am not able to see the content of the package body.I am new to oracle and I don't know how to decrypt the wrapped package.how to read the content of a wrapped package inside oracle.
View 1 Replies View RelatedWhen i compile the package body i get errors.
CREATE OR REPLACE PACKAGE BODY CEE_OSPCM_PKG AS
PROCEDURE CEEOT_WORK_TYPE_PRC IS
CURSOR CUR_WORK_TYPE IS
SELECT *
[code]...
I tried to create a UTL_SMTP package using '@?/rdbms/admin/utlmtp.sql' script but there are no package body for UTL_SMTP is created. There are only UTL_SMTP package is create.
View 4 Replies View RelatedI need to find out the exact DML statement which invoked a particular trigger inside a trigger body.
View 7 Replies View Related