Calling PL/SQL procedure from OAF
Hi,
I have a button in a page ,which on click executes a java script function.
The java script function needs to call a package procedure . This package procedure uses a HTP.P package to write html content for the page
HTP.P('<HTML><HEAD><TITLE>Oracle iProcurement: ...</TITLE>');
now can I use do window.open with the above package+function name to display the html content of the package procedure in a new window ?
Thanks for your help
Hi Gyan,
Thanks for your reply
I was actually refering to a page in 11i which I'm trying to migrate to R12
the page has a button, on click of the button the following java script will be executed
url = "/pls/" + url + "/CLOSE_ORDER.SHOW_FORM?ILINEID=" +lineid;
window.open(tvwurl,'close','height=375,width=435,left=25,top=25,scrollbars=0,resizable=0');
CLOSE_ORDER.SHOW_FORM contains some html tags
I'm not sure how we can execute CLOSE_ORDER.SHOW_FORM using java script. When I tried the same code in destination uri of button it opens a new page but it says page cannot be displayed
Thanks
Similar Messages
-
Calling PL/SQL procedures from a Windows CMD script
Hello,
I am writing a Windows CMD script. From this script I want to call procedures from a PL/SQL package which selects, inserts or deletes rows from the database.
How do I go about logging into the database from the cmd script and calling PL/SQL procedures from there?
Does anyone have any examples of such scripts? Thanks in advance.No, it is not a job that needs to be scheduled.
The script will be used when needed to select info from a certain table and also to insert or delete certain info into/from this table (so, it is just simple sql statements which I have put into a package), but I'm sure how to log into the database and execute the procedures from this package in a cmd script. -
Calling PL/SQL Procedures from Java
Hello,
I want to know, if it is possible to call PL/SQL Procedures from
SQLJ(which uses htp.print from the Package web toolkit ).
Though, it is possible to call normal procedures but if I want
to call PL/SQL procedures with htp.print then I get I error.
For example:
#sql{Call html_test()};
Can you give me a advice?
Your help is much appreciated!
M|llerOracle's htp packages are develop to be work with
mod_plsql/OAS/OWS webserver.
If you are trying to use htp packages first need to instanciate
some enviroment vars for htp packages, for example first you has
to call to owa.initialize procedure, populate owa.cgi array and
so on.
If you need more information about how this toolkit works you
could get the source of DB Prism at
http://www.plenix.com/dbprism/ this open source framework
includes backward compatibility with mod_plsql application and
then includes settings of this values from Java code.
Best regards, Marcelo. -
Call PL/SQL procedure from JDeveloper
Is that possible to call PL/SQL procedure from JDeveloper?
What's the setup and coding requirements?
Thanks for any input.This is the Code:_
package oracle.e1.bssv.J594101;
import java.util.Hashtable;
import javax.naming.NamingException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.sql.*;
public class CallSQLProcedure3 {
public CallSQLProcedure3() {
public static void main(String[] args) {
// try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
// env.put(Context.PROVIDER_URL,
"ormi\\://localhost\\:23891/current-workspace-app");
// env.put(Context.PROVIDER_URL,
"ormi://localhost:23791/E1Services-LOCALDEV");
env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
// env.put(Context.PROVIDER_URL,
"ormi://localhost\\:23791/current-workspace-app");
env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
Context ctx3 = null;
try {
ctx3 = new InitialContext(env);
} catch (NamingException e) {
// TODO
// Context ctx = null;
try {
// NamingEnumeration n= ctx3.list("ormi://localhost:23791");
// System.out.println(n.hasMore());
Hashtable h = ctx3.getEnvironment();
// while(h.elements().hasMoreElements())
System.out.println(" name " +
h.elements().nextElement().toString());
// InitialContext initialContext = new InitialContext();
// javax.sql.DataSource ds =
(javax.sql.DataSource)initialContext.lookup("jdbc/DBConnection1DS");
// javax.sql.DataSource ds =
(javax.sql.DataSource)ctx3.lookup("jdbc/DBConnection1DS");
// javax.sql.DataSource ds =
(javax.sql.DataSource)ctx3.lookup("jdbc/OracleDS");
javax.sql.DataSource ds =
(javax.sql.DataSource)ctx3.lookup("jdbc/DBConnection1DS");
java.sql.Connection conn;
try {
conn = ds.getConnection();
} catch (SQLException e) {
// TODO
// ctx = new InitialContext();
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");
// Hashtable h = envCtx.getEnvironment();
// while(h.elements().hasMoreElements())
// System.out.println(" name " + h.elements().nextElement().toString());
DataSource ds2 = (DataSource)envCtx.lookup("DBConnection1DS");
// Connection conn;
// try {
// conn = ds.getConnection();
// } catch (SQLException e) {
// TODO
// } catch (NamingException e) {
// // TODO
// DataSource dataSource = null;
// } catch (NamingException ne) {
// try {
// dataSource = (DataSource)ctx.lookup("jdbc/DBConnection1DS");
// } catch (NamingException e) {
// e.printStackTrace();
// String myError1="Error occured with Initial Context";
Connection conn2;
try {
conn2 = ds2.getConnection();
// conn = ds.getConnection();
} catch (SQLException e) {
// TODO
} catch (NamingException e) {
// TODO
e.printStackTrace();
System.out.println("Error looking up " +e);
This is the Error:_
error message from executing a code ds.getConnection();
D:\oracle\jdevstudio10133\jdk\bin\javaw.exe -client -classpath
D:\e812\ETDV812\Java\classes;D:\oracle\jdevstudio10133\webservices\lib\jaxrpc-api.jar;D:\oracle\jdevstudio10133\webservices\lib\wsclient.jar;D:\oracle\jdevstudio10133\webservices\lib\wsserver.jar;D:\oracle\jdevstudio10133\webservices\lib\wssecurity.jar;D:\oracle\jdevstudio10133\webservices\lib\wsdl.jar;D:\oracle\jdevstudio10133\webservices\lib\orasaaj.jar;D:\oracle\jdevstudio10133\webservices\lib\saaj-api.jar;D:\oracle\jdevstudio10133\webservices\lib\orawsdl.jar;D:\oracle\jdevstudio10133\webservices\lib\orawsrm.jar;D:\oracle\jdevstudio10133\webservices\lib\jaxr_api.jar;D:\oracle\jdevstudio10133\webservices\lib\orajaxr.jar;D:\oracle\jdevstudio10133\webservices\lib\relaxngDatatype.jar;D:\oracle\jdevstudio10133\webservices\lib\jaxb-impl.jar;D:\oracle\jdevstudio10133\webservices\lib\jaxb-libs.jar;D:\oracle\jdevstudio10133\webservices\lib\xsdlib.jar;D:\oracle\jdevstudio10133\webservices\lib\mdds.jar;D:\oracle\jdevstudio10133\jlib\jaxen.jar;D:\oracle\jdevstudio10133\jlib\oraclepki!
.jar;D:\oracle\jdevstudio10133\jlib\ojpse.jar;D:\oracle\jdevstudio10133\jlib\osdt_core.jar;D:\oracle\jdevstudio10133\jlib\osdt_cert.jar;D:\oracle\jdevstudio10133\jlib\osdt_xmlsec.jar;D:\oracle\jdevstudio10133\jlib\osdt_wss.jar;D:\oracle\jdevstudio10133\jlib\osdt_saml.jar;D:\oracle\jdevstudio10133\jlib\repository.jar;D:\oracle\jdevstudio10133\jlib\ojmisc.jar;D:\oracle\jdevstudio10133\j2ee\home\lib\http_client.jar;D:\oracle\jdevstudio10133\j2ee\home\jazncore.jar;D:\oracle\jdevstudio10133\j2ee\home\oc4jclient.jar;D:\oracle\jdevstudio10133\rdbms\jlib\xdb.jar;D:\oracle\jdevstudio10133\diagnostics\lib\ojdl2.jar;D:\e812\ETDV812\ini\sbf;D:\e812\System\Classes\Base_JAR.jar;D:\e812\System\Classes\BizLogicContainer_JAR.jar;D:\e812\System\Classes\BusinessLogicServices_JAR.jar;D:\e812\System\Classes\Connector.jar;D:\e812\System\Classes\EventProcessor_JAR.jar;D:\e812\System\Classes\Generator_JAR.jar;D:\e812\System\Classes\JdbjBase_JAR.jar;D:\e812\System\Classes\JdbjInterfaces_JAR.jar;D:\!
e812\System\Classes\JdeNet_JAR.jar;D:\e812\System\Classes\Maf2Base_JAR
.jar;D:\e812\System\Classes\mafsecurity.jar;D:\e812\System\Classes\Metadata.jar;D:\e812\System\Classes\MetadataInterface.jar;D:\e812\System\Classes\PMApi_JAR.jar;D:\e812\System\Classes\SBFFoundation_JAR.jar;D:\e812\System\Classes\Spec_JAR.jar;D:\e812\System\Classes\System_JAR.jar;D:\e812\System\Classes\SystemInterfaces_JAR.jar;D:\e812\System\Classes\castor.jar;D:\e812\System\Classes\log4j.jar;D:\e812\System\Classes\xerces.jar;D:\e812\System\Classes\xml-apis.jar;D:\e812\System\Classes\Rijndael.jar;D:\e812\System\Classes\ManagementAgent_JAR.jar;D:\e812\System\Classes\commons-logging.jar;D:\e812\System\Classes\commons-codec-1.3.jar;D:\e812\System\Classes\commons-httpclient-3.0.jar;D:\e812\System\Classes\jmxremote.jar;D:\e812\System\Classes\jmxremote_optional.jar;D:\e812\System\Classes\jmxri.jar;D:\e812\System\Classes\rmissl.jar;D:\e812\misc\ojdbc5.jar;D:\e812\misc\mssqlserver.jar;D:\e812\misc\msutil.jar;D:\e812\misc\msbase.jar;D:\e812\misc\db2java.zip;D:\e812\misc\jt400.jar;D:\!
e812\misc\sqljdbc.jar;D:\oracle\jdevstudio10133\lib\xmlparserv2.jar;D:\oracle\jdevstudio10133\lib\xml.jar
oracle.e1.bssv.J594101.CallSQLProcedure3
name com.evermind.server.rmi.RMIInitialContextFactory
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/bcel/generic/Instruction
at
oracle.oc4j.sql.spi.ConnectionHandle.getConnectionHandle(ConnectionHandle.java:725)
at
oracle.oc4j.sql.spi.ManagedConnectionImpl.getConnectionHandle(ManagedConnectionImpl.java:273)
at
oracle.oc4j.sql.spi.ManagedConnectionImpl.getConnection(ManagedConnectionImpl.java:255)
at
com.evermind.server.connector.ApplicationConnectionManager.createConnectionHandle(ApplicationConnectionManager.java:1786)
at
com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1472)
at
oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.java:238)
at
oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
at
oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:272)
at
oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:200)
at
oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:142)
at
oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:127)
at
oracle.e1.bssv.J594101.CallSQLProcedure3.main(CallSQLProcedure3.java:70)
Process exited with exit code 1. -
Jdbc NullPointerException calling pl/sql procedure from java
Hi.
Getting the following exception calling a plsql procedure from jdbc.
- Jdbc version is 10.2.0.2, but it also happens running several other variants, including 10.1.0.5.0.
- Application is running in Weblogic 8.1.3 (8.1 SP 3).
The procedure call itself has 2 in/out parameters which are tables (actually just 1 dimensional arrays), which I'm suspecting has something to do with the problem. I can successfully call this procedure using a plsql developer tool with the same bind parameters.
Any ideas?
Exception encountered while executing PL/SQL procedure MVT_Web_Inquiry.ShowInquiry:
java.lang.NullPointerException at oracle.jdbc.driver.T4CTTIiov.processRXD([Loracle.jdbc.driver.Accessor;I[B[C[SILoracle.jdbc.driver.DBConversion;[B[B[[Ljava.io.InputStream;[[[B[[Loracle.jdbc.oracore.OracleTypeADT;Loracle.jdbc.driver.OracleStatement;[B[C[S)[Loracle.jdbc.driver.Accessor;(T4CTTIiov.java:139)
at oracle.jdbc.driver.T4C8Oall.receive()V(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(ZZZZ)V(T4CCallableStatement.java:215)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(Z)V(T4CCallableStatement.java:1119)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V(OracleStatement.java:1278)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I(OraclePreparedStatement.java:3446)
at oracle.jdbc.driver.OraclePreparedStatement.execute()Z(OraclePreparedStatement.java:3552)
at oracle.jdbc.driver.OracleCallableStatement.execute()Z(OracleCallableStatement.java:5261)
at weblogic.jdbc.wrapper.PreparedStatement.execute()Z(PreparedStatement.java:70)
at
[snip]OK... I figured it out.
Apparently, this error happens when you forget to register the output part of an in/out parameter. I would have hoped for better error messaging, but oh well.
-ed- -
403 Forbidden error calling PL/SQL Procedure from URL
I am getting a 403 Forbidden browser error when calling a PL/SQL procedure from the URL, as in this:
http://<server.port>/apex/SCHEMA.procedure_name/f?p_param1=394&p_param2=2, etc
We are upgrading from HTMLDB 2.0 to APEX 4.0.2. I do not believe the upgrade has anything to do with it, c/o the upgraded app works fine in another APE 4.0.2 environment.
The upgrade is to new machines, new DB and new app server, Oracle Web Tier, Oracle HTTP server deployment.
The dads.conf entries are fine, all standard:
Alias /i/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/images/"
Alias /c/ "/apexd01/app/oracle/product/http/Oracle_WT1/ohs/custom_htmldb/"
<Location /pls/apexd>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString dbserver.us.com:1521:SERVER.US.COM ServiceNameFormat
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword apexpwd
PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize
Allow from all
</Location>
The GRANT EXECUTE ON procedure TO PUBLIC is there.
A call to the same procedure via a process in an APEX page works fine - the procedure is OK.
The call from javascript, which sets up the call from the URL, is the one that fails with the 403 Forbidden error.
The same app works fine in another APEX 4.0.2 environment, so I know it is not the JS; It has to be some configuration setting in this environment.
I do NOT have access to the app server.
I have asked that they compare the httpd.conf, and all underlying conf files, to check for differences.
In order for me to be more specific, and hopefully speed up the troubleshooting process, can anyone suggest what other settings to look at?
Thank you - KarenHello,
Good catch, but the difference in URL is in fact the difference in my env to theirs. My typo in not correcting my example to match the dads.conf entry of /pls/apexd. My env uses /apex/. Just saves on my typing.
As an update, I asked the DBA to double-check, and yes, the www_flow_epg_include_mod_local function IS there.
www_flow_epg_include_mod_local is an APEX function.
So now we are trying adding procedures to it. I'll let you know if it works.
My previous question remains - why would I need to do this in one env, and not another,
given that the DB GRANTs are there.
Is there a particular app server setting that wil block execution of PL/SL procedures from the URL?
My guess is, there is some difference in configuration settings for the app server, somewhere in the httpd.conf chain.
Since I do not have access to those files, I cannot do a diff myself, as I would have if I the issue was on my machine.
I am in a situation where I can suggest what to do, but that's it. I agree, it's hard to troubleshoot in this situation.
I am being asked "what setting do I need to change?" without the benefit of access to what is there,so I am doing the best I can, without diverting from my work for a deep-dive refresher session on httpd.conf settings.
So, if anyone is aware of some setting that would block execution of a PL/SQL proc from the URL, please let me know,
and of course, if adding a proc to www_flow_epg_include_mod_local works, I'll be happy. Just still curious.
Thank you - K -
Problem calling PL/SQL procedure from Workflow function activity.
Hi,
I am trying to call a PL/SQL procedure from within my workflow activity.
While I am able to execute the procedure through SQLDeveloper, the workflow function does not seem to call it.
It seems that custom PL/SQL procedures have to conform to certain standards to be called within workflow applications. I have written my procedure to conform to those standards (referred to the example workflows).
Could someone please help me with it?
Thanks and regards.Hi,
When I've received enough alpha reviews of the first few chapters of my book, I'll make chapter five available, which deals with writing functions for Workflows.
Matt
Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
http://www.workflowfaq.com
http://forum.workflowfaq.com -
Calling pl/sql procedure from jsp
Hi:
Could anyone tell me how to call a pl/sql procedure from a jsp page by passing args or without . Is there any specific method to use.
Thanks.Like from any other java code
<%
Connection conn = DriverManager.getConnection(...);
CallableStatement cs = conn.prepareCall("BEGIN myprocedure(); END;");
cs.execute();
%>
With params:
<%
Connection conn = DriverManager.getConnection(...);
CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?); END;");
cs.setInt(1, 10);
cs.setString(2,"aaaa");
cs.execute();
%>
to return some value as out param
Connection conn = DriverManager.getConnection(...);
CallableStatement cs = conn.prepareCall("BEGIN myprocedure(?, ?, 3); END;");
cs.setInt(1, 10);
cs.setString(2,"aaaa");
cs.registerOutParameter(3, Types.VARCHAR);
cs.execute();
out.println("Returned value: " + cs.getString(3));
%>
Of course after all close statement and connection to free resources. -
How to call PL/SQL procedure from Jdeveloper
hai
i am using JDeveloper 10g version 10.1.3. i am working on Web Application[JSF,ADF BC]. i had commit button in one form. when i click that button a PL/SQL procedure can be invoked.( the procedure is to check for primary key)
how to do this
thanks in advance
C.RThere are already some threads about calling PL/SQL from Java. E.g.: adf bc jsf application and database stored procedure
Ronald -
Call PL/SQL procedure from htmldb_delete_message Javascript
Hi Guys,
I am a bit of a novice when it come to JavaScript; I have written a PL/SQL procedure that deletes multiple records based on a primary key:
PROCEDURE clear_alterations (p_eco IN VARCHAR2)
IS
BEGIN
DELETE FROM xxmel_apex_eco_alterations
WHERE eco = p_eco;
END clear_alterations;
I can run that straight from a normal button, but I want the htmldb_delete_message dialog box to pop up to confirm whether to delete or not. When the user clicks 'OK' I want the record to be deleted and if cancel, do nothing.
I have managed to get the confirmation box to appear but cant see how to call the PLSQL based on the 'OK' button being pressed.
Any help would be great,
Thanks
ChrisHi Cashy,
By using Ajax you can call that process. Create that process as a application process. If you are using ApEx4.0 you can create that process as page level.
This stuff you can call on the population of the delete message...check for the id through javascript then call the function.
Thanks and Regards
Maheswara -
Calling PL/SQL API from OAF
Hi all,
i have a stored procedure(xyz) in a package (abc) as below:
procedure xyz
(p_validate in boolean default false
,p_ptnl_ler_for_per_id out nocopy number
,p_csd_by_ptnl_ler_for_per_id in number default null
,p_lf_evt_ocrd_dt in date default null
,p_trgr_table_pk_id in number default null
,p_ptnl_ler_for_per_stat_cd in varchar2 default null
,p_ptnl_ler_for_per_src_cd in varchar2 default null
,p_mnl_dt in date default null
,p_enrt_perd_id in number default null
,p_ler_id in number default null
,p_person_id in number default null
,p_business_group_id in number default null
,p_dtctd_dt in date default null
,p_procd_dt in date default null
,p_unprocd_dt in date default null
,p_voidd_dt in date default null
,p_mnlo_dt in date default null
,p_ntfn_dt in date default null
,p_request_id in number default null
,p_program_application_id in number default null
,p_program_id in number default null
,p_program_update_date in date default null
,p_object_version_number out nocopy number
,p_effective_date in date) is
End;
In oaf i am calling this stored procedure in a function as below:
public String callToApi(String event_date, String event_name, String person_id) {
int ler_pk = 0;
int ovn = 0;
LifeEventIdVOImpl LifeEventIdVOObj = getLifeEventIdVO1();
LifeEventIdVOObj.setWhereClauseParams(null);
LifeEventIdVOObj.setWhereClauseParam(0, event_name);
LifeEventIdVOObj.executeQuery();
String ler_id = LifeEventIdVOObj.first().getAttribute("LerId").toString();
try {
OracleCallableStatement oracleCallableStatement = null;
OADBTransactionImpl txn =
(OADBTransactionImpl)getOADBTransaction();
String statement =
"BEGIN" + " abc.xyz(" +
" p_validate => :1" +
" ,p_ptnl_ler_for_per_id => :2" +
" ,p_csd_by_ptnl_ler_for_per_id => NULL" +
" ,p_lf_evt_ocrd_dt => :3" +
" ,p_trgr_table_pk_id => NULL" +
" ,p_ptnl_ler_for_per_stat_cd => 'DTCTD'" +
" ,p_ptnl_ler_for_per_src_cd => NULL" +
" ,p_mnl_dt => NULL" +
" ,p_enrt_perd_id => NULL" +
" ,p_ler_id => :4" +
" ,p_person_id => :5" +
" ,p_business_group_id => 0" +
" ,p_dtctd_dt => :6" +
" ,p_procd_dt => NULL" +
" ,p_unprocd_dt => NULL" +
" ,p_voidd_dt => NULL" +
" ,p_mnlo_dt => NULL" +
" ,p_ntfn_dt => :7" +
" ,p_request_id => NULL" +
" ,p_program_application_id => NULL" +
" ,p_program_id => NULL" +
" ,p_program_update_date => NULL" +
" ,p_object_version_number => :8" +
" ,p_effective_date => :9);" + " END;";
java.util.Date sysdate = new java.util.Date();
java.sql.Date today_date = new java.sql.Date(sysdate.getTime());
java.sql.Date life_event_date = new java.sql.Date(new java.util.Date(event_date).getTime());
oracleCallableStatement = (OracleCallableStatement)txn.createCallableStatement(statement, DBTransaction.DEFAULT);
oracleCallableStatement.setBoolean(1, Boolean.FALSE);
oracleCallableStatement.registerOutParameter(2, Types.INTEGER);
oracleCallableStatement.setDate(3, life_event_date);
oracleCallableStatement.setInt(4, Integer.parseInt(ler_id));
oracleCallableStatement.setInt(5, Integer.parseInt(person_id));
oracleCallableStatement.setDate(6, today_date);
oracleCallableStatement.setDate(7, today_date);
oracleCallableStatement.registerOutParameter(8, Types.INTEGER);
oracleCallableStatement.setDate(9, today_date);
oracleCallableStatement.execute();
ler_pk = oracleCallableStatement.getInt(2);
ovn = oracleCallableStatement.getInt(8);
System.out.println(ler_pk);
System.out.println(ovn);
catch (Exception e) {
e.printStackTrace();
return(ler_pk + "/" + ovn);
But i am getting an error as:
java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'xyz' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
But i think i have provided the right set of inputs...
Please have a look and let me know where i am wrong....
its urgent.. please reply asapShivam,
Use below code & let us know whether still throws the same error.
try
Connection conn = getOADBTransaction().getJdbcConnection();
CallableStatement cstmt = conn.prepareCall
("{call xyz (:1, :2, :3)}");
System.out.println("1" + Id);
cstmt.setString(1, IjpId);
System.out.println("2" + EmpNum);
cstmt.setString(2, EmpNum );
System.out.println("3" + EmpPositionTitle);
cstmt.setString(3, EmpPositionTitle );
System.out.println("before calling");
cstmt.execute();
System.out.println("after calling");
cstmt.close();
catch(Exception e)
String message = "Error in Data Saving: " + e;
throw new OAException(message, OAException.ERROR);
}Regards,
Gyan -
How to call Pl/sql procedure from form ?
Hi all,
I need to call a procedure from form after the user has pressed the button to invoke the sql procedure, can anyone please advise me on how to do it ?
Thanks.
LimHi,
Thanks for your reply.
yes, I have include in when-button-pressed trigger as
AIC_PROC_AR_CCID_UPD;
Below is my procedure :-
CREATE OR REPLACE PROCEDURE AIC_PROC_AR_CCID_UPD(errbuf out Varchar2,
retcode out Number ) is
VAR_BUF VARCHAR2(240);
Cursor C1 is
SELECT CONCATENATED_SEGMENTS ACCT,
SEGMENT5 SEG5
FROM AIC_GL_COA AGC
WHERE AGC.CODE_COMBINATION_ID IS NULL;
Rec1 C1%RowType;
BEGIN
FOR Rec1 IN C1 LOOP
BEGIN
UPDATE AIC_GL_COA A SET ( DESCRIPTION, CODE_COMBINATION_ID, SEGMENT5 )=
( SELECT FFVT.DESCRIPTION, GLA.CODE_COMBINATION_ID, GLA.SEGMENT5
FROM GL_CODE_COMBINATIONS_KFV GLA,
FND_FLEX_VALUES_TL FFVT,
FND_FLEX_VALUES FFV
WHERE GLA.CONCATENATED_SEGMENTS = REC1.ACCT
AND FFV.FLEX_VALUE = REC1.SEG5
AND FFV.FLEX_VALUE_ID = FFVT.FLEX_VALUE_ID
AND FFV.FLEX_VALUE_SET_ID = 1002673 )
WHERE A.SEGMENT5 = REC1.SEG5 ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'NO RECORD UPDATE !!');
END;
END LOOP;
COMMIT;
RETURN;
END;
However, when I try to compile it, error prompt :-
Error 306 at line 1, column 1
wrong number or types of arguments in call to 'AIC_PROC_AR_CCID_UPD'
Error 0 at line 1, column 1
statement ignored.
By the way, my form 6i is running at client site and connection to procedure in unix server. Will this is ok ?
Thanks
Rgds
Lim -
How to call PL/SQL procedure from PERL
I have a requirement to create a PERL wrapper for few PL/SQL procedure.
Can any one tell me how to call the procedures from PERL ?
Thanks in advance.
....sriniA quick Google search shows:
http://www.saturn5.com/~jwb/dbi-examples.html#ora_sp -
How to call pl/sql function from oaf
Dear Friends,
I am trying to call a function from oaf page .but iam getting error like
java.sql.SQLException: ORA-01861: literal does not match format string
ORA-06512: at line 1
THis is my function ,,callable statement
FUNCTION CAR_LOAN_VALIDATION(P_PERSON_ID IN NUMBER
,P_DEDUCTION_START_DATE IN DATE
,P_DEDUCTION_END_DATE IN DATE
,P_LOAN_VALUE IN NUMBER
RETURN VARCHAR2
IS
l_message VARCHAR2(100);
l_contract_type VARCHAR2(50);
l_loan_eligible_date DATE;
l_grade VARCHAR2(15);
l_old_loan_end_date DATE;
l_max_loan_end_date DATE;
l_remaining_amount NUMBER;
l_eligible_amt NUMBER;
BEGIN
BEGIN
SELECT --papf.person_id,
(SELECT meaning
FROM hr_lookups
WHERE lookup_type = 'ADTC_CONTRACT_TYPE'
AND lookup_code = attribute3) contract_type,
ADD_MONTHS (papf.original_date_of_hire, 11) loan_eligible_date,
DECODE (paaf.ass_attribute2,
'Chairman', 'Chairman',
SUBSTR (ass_attribute2, INSTR (ass_attribute2, '.', 1, 1) + 1,
3)
) grade,
(SELECT nvl(MAX (deduction_end_date),null)
FROM xxadtc_car_loan_request
WHERE person_id = p_person_id) old_loan_end_date,
to_date(ADD_MONTHS (p_deduction_start_date, 47)) max_loan_end_date
--to_date(ADD_MONTHS (sysdate, 47)) max_loan_end_date
INTO l_contract_type
,l_loan_eligible_date
,l_grade
,l_old_loan_end_date
,l_max_loan_end_date
FROM per_all_people_f papf, per_all_assignments_f paaf
WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.business_group_id = 81
AND papf.person_id = paaf.person_id
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND papf.person_id =P_PERSON_ID;
EXCEPTION
WHEN others THEN
DBMS_OUTPUT.PUT_LINE('Error ');
END;
-- get Previous Car loan amount --
BEGIN
SELECT to_number(prrv.result_value)
INTO l_remaining_amount
FROM per_all_people_f papf,
per_all_assignments_f paaf,
pay_assignment_actions pac,
pay_run_results prr,
pay_run_result_values prrv,
pay_element_types_f petf,
pay_input_values_f pivf,
pay_element_classifications pec,
pay_payroll_actions ppa,
per_time_periods ptp
WHERE SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.person_id = paaf.person_id
AND papf.business_group_id = 81
AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.assignment_id = pac.assignment_id
AND pac.assignment_action_id = prr.assignment_action_id
AND prr.run_result_id = prrv.run_result_id
AND prr.element_type_id = petf.element_type_id
AND SYSDATE BETWEEN petf.effective_start_date AND petf.effective_end_date
AND prrv.input_value_id = pivf.input_value_id
AND SYSDATE BETWEEN pivf.effective_start_date AND pivf.effective_end_date
AND pivf.NAME = 'Remaining Amount'
AND petf.classification_id = pec.classification_id
AND pac.payroll_action_id = ppa.payroll_action_id
AND ppa.time_period_id = ptp.time_period_id
AND TO_CHAR (ptp.pay_advice_date, 'Mon-YYYY') =
TO_CHAR (SYSDATE, 'Mon-YYYY')
AND petf.element_name = 'Motar Ahlami Loan'
--and employee_number='10185'
AND papf.person_id = p_person_id;
EXCEPTION
WHEN no_data_found THEN
--DBMS_OUTPUT.PUT_LINE('ERROR: No data!');
l_remaining_amount:=0;
WHEN others THEN
DBMS_OUTPUT.PUT_LINE('Error ');
END;
select GET_CAR_LOAN_ELIGI_AMT(P_PERSON_ID)
into l_eligible_amt
from dual;
IF l_contract_type NOT IN ('Permanent') THEN
l_message := 'Contract Type Is not valid';
END IF;
IF l_loan_eligible_date < SYSDATE THEN
l_message:= 'Date of Join is less then one year';
END IF;
IF l_grade IN ('US','00','AUS','EM') THEN
l_message:= 'Your are not Eligible Grade';
END IF;
IF l_old_loan_end_date < SYSDATE THEN
l_message:= 'Previous Loan Duration is not completed';
END IF;
IF l_max_loan_end_date > P_DEDUCTION_END_DATE THEN
l_message:= 'Maxinum number of monthly payment of 48 month';
END IF;
IF l_remaining_amount >0 THEN
l_message:= 'Previous Car Loan amount is pending till';
END IF;
IF l_eligible_amt < p_loan_value THEN
l_message:= 'Please check Eligible Amount ';
END IF;
RETURN nvl(l_message,'S');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN 'Error';
END CAR_LOAN_VALIDATION;
END XX_CAR_LOAN_REQUEST_PKG;
CALLABLE STATEMENT CODE ---CO CODE
if(pageContext.getParameter("Submit")!=null) {
OAViewObject vo2 = (OAViewObject)am.findViewObject("XxadtcCarLoanRequestEOVO1");
if(vo1!=null){
vo1.getCurrentRow().setAttribute("LoanStatus","Pending Approval");
int xxpersonId = pageContext.getEmployeeId();
String xxDeductionStartDate = vo2.getCurrentRow().getAttribute("DeductionStartDate").toString();//pageContext.getParameter("DeductionStartDate").toString();
// SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy/mm/dd");
// Date convertedDate1 = dateFormat1.parse("xxDeductionStartDate");
String xxDeductionEndDate = vo2.getCurrentRow().getAttribute("DeductionEndDate").toString();//pageContext.getParameter("DeductionEndDate").toString();
// SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy/mm/dd");
// Date convertedDate2 = dateFormat2.parse("xxDeductionEndDate");
String xxLoanValue = vo2.getCurrentRow().getAttribute("LoanValue").toString();//pageContext.getParameter("LoanValue").toString();
int iLoanValue = Integer.parseInt(xxLoanValue);
System.out.println("Entered into submit loop");
System.out.println("xxpersonId id is:"+xxpersonId);
System.out.println("xxDeductionStartDate id is:"+xxDeductionStartDate);
System.out.println("xxDeductionEndDate id is:"+xxDeductionEndDate);
System.out.println("xxLoanValue id is:"+xxLoanValue);
OADBTransaction txn = am.getOADBTransaction();
String sql ="BEGIN :1 :=XXADTC_CAR_LOAN_REQUEST_PKG.CAR_LOAN_VALIDATION(:2,:3,:4,:5); END;";
CallableStatement cs = txn.createCallableStatement(sql,1);
String outputval = null;// int outputval = 0;
try {
System.out.println("Entered in try loop of callable funtion validation");
cs.setInt(2,xxpersonId);
System.out.println("cs setInt(2,xxpersonId);is executed");
cs.setString(3,xxDeductionStartDate);
System.out.println("cs.setString(3,xxDeductionStartDate is executed);");
cs.setString(4,xxDeductionEndDate);
System.out.println("cs.setString(4,xxDeductionEndDate is executed);");
// cs.setDate(3,xxDeductionStartDate);
// cs.setDate(4,xxDeductionEndDate);
cs.setInt(5,iLoanValue);
cs.registerOutParameter(1,Types.VARCHAR);// cs.registerOutParameter(1,Types.NUMERIC);
cs.execute();
outputval = cs.getString(1);// txn.commit();
System.out.println(outputval);
txn.commit();
if(outputval.equals("S"))
am.invokeMethod("apply");
else
throw new OAException("Organization name is:"+outputval,OAException.INFORMATION);
txn.commit();
catch(Exception sqle){
try {
cs.close();
catch (Exception e)
throw OAException.wrapperException(e);
throw OAException.wrapperException(sqle);
Please help .where is the error is.
please help
let me know for any clarification.
Thanks
Aravinda.Hi Arvinda,
Refer Below code.
// In Controller
java.sql.Date DeductionSDate; //declare variable
//In PFR
String xxDeductionStartDate = vo2.getCurrentRow().getAttribute("DeductionStartDate");
OADBTransaction txn = am.getOADBTransaction();
if(xxDeductionStartDate!=null)
java.sql.Date startDate= txn.getOANLSServices().stringToDate(xxDeductionStartDate);
DeductionSDate = startDate;
Set this to cs.setDate(3,DeductionSDate);
Thanks,
Dilip -
Calling pl/sql procedure from a java class.
I have an onSubmit event that needs to call a pl/sql procedure using the named connection. Can anyone tell me how this is code in a Model 1 ADF JSP page?
Look at the following related thread:
Programatically setting attribute values.
Maybe you are looking for
-
ITunes doesn't detect that my iPod is connected
I plugged my iPod touch in today so I could sync it, and the USB found sound was played, followed by a USB error sound. iTunes did not recognise that my iPod was connected and would not sync it. I looked in Device Manager and there was an exclamation
-
Std. Transaction / Report to List all PO's with no invoice posting
Hi All, I would like to know is there a standard transaction or report, which lists out all PO's for which goods receipt has been done, but invoice posting has not been done? Vivek
-
Lightroom 4.4 will not import NEF RAW files from Nikon D610
I shoot a Nikon D800 and have never had any issues importing my NEF RAW files into Lightroom. I borrowed a friend's Nikon D610 and shot a bunch of NEF RAW files. I downloaded them to my computer the same way I always do. For some reason, Lightroom wi
-
Hi, in ECC system there is a SOC3 table with very-very-very large size... 30 GB. Is it OK to run report RSBCS_REORG from note 966854? Regards.
-
My iBook library shelves are empty. When I tap on the iBook icon, the previously filled shelves appear and are empty. The screen then arbitrarily goes to blank book pages that won't turn. Also, there are nom icons at the top of either the shelves or