Packages Vs. Procedures
Hi
Can any one tell the advantages of using Packages Vs. Procedures
Thanks
Samir
As far as I know, they are two completely different things.
Procedures are blocks of code which perform certain tasks. Packages are "containers" which can contain ,among other things, a collection of procedures. Packages are a way to organize a collection of procedures which might have some common element. So, the question should be whether or not a given set of procedures should be put into a package.
I hope this helps.
null
Similar Messages
-
Hi Guys,
We have created a custom package where in we are trying to call the standard API's of Oracle projects i.e PA_PROJECT_PUB.When we are trying to call these APIs we are facing the below issue.
We have tried testing in two instances ,Initially it worked in both instances.
Using the same API's multiple times we tested the same data set in these instances.
For the first few runs it works fine.But when we go on using the same API's again and again for our testing we face now and then the below issue.
Standard API's
=========
add_task
update_project
change_structure_status
create_draft_plan
Error:
ORA-20100: File o2670336.tmp creation for FND_FILE failed.You will find more information on the cause of the error in request log. in Package PA_OPPORTUNITY_MGT_PVT Procedure modify_project_attributes ORA-20100: File o2670336.tmp creation for FND_FILE failed.
You will find more information on the cause of the error in request log. in Package PA_PROJECT_PUB Procedure update_project:ORA-0000: normal, successful completionError while publishing the task
Please let us know if anyone of has come across the same situation.
Regards,
VijayBut have issue only with validating invoice batch. I followed metalink ID's 605542.1, 167990.1,261693.1,1088553.1,749491.1, 461271.1 and few more.Was this working before? If yes, any changes have been done recently?
Please see if these docs help.
APXAPRVL: Invoice Validation Errors With MSG-00001 and REP-1419 [ID 333305.1]
Invoice Validation Errors When Others:101505:Non-Oracle Exception Rep-1419 [ID 464125.1]
Invoice Validation Fails with REP-1419 Error in Ap_approval_matched_pkg.Execute_matched_checks [ID 293425.1]
Invoice Validation Failing On Fnd_file Could Not Write To File L0202306.Tmp [ID 461520.1]
Invoice Validation (APPRVL) Errors ORA-20001 APP-SQLAP-10000 PSA_FUNDS_CONTROL_PKG.glxfck [ID 463184.1]
Validate Invoice Error With ORA-20001: APP-SQLAP-10000: AP_FUNDS_CONTROL_PKG.Calc_QV [ID 432702.1]
Invoice Validation Program Is Erroring Out [ID 382844.1]
Error On Validation Of Invoices From Previous Periods [ID 412814.1]
Thanks,
Hussein -
Sql developer doesn't show any packages and procedure.
Hi All,
I am perty new here and I am facing a strange problem in SQL DEVELOPER. I have one schema and it has packages and functions created in it, but when I click
packages or functions in sql developer it says table or views does not exist. however, I can see those packages and procedures from sql plus and oracle enterprise manager. you swift reply would be highly appriciated
hare krishna
AlokWhich version of sqldeveloper?
Which version of Oracle?
This sounds like an old bug where sqldeveloper checked for 'select any table', but you actually need 'select any dictionary' -
Strange download size of on calling packaged stored procedure in VB6
Hi,
I tried to use VB6 to call oracle stored procedure with ref cursor as output parameter under a package in 10g database (10.1.03). Oracle client uses windows 9.2 / 10.1.02 (Oracle OLEDB Provider) . I found that when the package size increases(> 1000 lines codes), the data size transfer from database to VB client also increases. I try to trap the binary data flow between VB6 and database when calling packaged stored procedure. I found that VB6(or oracle client ??) will first download package spec then execute the requested stored procedure. This may explain the cause of increasing size.
However, this large download size for calling only one of the procedure will make my application run slowly when my application uses the package much. How can I solve this problem ? Does this relate to oracle client(p.s. this problem disappear when using Microsoft OLEDB Provider)?
Thanks
StevenYou can use a wrapper to get compiled code and if it's 10g you can do even more by putting it in a library.
OLEDB from VB6 still using Oracle 'Client' as you call Oracle NET. -
Why apps don't need to be granted for synonyms of packages and procedures?
Normally, When a user create a synonym of other schemas' package or procedure, it requires to be authorized to execute via 'grant' by owner before the user can call it.
But on one of our environment of EBS 12.1.1(vis), apps user don't need to be granted. Just need to make synonym and then can call the synonym. while on another environment of EBS 12.1.1(product), it still need to be granted. I notice that apps user in the two diffierent environment has many different database roles. Is any role associated with this? Does anybody know the reason?
Thanks in advance!
Jing
Edited by: user12954958 on Aug 25, 2010 11:44 PMHi Jing;
Please check below thread which is posted Hussein Sawwan
Re: apps & applsys password
aaps,applsyspub,applsys
Re: apps & applsys password
Regard
Helios -
SubVersion in SQL Developer - how to link to packages and procedures
My question is this - I am starting out using SubVersion in Oracle and it seems pretty straightforward to use as a source control for files that are stored in a Windows directory, that is the only way I have used it so far.
Am I able to use it to control packages and procedures that I have saved as part of my database, ie the procedures are part of a package and the package appears within the Packages section of the appropriate connection in SQL Developer.
I hope this makes sense.
Cheers,
JabJamHi JabJam,
So far, everyone is correct. SQL Developer just uses a file-based source control system (e.g., SVN), which means updating database object definitions via scripts under version control, or somehow exporting the new definition to a script so it can be version controlled after the fact. And wouldn't it be nice if the database objects could be version controlled directly. With the database developer having control over when any changes are committed for shared use in the database. Similar to using the SVN plug-in for an IDE like Eclipse for a given programming language in a shared development environment.
But what would your DBA have to say about that? Don't most DBAs require scripts for deploying code or structural changes?
In Oracle, definitions (DDL) are committed automatically. Anyone granted access sees them. Since you probably don't do development directly against a production database, eventually scripts (either manual or generated) will be needed for deployment to QA or production. Few mechanisms currently exist to work against an active database without other authorized users also seeing these changes.
For DDL, the closest thing would be the fairly recent edition-based redefinition feature in 11g (R2, I think). For DML, the OWM (Oracle Workspace Management) feature would be loosely analogous.
This is not a simple issue. Version control via an extension for Subversion provides essential basic support. Going beyond that might mean watching the evolution of edition-based redefinition, but DBAs would probably require scripts for that too.
Regards,
Gary
SQL Developer Team -
Hi Expert,
While running the Order Import i am getting the error please help us :
Order Import Concurrent Program
Concurrent Program Parameters
Validate Only: N
Order Source:
Order Ref:
Sold To Org Id:
Sold To Org:
Change Sequence:
Performance Parameter: Y
Trim Blanks: N
Operation:
Number of Instances: 0
Debug Level: 0
Request Id: 4471
Org Id: 2453
Failed to perform Action Request BOOK_ORDER
Failed to perform Action Request BOOK_ORDER
No. of orders found: 1
No. of orders imported: 0
No. of orders failed: 1
Source/Order/Seq/Line Message
10/1046001534//2 ATP Process resulted in no data
10/1046001534//2 User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Load_Results_from_tbl
10/1046001534//2 User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Load_Results_from_rec
End of Order Import Concurrent Program
Regards,
SurajAnd also check
Order Import error : User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Action_Undemand,User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Action_Reschedule [ID 737031.1] -
Extracting package and procedure name in code
In my exception processing I need to log the package and procedure name that got the exception. How do I obtain these two names without manually coding the names?
Thanks in anticipiationA better option is to get the package name and the line numberA still better option is to utilize pl/scope (when you are in 11g (not sure about 10g)):
SQL> alter session set plscope_settings='identifiers:all'
Session altered.
SQL> set serverout on
SQL> create or replace package pkg
as
procedure p1;
procedure p2;
end pkg;
Package created.
SQL> create or replace package body pkg
as
procedure get_scope (obj varchar2, line int)
as
begin
for c in (select rpad (lpad (' ', 2 * (level - 1)) || name, 20, '.') || ' ' || rpad (type, 20) || rpad (usage, 20) identifier_usage_contexts
from user_identifiers t
where level != 1
start with line = get_scope.line and object_name = obj
connect by usage_id = prior usage_context_id)
loop
dbms_output.put_line (c.identifier_usage_contexts);
end loop;
end get_scope;
procedure p1
as
begin
null;
end p1;
procedure p2
as
begin
get_scope ($$plsql_unit, $$plsql_line);
end p2;
end pkg;
Package body created.
SQL> exec pkg.p2
P2................ PROCEDURE DEFINITION
PKG............. PACKAGE DEFINITION
PKG............. PACKAGE DECLARATION
PL/SQL procedure successfully completed. -
Pass BLOB as parameter to Packaged Stored Procedure
Does JDBC (thin or otherwise) support passing a BLOB as a parameter to a packaged stored procedure in Oracle, or do we have to do an 'insert' statement to get it in?
All the articles I've seen seem to refer to insert and select, but I want to strictly enforce all access to the database being through a package rather than table level access.
We've certainly had no difficulty receiving blobs from the resultset returned by our packaged procedures.
Any help appreciated,
Thanks
Jason.C5112736 wrote:>
> And then these 2 formulas 'Formula # 1' and 'Formula # 2' can be used to pass on to the stored procedure.
Can someone please demonstrate exactly how to use formula results as date parameters to a SQL stored procedure? Keep in mind, there are two parameters to the stored procedure.
I have gleaned this much: Use Add Command and insert the procedure with
EXEC ServerName.dbo.usp_sprocName;1 '{?StringParameter}'
but if I try to do
{CALL ServerName.dbo.usp_SprocName({@Formula1},{@Formula2})}
then it gives the error "No value given for one or more required parameters".
Both of the parameters are VARCHAR(50).
I have finally found this link: [http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx|http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx]
This Microsoft site defines the format of the ODBC escape sequences, but I still do not know how to convince Crystal to insert it's parameter results or formula results.
Pulling what's left of my hair out . . .
~ Shaun -
Recommended Solaris package upgrade procedure
We would like to know the recommended Application Package upgrade procedure. We followed the procedure as defined in the Application Packaging Developer's Guide.
Currently we followed the following procedure during upgrade:
1. Check if old version is available.
2. If it is available execute the pkgrm command to remove the old package as indicated in the Application Packaging Developer's Guide. But since the package names are same and we are executing the pkgrm command from the preinstall script, in some systems it's not allowing to remove the old package since it's executed from pkgadd command scope. The following error message is displayed while package verifying step is executed
[ verifying class <none> ]
pkgadd: ERROR: missing entry in contents file for </opt/XXXXxxxx/jre>
3. We cannot manually remove the old package first since it will completely wipe out the file. We need to migrate some of the files from old release to new. So we need the old files during upgrade.
Please suggest a suitable procedure to handle this.
Some more details about the OS:
1. uname -a
SunOS rduipv6 5.10 Generic_142900-03 sun4u sparc SUNW,UltraAX-i2 SolarisHi.
I can't say how Oracle recomend. But I see that for update main part of Sun Product used two ways:
1) Documentation say that user should remove all previos version of product by hand.
2) Used extarnal installation tool that do it automaticaly, but not as part package installation script (pre/postinstall ).
Regards. -
Convert Maping Package to Procedure
Hello All,
Would any one let me know how to convert OWB Package to procedure such that we can use those procedures in other applications.
Thx & Reg,
S.Gyazuddin.There are some details here too since mappings implemented as PLSQL will end up with a main, but there is also a generic API to execute any map (including SQLLoader etc.);
http://blogs.oracle.com/warehousebuilder/2008/11/using_3rd_party_schedulers_with_owb_1.html
Cheers
David -
How to call Packaged Stored Procedure in JDBC Adapter?
hello frnds,
I m working on a SAP R/3 -> XI -> Oracle scenario. Here on receiver side i m using JDBC Adapter in which i m using a stored procedure.
I have my stored procedure in a Package. Example : package "PKG_SPARES_VOR_UPLOAD" and in that stored procedure "pr_spares_vor_po_hdr_upload".
i have checked that if i write this stored procedure outside the package then it works fine... but if i put it into the package then it is giving me error that ....
" Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
Configured at 2006-08-16 10:12:14 GMT+05:30
History:
- 2006-08-16 11:02:04 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PR_SPARES_VOR_PO_HDR_UPLOAD' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'PR_SPARES_VOR_PO_HDR_UPLOAD' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored ".
please help me out with this problem.
Thankx,
Regards,
AudumbarHi,
I have the same problem to call a stored Procedure in a Package.
If my procedure is not in a package, everything is right.
And I musn't indicate all the name, because I musn't put '.' in the name (of the procedure), in my DT on XI.
It would be so nice to have an answer.
Rémi -
Error message when compiling invalid packages and procedures
Hi.
I have a routine for copying certain data from a production database to a test database. To do this I disable constraints and triggers, truncate tables, copy tables and enable triggers and constraints again.
Now several of my functions, procedures and packages are made invalid and marked with a red cross. In SQL Developer I can compile invalid functions, procedures and packages. When I compile functions it works fine, but when compiling procedures and packages I get the following error message:
An error was encountered performing the requested operation:
ORA-00904: "ATTRIBUTE": Invalid identifier
Vendor code 904
When I click OK on this message I get a confirmation saying:
Packages have been compiled with #0.CNT# errors.
I had this error in both the previous and the new version. Is this a bug or is there a way to come around it? When I copy and modify the SQL generated to perform this task and run it in SQL Plus it works fine.
I use Windows 2000 5.00.2195 Service Pack 4, SQL Developer version 1.2.1, Oracle 9.2.0.8.0 and Java version 1.5.0_11
Message was edited by:
SvSigi have now upgraded to Java 1.6 update 2. I still get basically the same error, but it is presented a little bit differently:
An error was encountered performing the requested operation:
ORA-00904: "ATTRIBUTE": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Vendor code 904
Are there other possible error causes than the operating system version and the database version?
We are going to install an Oracle 10 test database in a couple of weeks, so then I will find out whether the database version is the problem. -
How to create a package with procedures?
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_PCK
AS
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? If there is any error in this package please do correct it!!!
Project: sqldev.temp:/IdeConnections%23vAPEX.jpr
F:\PACKAGES\APEX_SYS_PCK.sql
Error: PL/SQL: Compilation unit analysis terminated
Error(1,14): PLS-00905: object APEX.APEX_SYS_PCK is invalid
Error(1,14): PLS-00304: cannot compile body of 'APEX_SYS_PCK' without its specificationSTATUS in USER_OBJECTS
"OBJECT_NAME"
"SUBOBJECT_NAME"
"OBJECT_ID"
"DATA_OBJECT_ID"
"OBJECT_TYPE"
"CREATED"
"LAST_DDL_TIME"
"TIMESTAMP"
"STATUS"
"TEMPORARY"
"GENERATED"
"SECONDARY"
"NAMESPACE"
"EDITION_NAME"
"CUSTOMERS"
70645
70645
"TABLE"
03-AUG-13
03-AUG-13
"2013-08-03:17:59:09"
"VALID"
"N"
"N"
"N"
1
"CUSTOMERS_PK"
70646
70646
"INDEX"
03-AUG-13
03-AUG-13
"2013-08-03:17:59:09"
"VALID"
"N"
"N"
"N"
4
"DEPARTMENTS_PK"
70656
70656
"INDEX"
03-AUG-13
03-AUG-13
"2013-08-03:18:32:32"
"VALID"
"N"
"N"
"N"
4
"EMPLOYEES"
70657
70657
"TABLE"
03-AUG-13
03-AUG-13
"2013-08-03:18:32:57"
"VALID"
"N"
"N"
"N"
1
"DEPARTMENTS"
70655
70655
"TABLE"
03-AUG-13
03-AUG-13
"2013-08-03:18:32:32"
"VALID"
"N"
"N"
"N"
1
"EMPLOYEES_PK"
70658
70658
"INDEX"
03-AUG-13
03-AUG-13
"2013-08-03:18:32:57"
"VALID"
"N"
"N"
"N"
4
"SUPPLIERS"
70659
70659
"TABLE"
03-AUG-13
03-AUG-13
"2013-08-03:20:25:41"
"VALID"
"N"
"N"
"N"
1
"SUPPLIERS_PK"
70660
70660
"INDEX"
03-AUG-13
03-AUG-13
"2013-08-03:20:25:41"
"VALID"
"N"
"N"
"N"
4
"PRODUCTS"
70661
70661
"TABLE"
03-AUG-13
03-AUG-13
"2013-08-03:20:28:32"
"VALID"
"N"
"N"
"N"
1
"PRODUCTS_PK"
70662
70662
"INDEX"
03-AUG-13
03-AUG-13
"2013-08-03:20:28:32"
"VALID"
"N"
"N"
"N"
4
"PERSONS_PK"
70687
70687
"INDEX"
10-AUG-13
10-AUG-13
"2013-08-10:22:37:34"
"VALID"
"N"
"N"
"N"
4
"PERSONS"
70686
70686
"TABLE"
10-AUG-13
10-AUG-13
"2013-08-10:22:37:34"
"VALID"
"N"
"N"
"N"
1
"APEX_SYS_PCK"
70776
0
"PACKAGE"
13-AUG-13
15-AUG-13
"2013-08-15:19:56:47"
"INVALID"
"N"
"N"
"N"
1
"GET_LOGIN_CREDENTIALS"
70775
0
"PROCEDURE"
13-AUG-13
13-AUG-13
"2013-08-13:22:26:49"
"INVALID"
"N"
"N"
"N"
1
"APEX_SYS_PCK"
70792
0
"PACKAGE BODY"
15-AUG-13
15-AUG-13
"2013-08-15:19:56:47"
"INVALID"
"N"
"N"
"N"
2
"EMP_MAINT"
70802
0
"PACKAGE"
15-AUG-13
15-AUG-13
"2013-08-15:19:54:39"
"INVALID"
"N"
"N"
"N"
1 -
Calling packaged stored procedure from Java
Hi All,
I'm trying to call a stored procedure from Java but I'm having
problems with registrating the output parameter. I'm getting
the error: Conflicting parameters.: sqltype=2003
This is the stored procedure which is located in a package in
the Oracle database:
package Pack_GetAgencyInformation as
Type InfoType is record ( agen_code varchar(3), agen_designation
varchar(30), agen_adresse varchar(60), agen_tel varchar(12) );
function GetAgencyInformation( P_AGENCE VARCHAR )
return Pack_GetAgencyInformation.InfoType
end Pack_GetAgencyInformation;
This is the Java source from where I'm calling the procedure:
//DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@164.48.69.125:1521:ventes", "system", "*****
// @machineName:port:SID,
userid, password
CallableStatement cs = conn.prepareCall("{ ? = call
Pack_GetAgencyInformation.GetAgencyInformation( ? )}");
try {
cs.registerOutParameter( 1,
oracle.jdbc.driver.OracleTypes.ARRAY);
} catch (SQLException e) {
e.printStackTrace();
cs.setString(2, "001" );
//ResultSet rset = cs.executeQuery();
The stacktrace:
java.sql.SQLException: Parametertypen conflicteren.:
sqlType=2003
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:210)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter
(OracleCallableStatement.java:220)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter
(OracleCallableStatement.java:350)
at dbAccess.main(dbAccess.java:25)
I think it has to do with the type InfoType which is created in
the Stored Procedure. I'm absolute no Oracle expert and I
prefer not to make changes to the Oracle database. So any
solution in Java is welcome!
BR, H.RietmanI managed to get it to work only by changing the stored
procedure. I have changed the return type record to a Ref
Cursor type (had to change alot of code for this). It seams
that Oracle JDBC drivers DON'T support the Record type as a
return type.
So the next question is: is it possible to typecast a record
type to a ref cursor type in Oracle. In this way I can easily
change the return type for the stored procedures.
/Harald
Maybe you are looking for
-
ICal day view header date error
I'm having an issue with the date header in the iCal day view. No matter what day I select the calendar displays Saturday, November 27th, 2010 in the header (at the right top corner of the screen). The date near the top of the agenda on the left si
-
Hi all, Might you explain to me in two lines in order that they are these modules? And if you know it which are the typical transactions codes that are in use in them? FM, SD, WM, BC, BI, CS and PS Thanks !
-
Archive log can not ship to GAP logfiles to standby DB automatically
we have a non-real time standby database, which will receive the archive file from the primary database server most of the time, and will apply the logfiles only at one point of time daily. Some times, we need to shutdown the Standby DB server for a
-
Cant connect to safari-used to work fine!!
i just returned from out of the country...my wireless worked fine before i left, while i was away and i get home and cant connect! My boyfriends computer is fine, i am using it now. I have spoken with my provider and they couldn't help me-after tak
-
How to multiply input by price
Hi, I'm putting together a order form and would like to have the total filled in for the end-user for each item. There are multiple items, but I', just trying to get Right now, I have an input for Quantity (named AAA-MS) and a read-only input (named