Send String[][] type to pl/sql procedure from function in App.module
Hi,
I use jdveloper 11.1.1.3.0
I have a pl/sql procedure. the input type argument is 2-dimensional array(TAR) :
types:
create or replace TYPE ARRAYWEB as varray(160) of VARCHAR2(200);
create or replace TYPE TAR as table of ARRAYWEB;
Procedure:
PROCEDURE testi(info IN TAR )
I want to send type String[][] to this procedure from a function in Application module:
1: String[][] str;
2: CallableStatement plsqlBlock = null;
3: String statement = "BEGIN testi(:1); END;";
4: plsqlBlock = getDBTransaction().createCallableStatement(statement, 0);
5: plsqlBlock.setArray(1, str); //get error
6: plsqlBlock.executeUpdate();
but in line 5 I don't know what type I should use, and this type(Array) doesn't work
Habib
Maybe this can help: http://www.devx.com/tips/Tip/22034
Dario
Similar Messages
-
Send Datetime2 value to a SQL Procedure from Java using Hibernate
Hi All,
I Have a Procedure which takes a parameter of type datetime2.
The procedure is called from Java Hibernate.
How can I Pass datetime2 value to SQL procedure from Java?
Thanks in advance,
Shraddha GoreYou may define a global empty array in some package. Then you can do:
SQL> CREATE OR REPLACE PACKAGE pkg
AS
g_empty DBMS_SQL.varchar2_table;
END pkg;
Package created.
SQL> CREATE OR REPLACE PROCEDURE p (
p_tuids IN DBMS_SQL.varchar2_table "DEFAULT pkg.g_empty"
AS
BEGIN
NULL;
END p;
Procedure created.
SQL> BEGIN
p ();
END;
PL/SQL procedure successfully completed. -
Problem calling PL/SQL procedures from Function Activity Issue
Hi,
I am working with Oracle Workflow and I have found some problems adding a function activity in the process diagram. This function only updates some registers on the data base, or at least it should do that.
I have been looking through the items in this forum and I have found similar things but not the right one. Of course I am a learner in all this and maybe the answer in there.
I will try to show you my problem:
When the procedure is supposed to be called, it doesnt´t do that and instead I found the following error:
Wf_Engine_Util.Function_Call(usuario.WF_FIN_TG.FINTG1, FLUJO1, 092S0087, 588782, RUN) ORA-01403: no data found
I have tested all the queries from TOAD and SAL Server, and all of them return some results.
I have tried to take out all the queries from the procedure as the following to try to avoid or change the error but it continues as "ORA-01403: no data found":
PROCEDURE FINTG1(
p_itemtype IN VARCHAR2,
p_itemkey IN VARCHAR2,
p_actid IN NUMBER,
p_funcmode IN VARCHAR2,
p_resultado IN OUT VARCHAR2
) IS
flujo VARCHAR2(;
p_resultado :=1;
END FINTG1;
It seems as the workflow engine try to search something before executing my procedure.
Has anybody any idea about how to solve this problem? Thanks a lot.WF_ENGINE_UTIL.Function_Call is the lowest level procedure executed by the engine before it executes the procedure associated with the function activity. I am not sure if this procedure would throw ORA 1403 since this does not have a query or a collection.
Please note that ORA 1403 could occur from a SQL query or a collection.
Looking at your code, p_resultado :=1;
The function activity should return a resultout that the workflow engine understands. The valid results from the function activities as per the workflow guide are,
wf_engine.eng_completed - 'COMPLETE'; -- Normal completion
wf_engine.eng_active - 'ACTIVE'; -- Activity running
wf_engine.eng_waiting - 'WAITING'; -- Activity waiting to run
wf_engine.eng_notified - 'NOTIFIED'; -- Notification open
wf_engine.eng_suspended - 'SUSPEND'; -- Activity suspended
wf_engine.eng_deferred - 'DEFERRED'; -- Activity deferred
wf_engine.eng_error - 'ERROR'; -- Completed with error
You would normally use COMPLETE or ERRORED within your activity. Please change your code to use a valid resultout and try again.
Hope this helps.
Thanks -
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. -
Invoking PL/SQL procedure from JSP
Hi
Is there any solution, to invoke a PL/SQL procedure from JSP?my example: PL/SQL procedure named: getsidforwinuser and the following in a JSP file
<%
try {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:port:SID", "User", "Password");
CallableStatement FindID = conn.prepareCall("{ ? = call getsidforwinuser ( ? )}");
FindID.registerOutParameter (1, Types.INTEGER);
FindID.setString (2, DomainIntern.trim()+"\\"+Username);
UserID = ((OracleCallableStatement)FindID).getInt(1);
conn.close();
catch(SQLException e)
throw new RuntimeException("SQL Exception " + e.getMessage());
%>
<h1>User ID is:<%= UserID %></h1> -
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. -
How to call a PL/SQL procedure from a Java class?
Hi,
I am new to the E-BusinessSuite and I want to develop a Portal with Java Portlets which display and write data from some E-Business databases (e.g. Customer Relationship Management or Human Resource). These data have been defined in the TCA (Trading Community Architecture) data model. I can access this data with PL/SQL API's. The next problem is how to get the data in the Java class. So, how do you call a PL/SQL procedure from a Java program?
Can anyone let me know how to solve that problem?
Thanks in advance,
Chang Si ChouHave a look at this example:
final ApplicationModule am = panelBinding.getApplicationModule();
try
final CallableStatement stmt = ((DBTransaction)am.getTransaction()).
createCallableStatement("{? = call some_pck.some_function(?, ?)}", 10);
stmt.registerOutParameter(1, OracleTypes.VARCHAR);
stmt.setInt(2, ((oracle.jbo.domain.Number)key.getAttribute(0)).intValue());
stmt.setString(3, "Test");
stmt.execute();
stmt.close();
return stmt.getString(1);
catch (Exception ex)
panelBinding.reportException(ex);
return null;
}Hope This Helps -
Deploy warnings using a PL/SQL procedure (from a Public Transform Package)
OWB Version: 10.2
I am receiving the following warnings when I attempt to deploy a map that contains a reference to a custom pl/sql procedure that is setup in a public transformation package:
Warning
ORA-06550: line 115, column 32:
PLS-00112: end-of-line in quoted identifier
ORA-06550: line 115, column 9:
PLS-00103: Encountered the symbol "." when expecting one of the following:
:= . ( @ % ; not null range default character
I reviewed the OWB generated code and I discovered the OWB is a adding two double quotes in front of any reference to the package name. For example.....
BEGIN
COMMIT;
sql_stmt := 'ALTER SESSION DISABLE PARALLEL DML';
EXECUTE IMMEDIATE sql_stmt;
IF NOT ""ZZTEST"."INIT_SF_USER_CLAS_St" THEN
* note the "" in front of ZZTEST, which is the package name.
Has anyone else encountered this issue? I can manually correct the generated the code, but it would be overridden every the time the map is deployed. I encounter the same issue if I import a custom pl/sql procedure from the database into OWB using the Metadata Import Wizard and use the imported procedure in a map. However, I can setup an standalone procedure or function as a public transformation and the map deploys successfully. Please advise.
Regards,
MattYou have to create a job to start your procedure.
Example :
* http://psoug.org/reference/OLD/dbms_job.html
Then create a procedure to start your job, call it from your dashboard and you're done.
Success
Nico -
Call a PL/SQL procedure or function from applet
Could anyone please let me know how I could call a PL/SQL procedure
or function from a JDBC method from applet with Internet Explorer?It depends from where you are calling your PLSQL routine. If it is SQL*Plus then you can use & (ampersand) with the variable to be input at run time.
If you are executing the PLSQL routine from another application (some front end application) then it's not possible. Because when a procedure is executing at server side, the front end application does not have control, and the control is only transfered back to front end application when the PLSQL routine either completes successfully or throws an exception.
In either case, you can not go back to the PLSQL routine.
In this case, what you can do is, write code in your front end application to get that variable value from user and then pass that value to PLSQL routine. -
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. -
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 -
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. -
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 -
Sending an emial through PL/SQL procedure
Hi All,
Can any one suggest me how to send an email through PL/SQL procedure without any mail package installed in Database.
ThanksDoes "without any mail package" mean that you don't want to use the UTL_MAIL or UTL_SMTP packages that Oracle delivers (depending on the version of Oracle that you haven't mentioned)?
Justin -
Passing arrays through multiple PL/SQL procedures and functions
I am maintaining a large PL/SQL application. There is a main procedure that is initially called which subsequently passes information to other PL/SQL functions and procedures. In the end an error code and string is passed to PUT_LINE so it can be displayed. What I would like to be able to do is have an array that stores an error code and string for each error that it comes upon during going through each of the procedures and functions. This would involve passing these codes and strings from function to function within the pl/sql application. What would be the best way to implement this and is it possible to pass arrrays or records to other PL/SQL functions? Thanks.
Here is one simulation ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.20
satyaki>
satyaki>
satyaki>create or replace type n_array is table of number;
2 /
Type created.
Elapsed: 00:00:07.10
satyaki>
satyaki>CREATE OR REPLACE PROCEDURE Get_Array(array_in IN n_array,
2 array_out OUT n_array)
3 IS
4 BEGIN
5 array_out := n_array();
6 FOR i IN 1..array_in.count
7 LOOP
8 array_out.extend;
9 array_out(i) := array_in(i) * 2;
10 END LOOP;
11 END Get_Array;
12 /
Procedure created.
Elapsed: 00:00:00.89
satyaki>
satyaki>
satyaki>Create or Replace Procedure Set_Array(myArray IN n_array)
2 is
3 i number(10);
4 rec emp%rowtype;
5 w n_array:=n_array(1200,3200);
6 bucket n_array := n_array();
7 Begin
8 Get_Array(w,bucket);
9
10 for i in 1..myArray.count
11 loop
12 select *
13 into rec
14 from emp
15 where empno = myArray(i);
16 dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename);
17 for j in 1..bucket.count
18 loop
19 dbms_output.put_line('Commission Sub Type: '||bucket(j));
20 end loop;
21 end loop;
22 End Set_Array;
23 /
Procedure created.
Elapsed: 00:00:01.33
satyaki>
satyaki>
satyaki>select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
9999 SATYAKI SLS 7698 02-NOV-08 55000 3455 10
7777 SOURAV SLS 14-SEP-08 45000 3400 10
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 4450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 7000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
13 rows selected.
Elapsed: 00:00:00.28
satyaki>
satyaki>declare
2 v n_array:=n_array(9999,7777);
3 begin
4 Set_Array(v);
5 end;
6 /
Employee No:9999 Name:SATYAKI
Commission Sub Type: 2400
Commission Sub Type: 6400
Employee No:7777 Name:SOURAV
Commission Sub Type: 2400
Commission Sub Type: 6400
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.15
satyaki>
satyaki>Regards.
Satyaki De.
Maybe you are looking for
-
Thinking about buying a wireless HP AIO printer.....
I have a Kindle Fire HD's Tablet. (afiliated with Andriod Tablet). Does anyone know of any wirelsss HP AIO Printers that are compatible with it? I just realized that my perfectly best printer that I every had is now broken. Crazy thing that happene
-
My iphone 5 is not compatible with my MacBook or iTunes!
I have a 2008 MacBook, running OS X 10.5.8, and itunes 10.6.3. I have just received a new iPhone 5, and downloaded the latest version of itunes, but the installer won't run on my computer, as it requires OS X 10.6.8 or later. Tried to install the 10.
-
Source Files deteled from the folders
Hi all, I'm new in Adobe Premiere Pro CS4, and I really need help to recover a couple of files or at leas try to understand what I did wrong. I started a new project from an exiting project file, to suite my project I cleared from the time line and
-
Microsoft OLE DB Provider for Oracle: Data type is not supported.
I got the error: Microsoft OLE DB Provider for Oracle: Data type is not supported. Shortly after upgrading from Oracle 8 to Oracle 9. I was advised to download more up to date oracle drivers, but I was wondering if there was a way to tell what versio
-
Whenever I scan text or documents in Acrobat PRO 9.0, my scanner reverses the colors. I can scan in greyscale and that works fine. Is there a way to reverse the colors on a scanned document? I tried going to -> Preferences -> color management, but th