?
Solved

oracle 11g package

Posted on 2014-08-20
12
Medium Priority
?
343 Views
Last Modified: 2014-08-20
I have from development two packages - I was told to run one and that the return value would be "1"
can you tell me how I check the return value to make sure the correct package script was executed?
0
Comment
Question by:bkreynolds48
  • 6
  • 5
12 Comments
 
LVL 18

Expert Comment

by:sventhan
ID: 40274289
Can you run the package and check the output?

Is it a oracle package?


in sqlplus use

set serveroutput on
then run the package to see the output.
0
 
LVL 1

Author Comment

by:bkreynolds48
ID: 40274325
so just log into sqlplus and do

set serveroutput on
@package_name;

right?
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40274358
@ runs a script file.

So if you have a file called package_name.sql, then @package_name would work.

Are you trying to execute the package or did development give you a script to actually create the package?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:bkreynolds48
ID: 40274429
they gave me script to run -
I ran the script in the database -
 now I need to know what the return value is -

 it is supposed to return a
"1" if  the p_checkoff.sql was run

and

 '0" if p_check.sql was run -

the package name is p_check
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40274445
If the script was to just create the package then you will have to check with the people that told you about the return value.

The package will either create or not create and should tell you immediately if it did or did not.

You should see a message like
Package created.
or
Warning: Package created with compilation errors.

I've never heard of a return code unless you are actually wanting the return value from sqlplus when you exit but I don't see the need here.
0
 
LVL 1

Author Comment

by:bkreynolds48
ID: 40274476
as far as I understand it
when the p_check package is created it returns a value of "0" to the application
when the p_checkoff script is run it creates the p_check package so that it returns a value of "1" to the application

does that make sense?
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40274487
>>does that make sense?

Nope.

Creating the package is different than calling a procedure/function inside the package.

The package being created doesn't return anything to any app.

The app can call a procedure/function inside the package that can return a value but it will NEVER return a value if the function/package doesn't exist.  It will return an error.
0
 
LVL 1

Author Comment

by:bkreynolds48
ID: 40274561
the package exists
can I return the value of the function inside the package?
function name is f_check
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40274633
select p_check.f_check  from dual;
0
 
LVL 1

Author Comment

by:bkreynolds48
ID: 40274676
I get
ora-06553 pls-306 wrong number or types of arguments in call to f_check
0
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 40274682
You have the script that creates the package.

How is f_check defined?  If it has input parameters, you'll need to supply them...  and proper ones.

We cannot answer that for you.  You'll need to check with the developers.
0
 
LVL 1

Author Closing Comment

by:bkreynolds48
ID: 40274690
thanks
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question