Calling a package
Hi
I have created a package, how do i call it from a dynamic page portlet?
Thx
esther
call it this way in a dynamic page portlet:
between the oracle tags:
begin
procedure_name();
end;
You must make sure the user has access to execute the procedure. Default user is PORTAL30_PUBLIC, unless otherwise specified for your user.
Similar Messages
-
Calling a package from shellscript
Hello,
I am trying to run open interface for GL. I am a newbie to oracle apps.
The flow and steps i am following are
1. Load some sample data into staging table using sqlldr.
2.Validate and insert the data into gl_interface using pl/sql package.
3. Write a shell script to call the sqlldr and pl/sql package.
4.Register the script as concurrent program in apps.
When i run this request ,the log file shows no errors. But the data is not loaded in gl_interface table.
I tried with a simple pl/sql procedure (not a package) it ran fine. The data was loaded.
ex:
sqlplus user/pwd<<EOF
exec sql_proc();
EOF
But now i have two different procedures, so created
a package. How do i call that package in the shell script. I also have IN parameters for the second procedure.
Should i mention them here (in the shell script).
i tried
sqlplus user/pwd<<EOF
exec package.sql_proc();
exec package.sql_proc2();
EOF
Any help would be really appreciated.
Thank you,
SrikanthYou can define the variables in your shell script to pass to the package/procedure for e.g. if you wanted to execute fnd_client_info.setup_client_info, your shell script would look something like this
p_usr_id=$1
p_app_id=$2
p_resp_id=$3
( sqlplus -s /nolog << end_of_sql
connect $p_sqlpwd
set head off
set feed off
set verify off
exec fnd_client_info.setup_client_info($p_app_id, $p_resp_id, $p_usr_id, 0);
exit
end_of_sql
) -
How to call a package from the Report in Oracle Application Express
How to call a package from the Report in Oracle Application Express
Hello,
What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
Or do you want to execute a procedure when something happens on the page, like clicking a button?
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
How to call a package in Oracle
I'm trying to call a package in oracle
(this is the oracle way of calling it :
begin pck$xl.get_year_low_high_to_date(:compid, 20010801 , 20020108 ",:year_low,:year_high,:year_average,:low_date,:high_date); end;)
but i can't get it right.
I'm new to package calling in Oracle from Java, till now i only worked with SQL statements without parameters of that kind, can someone help me with this?
ps the ":compid" is a parameter i have to fill in and provide...
thank you very muchok here is a test i do...
but still doesn't work something about the bindvariables (check errorlog). I know a bit jdbc and i understant what you mean, but the problem is i don't know how this should go :(
please advise
import java.sql.*;
import java.util.*;
import java.text.*;
import java.io.*;
* @author U97488
public class test {
public static void main(String[] args) {
try{
ConnectionSherpa cs = ConnectionSherpa.getInstance("ConnectionSherpa");
Connection conn = cs.getConnObj();
String sSQL = "begin?; pck$xl.get_year_low_high_to_date(?, 20010801, 20020801 ,:year_low,:year_high,:year_average,:low_date,:high_date); end;";
CallableStatement stmt = conn.prepareCall(sSQL);
stmt.setString(1, "BRU10");
System.out.println(stmt.toString());
if(stmt.execute(sSQL)){
System.out.println(stmt.getString(2));
}catch (Exception e){
e.printStackTrace();
}StackTrace:
java.sql.SQLException: ORA-06550: Regel 1, kolom 6:
PLS-00110: Bindvariabele '1' is niet toegestaan in deze context..
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:862)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1839)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1764)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2354)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:909)
at com.kbcsecurities.taminoupdate.servlets.test.main(test.java:28) -
Calling a package procedure with Date parameter only
Hi All,
Please help me to call a package procedure with Date parameter from sql prompt.
ArifCheck the below procedure.
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure procdate (p_date_in date)
2 is
3 p_date_out date;
4 begin
5 p_date_out := add_months(p_date_in,6);
6 dbms_output.put_line(p_date_out);
7* end;
SQL> /
Procedure created.
SQL> exec procdate('01-JAN-2010');
01-JUL-10
PL/SQL procedure successfully completed.
SQL> exec procdate(to_date('01/01/2010','DD-MM-YYYY'));
01-JUL-10
PL/SQL procedure successfully completed.
SQL> exec procdate('31-DEC-2010');
30-JUN-11
PL/SQL procedure successfully completed. -
Calling with package "Unlimited world 1 month" got...
Hello there,
I called with package "Unlimited world 1 month" into the land-line in Germany got interrupted regularly. How can I solve this problem?
Thank you in advance.
SpringHello there,
I called with package "Unlimited world 1 month" into the land-line in Germany got interrupted regularly. How can I solve this problem?
Thank you in advance.
Spring -
Calling SSIS package in Stored Procedure...
I have a SSIS package, and i want to call this (run this SSIS package) from Stored Procedure in Sql Server 2008.
Can anyone please explain to me as to how can i call SSIS package from SP?
Thanks!
RahmanTed Kruger explains how this can be done in his blog post
Run SSIS Package from Stored Procedure
For every expert, there is an equal and opposite expert. - Becker's Law
My blog -
Query response time takes more time when calling from package
SELECT
/* UTILITIES_PKG.GET_COUNTRY_CODE(E.EMP_ID,E.EMP_NO) COUNTRY_ID */
(SELECT DISTINCT IE.COUNTRY_ID
FROM DOCUMENT IE
WHERE IE.EMP_ID =E.EMP_ID
AND IE.EMP_NO = E.EMP_NO
AND IE.STATUS = 'OPEN' ) COUNTRY_ID
FROM EMPLOYEE E
CREATE OR REPLACE PACKAGE BODY UTILITIES_PKG AS
FUNCTION GET_COUNTRY_CODE(P_EMP_ID IN VARCHAR2, P_EMP_NO IN VARCHAR2)
RETURN VARCHAR2 IS
L_COUNTRY_ID VARCHAR2(25) := '';
BEGIN
SELECT DISTINCT IE.COUNTRY_ID
INTO L_COUNTRY_ID
FROM DOCUMENT IE
WHERE IE.EMP_ID = P_EMP_ID
AND IE.EMP_NO = P_EMP_NO
AND IE.STATUS = 'OPEN';
RETURN L_COUNTRY_ID;
EXCEPTION
WHEN OTHERS THEN
RETURN 'CONT';
END;
END UTILITIES_PKG;
when I run above query its coming in 1.2 seconds.but when comment subquery and call from package its taking 9 seconds.query returns more than 2000 records.i am not able to find the reason why it is taking more time when calling from package?You are getting a different plan when you run it as PL/SQL most likely. Comment your statement:
SELECT /* your comment here */then find them in V$SQL and get the SQL IDs. You can then use DBMS_XPLAN.DISPLAY_CURSOR to see what is actually happening.
http://www.psoug.org/reference/dbms_xplan.html -
Calling a package function inside a sql
Hi friends!!!
First of all happy Christmas! And them please help! :)
We have a query calling a package function:
SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR ('0000000000000000');There is a primary key just with one column DW025H_NR and the problem is that is not accessing by INDEX UNIQUE SCAN,
it's accessing by TABLE ACCESS FULL.
May be the problem is that we are calling a procedure inside the query?
I have been able to run that query accessing by primary key from my computer but a workmate hasn't!
We both are connecting the same data base 10.2.0.4 and using Oracle SQL Developer!
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 5343K| 1406M| 15670 (7)| 00:02:43 |
|* 1 | VIEW | DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
|* 2 | FILTER | | | | | |
| 3 | TABLE ACCESS FULL| DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
Predicate Information (identified by operation id):
1 - filter("DW025H_NR"="MPPCI"."ENCRIPTAPAN"('0000000000000000'))
2 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
SYS_AUDIT('OPS$SISINFO','DW025H','CMINFOGR001',3) ELSE NULL END IS
NULL)
The correct path would be:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 276 | 3 (0)| 00:00:01 |
|* 1 | FILTER | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| DW025H | 1 | 276 | 3 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN | PK_DW025H | 1 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
SYS_AUDIT('OPS$SISINFO','DW025H ','CMINFOGR001',3) ELSE NULL END IS NULL)
3 - access("DW025H_NR"="MPPCI"."ENCR"('0000000000000000'))
Please any ideas!?!?!
Thanks a lot!
José
Edited by: jamv on Dec 20, 2011 10:50 AMHello
Have a read of this and try to pull together the information in it and post it up here. That will help immensely with getting to the root of your problem...
HOW TO: Post a SQL statement tuning request - template posting
In the mean time:
From the execution plan you have extra predicates that aren't present in the query you supplied, so that's either not the SQL or you have something like VPD switched on.
Anyway, there could be lots of reasons for the difference in execution plan. Sorry if this is very basic and possibly patronising question but it's always worth checking the basics I think - are you both definitely connecting to the same database? If so, have a look in v$sqlarea for this SQL statement and find the SQL_ID, use this to query v$sql and look at the child_number column.
select
sql_id
from
v$sqlarea
where
sql_text like '%SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR%(''0000000000000000'')%'
and
sql_text not like '%v$sqlarea%'
select child_number from v$sql where sql_id='<enter the sql id returned by the query above>'as an example...
XXXX> select /* my sql statement*/ rownum id from dual;
ID
1
1 row selected.
Elapsed: 00:00:00.10
XXXX> select sql_id from v$sqlarea where sql_text like '%my sql statement%'
and sql_text not like '%v$sqlarea%';
SQL_ID
a6ss4v79udz6g
1 row selected.
Elapsed: 00:00:03.56
XXXX> select child_number from v$sql where sql_id='a6ss4v79udz6g'
2 /
CHILD_NUMBER
0
1 row selected. If you have more than one row in v$sql there could be differences in the optimiser environment. The supplied like shows you how to gather the information that should help find what the differences are if any.
Also as a side note if you're calling PL/SQL functions from SQL, you can take advantage of subquery caching to help reduce the number of calls (depending on your version). As it stands, your function is most likely going to be called for every row - when there is only a single row returned, that's not necessarily a problem but for multiple rows, the overhead can quickly grow. If there's no way to get rid of the function call, select the function from dual instead i.e.
SELECT * FROM DW025H WHERE DW025H_NR= (SELECT MPPCI.ENCR%('0000000000000000') FROM dual);This also (as I learnt a couple of weeks ago) works when you're using columns in the table your selecting from as parameters to the function.
HTH
David -
Calling a package in Data template
Hi All ,
I am using Data template for XML generation and want to call a PL/SQL package.I have gone through some of the threads on the topic.
I have some doubts in this regard :
1)Can we have procedures inside package or its just the functions that can be called.
2)Does the package gets executed every time we generate the report.(It got executed for me just once).
3)The parameters defined in the data tamplte can be passed to the PAckage as well?
4) Is this supported on BIP 10.1.3.2 or XML publisher 5.6.2?
Thanks!!Thanks for your detailed answer!!
I am trying to call a package just to understand how it works .This package just inserts a row in "suppliers" table.I ma calling this package through 'beforeReprot' trigger and querying the table after that.
I have written a package "test_pack" :
create or replace
package test_pack as
function test_insert_fun return boolean;
end test_pack;
create or replace
package body test_pack as
function test_insert_fun return boolean is
begin
insert into suppliers values (1,'p1','p2');
return (TRUE);
end;
end test_pack;
Data Template :
<dataTemplate name="test" dataSourceRef="demo" defaultpackage="test_pack">
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT * from suppliers]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReport" source="test_pack.test_insert_fun()"/>
</dataTemplate>
However after this , when I try to view data , I amnot seeing any output.When i go nad check the suppliers table in db, i dont see any values.
I believe this package should be executed everytime i view the data.
Please advice!! -
Calling DTS package from Stored Procedure
I am getting error calling DTS package from CF.
So i want to call DTS package from SQL Server Stored
Procedure.
DTS package create text file. So no need of input or output
parameter.
What is the syntax?.
thanks for ur help.Ted Kruger explains how this can be done in his blog post
Run SSIS Package from Stored Procedure
For every expert, there is an equal and opposite expert. - Becker's Law
My blog -
Calling SSIS package from DTEXEC in SQL Server 2012
Hello,
I have a package called test.dtsx developed in SSIS vs 2010 (project deployment model). It has two project parameters one is db connection (string) and one is classnumber(string). This package has been deployed as file system and in SSISDB. I want to
assign the following values to the project parameters
$Project::DBConnection - Data Source=localhost;User ID=User;Password=password;Initial Catalog=testdb;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=False;
$Project::Classnumber - 10
What is the syntax to call this package from dtexec passing values for parameters
1. as a file system deployment
2. as a package in SSIS db(catalog)
thankshttp://msdn.microsoft.com/en-ca/library/hh231187.aspx has an example
Dtexec /isserver “SSISDB\MyFolder\MyProject\test.dtsx” /server “.” /parameter $Project::DBConnection;thevalue /parameter anotherparam(int32);12
Arthur My Blog -
Can we call a package inside a package
Dear Sir
Can we create a package inside a package or can we call a a package inside a package?.If yes.How we can create and call a package inside a package?
Regards
Thakur Manoj[email protected] wrote:
Dear Sir
Can we create a package inside a package NO, you cant do that.
or can we call a a package inside a package?.YES, you can do that. Just call it. <package_name>.<procedure_or_function_name> -
How to call a package with ADO?
I have designed a package which include a procedure. And I have a program coded in ASP.
How to call this package with ADO. Please give a sample.Hi,
I persume that you are facing this problem when u try to code in VB. If that is the case here comes the code.........
OraDatabase.Parameters.Add "A_NBR_NEWSID", A_NBR_NEWSID, ORAPARM_INPUT, 2
OraDatabase.Parameters.Add "A_NBR_TOPICID", A_NBR_TOPICID, ORAPARM_INPUT, 2
OraDatabase.Parameters.Add "A_NBR_USERID", A_NBR_USERID, ORAPARM_INPUT, 2
OraDatabase.Parameters.Add "result", 0, ORAPARM_OUTPUT
OraDatabase.Parameters("result").serverType = 2
OraDatabase.ExecuteSQL ("declare result Number; Begin :result := PKG_CONTENT_MANAGEMENT.FUN_GET_NEWS_PERM_BY_USERID(:A_NBR_NEWSID, :A_NBR_TOPICID, :A_NBR_USERID); end;")
OraDatabase.Parameters.Remove "A_NBR_NEWSID"
OraDatabase.Parameters.Remove "A_NBR_TOPICID"
OraDatabase.Parameters.Remove "A_NBR_USERID"
FUN_GET_NEWS_PERM_BY_USERID = OraDatabase.Parameters("result").Value
OraDatabase.Parameters.Remove "result"
Hope this clear your doubt..
Raj -
How to call a package in a trigger
I have package that is called via a "Submit" in a from used to enter daily production. We are implementing a barcoding system that will automatically populate the tables behind this form (one header and one line level table). I need to write a trigger or something that fires up the code behind the 'Submit' process whenever these tables are updated.
Is there a way to do this by calling the package in a trigger?
Please help.
Thanks
Edited by: asgar_amin on Feb 3, 2009 10:50 AMI'm not quite sure what your requirement is.
Do you want to know which forms-trigger you can use to call your submit-package, or do you want to know how to call the submit-package from a database-trigger?
If the second one, it depends on what parameters your package-procedur/function gets as IN-parameters. Is it the ID of the header-record, the detail-record or no parameter at all.
Depending on that you could either use a AFTER-STATEMENT-trigger on either Header or lines-tables, or if you have to gather the ids a combination of a BEFORE-STATEMENT, an AFTER-INSERT FOR EACH ROW and an AFTER-STATEMENT-trigger.
To go more into detail, please provide some more information. -
Calling public package functions and variables through dblink
Is it possible to call a global public variable in a package in one database from another package procedure in another database using a database link? If so, could you let me know the syntax? Same question for package functions.
Hi,
check this documentation link especially the stmt...
http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14251/adfns_packages.htm#i1007858
You cannot access remote package variables and constants.May be you can write a function in the remote db which when called will return the variable value.
for calling remote package functions...
syntax from documentation is [[schema.]package.]function_name[@dblink][(param_1...param_n)]
an example given in the above link for this...
EXECUTE fire_emp1@boston_server(1043);
Ravi Kumar
Edited by: ravikumar.sv on Aug 31, 2009 11:29 AM
Maybe you are looking for
-
Crystal runs sql command of first sub report in the second sub report ?
Hi, I have report that contains 3 sub reports. Each subreport is running his own sql command to retrieve it's data. When moving from the first subreport to the 2nd subreport, we see on the oracle that the crystal runs the sql command of the 1st subre
-
How to perform dir listing of Weblogic log files from a browser
Hi, I am running WebLogic Server 7.03 on Solaris 8. I have one Admin and multiple Managed servers running. Each creates its own log file. Is there anyway I can access this log files from the browser ? In Apache, you can create a link from htdocs dir
-
I signed up to BT broadband option 1 a couple of months ago and i've been getting a good connection since day 1 it was activated so no complaints there. For the last week i've been trying to upgrade to option 3 for the unlimited useage via the bt web
-
My iPad socket jack doesn't have Apple logo
I have had both iPhone and iPad but unfortunately I noticed that both connecting jack are different because one jack have had Apple logo and my iPad jack doesn't have logo ,How could i trust made by Apple?
-
Can I Use Spanish Fonts for iWeb?
I want to write the word "Espanol" on my iWeb page but I don't know where to find the 'n' with the little thingee over it. I also would like to put a Spanish accent on some letters. Is this possible in iWeb. I am a native English speaker but I want t