Wrong Number Of Parameters For A Method
Exactly like the title. If I pass in too many or too few parameters in a method, am I allowed to add a customized error message?
JW, Thanks.
It's not possible to pass in too many or too few characters. The compiler would prevent it, and generate its own error message.
I suppose you could do something like this if you were using varargs....but why bother?
Similar Messages
-
Exception has occurred during data insertion ... Wrong number of parameters
I am using an ADO dataflow source and an ADO dataflow destination to move data from a table on an IBM iSeries DB2 database to another IBM iSeries DB2 database on another machine. The connection managers for source and destination both use .Net Providers\Odbc
Data Provider with the Data Source Specification being ODBC connections specified on the Windows Server 2008 r2 machine hosting bids. All the test connections work...so far so good.
Issue is when I execute the control flow task the rows get picked up from the source DB2 database no problem but it fails on the insert to the destination DB2 table...The progress tab specifies the exceptions...
[ADO NET Destination [601]] Error: An exception has occurred during data insertion, the message returned from the provider is: ERROR [07002] [IBM][System i Access ODBC Driver]Wrong number of parameters.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "ADO NET Destination" (601) failed with error code 0xC020844B while processing input "ADO NET Destination Input" (604). The identified
component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the
failure.
I put a data viewer on the data flow connection and the records I expect are getting picked up and look ok. I checked to make sure the source and destination tables have the same number of columns in their record layout and identical data
types and they look fine.
Could someone kindly tell me whats going wrong? Does the error message indicate that some of the columns are getting dropped from the dataset before the insert?
Thanks much in advance for any help, RoscoeHi Roscoe,
Glad to hear that you have found the root cause. So, the issue occurs because numeric values with no decimal cannot be inserted into the Decimal data type column in the DB2 table. In SSIS, data type Decimal of DB2 database is mapped to data type DT_NUMERIC.
To address the issue, you can do a data conversion for the column in question to define its precision and scale such as DT_NUMERIC(9,2) by using the Data Conversion Transformation before the ADO NET Destination.
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support -
Wrong number of parameters exception when using PreparedStatement
Hi,
I'm getting Wrong number of parameters exception when using a prepared statement. It's very weird. The code is:
sqlstmt="update blah1 set blah2=? where blah3=?";
myps = Conn.prepareStatement(sqlstmt);
myps.setString(1, p1);
myps.setInt(2, p2);
myps.executeUpdate(sqlstmt);
The error is:
SQLException: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001:07001
Could someone please help? Thanks
MahdadHi and thanks for the reply.
Actually this is the try block...
The variable's defintions are correct.
PreparedStatement myps;
try {
sqlstmt="update blah1 set blah2=? where blah3=?";
myps = Conn.prepareStatement(sqlstmt);
myps.setString(1, blah4);
myps.setInt(2, blah5);
myps.executeUpdate(sqlstmt);
catch (SQLException e) {
System.out.println("SQLException: " + e.getMessage() + ":" + e.getSQLState());
blah6++; -
Whats wrong with this code?
public void updateProduct(String id, String name, String description, String cost){
Connection conn = null;
DataSourceManager dataSource = new DataSourceManager();
conn = dataSource.getConnection();
PreparedStatement stmt;
try {
String updateString = "UPDATE PRODUCT SET PRODUCT_NAME = ?, DESCRIPTION = ?, COST = ? WHERE PRODUCT_ID LIKE ?";
stmt = conn.prepareStatement(updateString);
stmt.setString(1, name);
stmt.setString(2, description);
stmt.setDouble(3, Double.parseDouble(cost));
stmt.setString(4, id);
stmt.executeUpdate(updateString);
conn.commit();
} catch (SQLException sqle) {
sqle.printStackTrace();
I get:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0100E Wrong number of parameters. SQLSTATE=07001
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:256)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:193)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:444)
at COM.ibm.db2.jdbc.app.DB2Statement.execute2(DB2Statement.java:435)
at COM.ibm.db2.jdbc.app.DB2Statement.executeUpdate(DB2Statement.java:381)
at com.ibm.ejs.cm.cache.CachedStatement.executeUpdate(CachedStatement.java:132)
at com.ibm.ejs.cm.proxy.StatementProxy.executeUpdate(StatementProxy.java:190)
at com.bright.coffeeplease.persistence.ProductPersister.updateProduct(ProductPersister.java:114)
at com.bright.coffeeplease.product.UpdateProductServlet.doGet(UpdateProductServlet.java:24)
at com.bright.coffeeplease.product.UpdateProductServlet.doPost(UpdateProductServlet.java:12)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:403)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:227)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:98)
at com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:403)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:227)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:98)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)You don't want to call
stmt.executeUpdate(updateString)
You just want to call executeUpdate() - the prepared statement already knows what you're trying to do.
Hope this helps.
Incidentally, did you really mean "... WHERE PRODUCT_ID LIKE ?" rather than "... WHERE PRODUCT_ID = ?" -
Why 'wrong number of parameters' error in this call to a stored procedure?
A stored procedure exists that inserts a new record and returns the newly generated record ID. This stored procedure is called from a WinForms application but at the ExecuteNonQuery time an exception is thrown indicating that the wrong number of parameters
has been supplied. If I take out the one parameter that is marked as ParameterDirection.Output then the ExecuteNonQuery does not throw an exception.
CREATE PROCEDURE [dbo].[API_InsertIntoManu]
@Name nvarchar(50),
@Description nvarchar(2000)
AS
SET NOCOUNT ON
INSERT INTO Manu (
[Name],
[Description]
VALUES (
@Name,
@Description
SELECT SCOPE_IDENTITY() As InsertedID
END
GO
The C# code that calls the above SP looks like this:
using (SqlConnection conn = new SqlConnection( "<snipped>" ))
using (SqlCommand cmd = new SqlCommand( "[dbo].[API_InsertIntoManu]", conn ))
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add( Name, SqlDbType.NVarChar, 50 ).Value = "some name";
cmd.Parameters.Add( Title, SqlDbType.NVarChar, 200 ).Value = "some title";
// This parameter is supposed to receive the new row's ID but instead triggers a 'wrong number of args' exception.
cmd.Parameters.Add( "InsertedID",SqlDbType.Int ).Direction = ParameterDirection.Output;
conn.Open();
// This is where the exception gets thrown.
cmd.ExecuteNonQuery();
iReturn = (int)cmd.Parameters[InsertedID].Value;
Richard Lewis HaggardIn you sp the size of Title var is 2000 and not 200, correct this:
cmd.Parameters.Add( "@Title", SqlDbType.NVarChar, 200 ).Value
Fouad Roumieh -
Wrong number of parameters error
We are using jpub and sqlj in Solaris to generate Java Classes for our app.
We also have a set of .sql scripts which in effect clone a schema.
When we run jpub/sqlj against packages in the original schema, everything is fine, but against the clone, while jpub creates sqlj code which is identical to that from the first schema, sqlj complains (when on-line checking is turned on):
A: "JDBC: reports more than one return value for <function name>" and advises that we update our driver;
B:"Did not find <func name> with <n> arguments. found <func name> with <n + a bunch> of arguments" and tells us to check the call.
We have no idea what might be causing this, and when we turn off the on-line checking for sqlj, everything appears to work fine.
Any ideas/suggestions ?<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by SQLJ Development ([email protected]):
Mmmh. This may be a bug in the way SQLJ resolves functions/stored procedures. Could you send me your infile/.sql/.sqlj files so that I can reproduce your problem? Thanks!
In the meantime, if everything works at runtime, you may have to ignore the errors and do your final compile offline.<HR></BLOCKQUOTE>
I haven't forgotten. We've got a lot of code, and will try to boil down to an illustrative example when we can.
At the moment, an off-line compile seems to work - though you might want to check my other post today :-)
null -
Wrong number of arguments for a setcolor operator
Does anyone know what the above message means? I saved a pages document as a .pdf file and when the person I emailed it to tried to open it he got the above message.
He has been able to open previous files I have sent.OK, I have made some progress on this. Try opening the file you created in Pages '08 in Preview and saving under a new name. This is what my friend did and it worked. Here is what he said in his email to me:
+"I opened your file on my MacBook Pro with Preview and then saved again under new name. I could open the file I saved in widows fine but the original file you sent would not open. "+
Unfortunately, it did not work when I retraced his steps on my Mac. However, it is worth a try, and if it doesn't work on your own Mac, try another one you own or see if it will work on a friend's Mac. -
Wrong parameters for multiple targets mapping started in Control Center
Dear experts,
I'm newbie for OWB and I got into the following error when I try to start the loading of one my mapping that consists of 2 Cubes as targets:
INVN_HIST_MAP
Error
ORA-06550: line 1, column 847:
PLS-00306: wrong number or types of arguments in call to 'MAIN'
ORA-06550: line 1, column 841:
PL/SQL: Statement ignored
When I check the the package Main Procedure, I found the number of parameters for 'TRUNCATE_LOAD' and 'AW_EXECUTE_RESULT' doubled compared to the other mappings I have which consist of one target cube only. That explains why I got the error above. My question is whether there's any way to get the Control Center loading work?
Many thanks!Thanks for the reply David. I'm using OWB 10.2.0.4. Is this a known bug? I don't mind splitting into 2 mappings. My only concern is that ~60% of the data processing are overlapping. I'm using MOLAP. Is there a way to share staged table data on 2 different mappings?
-
Variable number of parameters to procedure
I have a requirement to pass variable number of parameters for an attribute, to a stored procedure.
example:
procedure getSum(country_code IN varchar2, sum OUT number)
Inside the procedure, I am currently
writing SQL as
where eligible_code in (country_code).
This is ok when I pass just one code.
However I need to deal with n number of
country codes at a given time.
i.e. if I want to pass 3 country codes
as a concatinated string say "A-B-C"
where A, B, C are 3 different codes,
how do I decode them into a
meaning full
where eligible_code in ('A', 'B', 'C')
Or is there any other way of dealing
with this kind of situation.
The bottom line is I must have a stored
procedure, that takes parameter(s).
Any input/suggestion is highly appreciated.Please try the following, substituting the appropriate table name for your_table and the appropriate column name for eligible_code, then see if you can incorporate some of it into your procedure. Please let me know if it works for you or not.
SQL> EDIT getsum
CREATE OR REPLACE PROCEDURE getsum
(country_code IN VARCHAR2,
p_sum OUT NUMBER)
AS
v_country_codes VARCHAR2 (300);
v_sum NUMBER := 0;
v_sql_statement VARCHAR2 (3000);
v_sql_syntax VARCHAR2 (30000);
cursor_name INTEGER;
ignore INTEGER;
BEGIN
v_country_codes := REPLACE (country_code, '-', ''',''');
v_sql_statement := ' SELECT COUNT (*)
INTO :v_sum
FROM your_table
WHERE eligible_code IN (''' | | v_country_codes | | ''');';
v_sql_syntax := 'BEGIN '| | v_sql_statement | |' END;';
cursor_name := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (cursor_name, v_sql_syntax, DBMS_SQL.NATIVE);
DBMS_SQL.BIND_VARIABLE (cursor_name, ':v_sum', v_sum);
ignore := DBMS_SQL.EXECUTE (cursor_name);
DBMS_SQL.VARIABLE_VALUE (cursor_name, ':v_sum', v_sum);
DBMS_SQL.CLOSE_CURSOR (cursor_name);
p_sum := v_sum;
END getsum;
Save the file.
SQL> START getsum
Procedure created.
SQL> VARIABLE g_sum NUMBER
SQL> EXEC getsum ('A-B-C', :g_sum)
PL/SQL procedure successfully completed.
SQL> PRINT g_sum
G_SUM
3
null -
Passing input parameters to the method call in ADF task flow.
Hi,
I have the following use case:
There is a task flow with 2 jspx pages. In the first page I have 2 input search parameters and search button. the search button calls the webservice data control execute (GET_ACCOUNTOperation) method .
Displaying the search results in the same page is not a problem , but my requirement is that the search results are to be displayed in the second page in tabular form.
To achieve this, I dragged the execute method as the method call in the task flow and specified the input parameters for the method call (right click and add parameters) . I am getting the following exception :
javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.lang.String, java.lang.String)
at com.sun.el.util.ReflectionUtil.getMethod(Unknown Source)
at com.sun.el.parser.AstValue.getMethodInfo(Unknown Source)
at com.sun.el.MethodExpressionImpl.getMethodInfo(Unknown Source)
at oracle.adf.controller.internal.util.ELInterfaceImpl.getReturnType(ELInterfaceImpl.java:214)
at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:135)
at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1035)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:921)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:820)
at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:552)
at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:148)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:43)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
even though the execute method is there and the service is up and running. I am not sure whether its the correct way of doing it. Please shed some light on how to solve this use case
Some additional info:
Under the data controls pallete, the GET_ACCOUNTOperation method has a parameters section , which has "part" (java.lang.Object) as
the input parameter.
Regards,
RampalHi,
thanks for the quick turn-around. Jdev version that i am using is Studio Edition Version 11.1.1.6.0. And i am using SOAP. Isnt there a way without using a backing bean? I am planning to use it as a portlet. Would'nt creating a backing bean cause a problem in that case?? Also i am confused here . The method that i am dragging is GET_ACCOUNTOperation(Object). I tried passing the hashmap . It gave the following exception :
javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.util.HashMap)
Rampal -
Dynamic parameters in addEventListener method
Hi all,
I've got an question. I would like to make dynamic parameters for the method addEventListener. Like the example below
var temp:String = "class.method";
schermObject.addEventListener(MouseEvent.CLICK, temp);
But this do not work.
It needs a function Object. But i hadn't figure out how to make a dynamic function object with the
correct method in it.
so....
Does anybody knows how to pull this off?
kind regards,
Anton PierhagenHi Anton Pierhagen,
There is no direct way for doing this , but there is nice work aorund for this as shown below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
<mx:Script>
<![CDATA[
private function init():void
var temp:String = "class.method";
schermObjectBtn.addEventListener(MouseEvent.CLICK, function (event:MouseEvent):void{
callAnotherFunction(event,temp);
private function callAnotherFunction(event:MouseEvent, temp:String):void
]]>
</mx:Script>
<mx:Button id="schermObjectBtn" label="Click ME"/>
</mx:Application>
If this post answers your question or helps, please kindly mark it as such.
Thanks,
Bhasker Chari -
Getting error wrong number or type of parameters for EAM_PROCESS_WO_PUB
Hi All,
I am Getting error wrong number or type of parameters for EAM_WO_PROCESS_PUB.PROCESS_WO API, pls any body can help me,pls send code for
EAM_WO_PROCESS_PUB.PROCESS_WO API.
Thanks&Reagrds,
Hanimi Reddy.Hi srini,
I developed code for work order api EAM_PROCESS_WO_PUB.PROCESS_MASTER_CHILD_WO following and i am getting error wrong number or types of arguments in call to 'PROCESS_MASTER_CHILD_WO, pls see the code and help me
CREATE OR REPLACE PROCEDURE SANG_WR_TO_WO_API/*(ERRBUF OUT VARCHAR2, RETCODE OUT VARCHAR2)*/ IS
v_created_by number;
v_updated_by number;
v_updated_name varchar2(30);
V_ENTITY_ID VARCHAR2(30);
l_EAM_WO_RELATIONS_TBL EAM_PROCESS_WO_PUB.EAM_WO_RELATIONS_TBL_type ;
--:= EAM_PROCESS_WO_PUB.g_miss_EAM_WO_RELATIONS_rec;
l_eam_wo_tbl EAM_PROCESS_WO_PUB.eam_wo_rec_type; --:= EAM_PROCESS_WO_PUB.G_MISS_EAM_WO_rec;
l_eam_op_tbl EAM_PROCESS_WO_PUB.eam_op_tbl_type ;--:= EAM_PROCESS_WO_PUB.G_MISS_eam_op_tbl;
l_eam_op_network_tbl EAM_PROCESS_WO_PUB.eam_op_network_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_op_network_tbl;
l_eam_res_tbl EAM_PROCESS_WO_PUB.eam_res_tbl_type;--:= EAM_PROCESS_WO_PUB.G_MISS_eam_res_tbl;
l_eam_res_inst_tbl EAM_PROCESS_WO_PUB.eam_res_inst_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_res_inst_tbl;
l_eam_sub_res_tbl EAM_PROCESS_WO_PUB.eam_sub_res_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_sub_res_tbl ;
-- l_eam_res_usage_tbl EAM_PROCESS_WO_PUB.eam_res_usage_tbl_type := EAM_PROCESS_WO_PUB.G_MISS_eam_res_usage_tbl;
l_eam_mat_req_tbl EAM_PROCESS_WO_PUB.eam_mat_req_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_mat_req_tbl ;
l_eam_direct_items_tbl EAM_PROCESS_WO_PUB.eam_direct_items_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_direct_items_tbl ;
l_x_eam_wo_tbl EAM_PROCESS_WO_PUB.eam_wo_rec_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_wo_rec;
l__x_EAM_WO_RELATIONS_TBL EAM_PROCESS_WO_PUB.EAM_WO_RELATIONS_TBL_type ;--:= EAM_PROCESS_WO_PUB.g_miss_EAM_WO_RELATIONS_TBL;
l_x_eam_op_tbl EAM_PROCESS_WO_PUB.eam_op_rec_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_op_rec ;
l_x_eam_op_network_tbl EAM_PROCESS_WO_PUB.eam_op_network_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_op_network_tbl;
l_x_eam_res_tbl EAM_PROCESS_WO_PUB.eam_res_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_res_tbl;
l_x_eam_res_inst_tbl EAM_PROCESS_WO_PUB.eam_res_inst_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_res_inst_tbl ;
l_x_eam_sub_res_tbl EAM_PROCESS_WO_PUB.eam_sub_res_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_sub_res_tbl;
-- l_x_eam_res_usage_tbl EAM_PROCESS_WO_PUB.eam_res_usage_tbl_type := EAM_PROCESS_WO_PUB.G_MISS_eam_res_usage_tbl ;
l_x_eam_mat_req_tbl EAM_PROCESS_WO_PUB.eam_mat_req_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_mat_req_tbl;
l_x_eam_direct_items_tbl EAM_PROCESS_WO_PUB.eam_direct_items_tbl_type; --:= EAM_PROCESS_WO_PUB.G_MISS_eam_direct_items_tbl ;
l_x_return_status VARCHAR2(30);
l_x_msg_count NUMBER;
l_x_debug VARCHAR2(30);
l_output_dir VARCHAR2(30);
l_debug_filename VARCHAR2(30) ;
l_debug_file_mode VARCHAR2(30) ;
CURSOR CUR_WTW IS
SELECT
EWR.WIP_ENTITY_ID
,EWR.WIP_ENTITY_NAME
,EWR.ORGANIZATION_ID
,WAC.ORGANIZATION_CODE
,EWR.DESCRIPTION
,EWR.ASSET_GROUP_ID
,EWR.ASSET_NUMBER
,EWR.ASSET_NUMBER_DESCRIPTION
,WAC.ACCOUNTING_CLASS
,WAC.MATERIAL_ACCOUNT
,WAC.MATERIAL_OVERHEAD_ACCOUNT
,WAC.RESOURCE_ACCOUNT
,WAC.OUTSIDE_PROCESSING_ACCOUNT
,WAC.MATERIAL_VARIANCE_ACCOUNT
,WAC.RESOURCE_VARIANCE_ACCOUNT
,WAC.OUTSIDE_PROC_VARIANCE_ACCOUNT
,WAC.STD_COST_ADJUSTMENT_ACCOUNT
,WAC.OVERHEAD_ACCOUNT
,WAC.OVERHEAD_VARIANCE_ACCOUNT
,EWR.WORK_REQUEST_OWNING_DEPT_ID
,EWR.WORK_REQUEST_OWNING_DEPT
,EWR.WORK_REQUEST_PRIORITY_ID
,EWR.WORK_REQUEST_PRIORITY
,EWR.WORK_REQUEST_STATUS_ID
,WAC.ORGANIZATION_NAME
FROM
WIP_EAM_WORK_REQUESTS_V EWR
,WIPFV_ACCOUNTING_CLASSES WAC
,WIP_EAM_PARAMETERS WAP
WHERE
EWR.ORGANIZATION_ID = WAC.ORGANIZATION_ID
AND WAC.ORGANIZATION_ID = WAP.ORGANIZATION_ID
AND WAC.ACCOUNTING_CLASS = WAP.DEFAULT_EAM_CLASS
AND EWR.WORK_REQUEST_STATUS = 'Awaiting Work Order';
BEGIN
--i number := 1;
FND_GLOBAL.apps_initialize (1001255, 50326, 700, 0);
V_CREATED_BY := FND_GLOBAL.USER_ID;
V_UPDATED_BY := FND_GLOBAL.USER_ID;
v_updated_name := FND_GLOBAL.USER_name;
for rec in cur_wtw loop
l_eam_wo_tbl.WIP_ENTITY_ID := rec.wip_entity_id;
l_eam_wo_tbl.ORGANIZATION_ID := rec.ORGANIZATION_ID ;
l_eam_wo_tbl.ASSET_NUMBER := rec.ASSET_NUMBER;
l_eam_wo_tbl.ASSET_GROUP_ID := rec.ASSET_GROUP_ID ;
l_eam_wo_tbl.DESCRIPTION := rec.DESCRIPTION ;
--SELECT WIP_ENTITIES_S.NEXTval INTO V_ENTITY_ID FROM DUAL;
EAM_PROCESS_WO_PUB.PROCESS_MASTER_CHILD_WO
(P_PO_IDENTIFIER => 'EAM'
,P_API_VERSION_NUMBER => 1.0
,P_INIT_MSG_LIST => FALSE
,P_EAM_WO_RELATIONS_TBL => l_EAM_WO_RELATIONS_TBL
,P_EAM_WO_tbl => l_eam_wo_tbl
, p_eam_op_tbl => l_eam_op_tbl
, p_eam_op_network_tbl => l_eam_op_network_tbl
, p_eam_res_tbl => l_eam_res_tbl
, p_eam_res_inst_tbl => l_eam_res_inst_tbl
, p_eam_sub_res_tbl => l_eam_sub_res_tbl
--, p_eam_res_usage_tbl => l_eam_res_usage_tbl
, p_eam_mat_req_tbl => l_eam_mat_req_tbl
, p_eam_direct_items_tbl => l_eam_direct_items_tbl
, x_eam_wo_tbl => l_x_eam_wo_tbl
, X_EAM_WO_RELATIONS_TBL => l__x_EAM_WO_RELATIONS_TBL
, x_eam_op_tbl => l_x_eam_op_tbl
, x_eam_op_network_tbl => l_x_eam_op_network_tbl
, x_eam_res_tbl => l_x_eam_res_tbl
, x_eam_res_inst_tbl => l_x_eam_res_inst_tbl
, x_eam_sub_res_tbl => l_x_eam_sub_res_tbl
-- , x_eam_res_usage_tbl =>l_x_eam_res_usage_tbl
, x_eam_mat_req_tbl => l_x_eam_mat_req_tbl
, x_eam_direct_items_tbl => l_x_eam_direct_items_tbl
, x_return_status => l_x_return_status
, x_msg_count => l_x_msg_count
,p_commit =>'N'
, p_debug => 'N'
, p_output_dir => NULL
, p_debug_filename => 'EAM_WO_DEBUG.log'
, p_debug_file_mode => 'w'
END LOOP;
END SANG_WR_TO_WO_API;
COMMIT;
Thanks ,
Hanimi -
How to handle a large number of query parameters for a Browse screen
I need to implement an advanced search functionality in a browse screen for a large table. The table has 80+ columns and therefore will have a large number of possible query parameters. The screen will be built on a modeled query with all
of the parameters marked as optional. Given the large number of parameters, I am thinking that it would be better to use a separate screen to receive the parameter input from the user, rather than a Popup. Is it possible for example to have a search
button on the browse screen (screen a) open a new screen (screen b) that contains all of the search parameters, have the user enter the parameters they want, then click a button to send all of the parameters back to screen a where the query is executed and
the search results are returned to the table control? This would effectively make screen b an advanced modal window for screen a. In addition, if the user were to execute the query, then want to change a parameter, they would need to be able to
re-open screen b and have all of their original parameters still set. How would you implement this, or otherwise deal with a large number of optional query parameters in the html client? My initial thinking is to store all of the parameters in
an object and use beforeShown/afterClosed to pass them between the screens, but I'm not quite sure how to make that work. TIAWow Josh, thanks. I have a lot of reading to do. What I ultimately plan to do with this (my other posts relate to this too), is have a separate screen for advanced filtering that also allows the user to save their queries if desired.
There is an excellent way to get at all of the query information in the Query_Executed() method. I just put an extra Boolean parameter in the query called "SaveQuery" and when true, the Query_Executed event triggers an entry into a table with
the query name, user name, and parameter value pairs that the user entered. Upon revisiting the screen, I want the user to be able to select from their saved queries and load all the screen parameters (screen properties) from their selected query.
I almost have it working. It may be as easy as marking all of the screen properties that are query parameters as screen parameters (not required), then passing them in from the saved query data (filtered by username, queryname, and selected
item). I'll post an update once I get it. Probably will have some more questions as I go through it. Thanks again! -
PLS-00306: wrong number or types of arguments in call in a for loop
Dear all
I recently put up another post about the same error message but as the message now relates to another part of my programme and, in my mind at least, a different conceptual idea, I thought I should start a new top. If that is not right thing to have done then please let me know. I am working in 10.2.
I am trying to pass through multiple variables. When I run the code at the end of this question I get an error message:
PLS-00306: wrong number or types of arguments in call to 'CUR_MAP_LIST'This relates to the line:
FOR var_map_list IN cur_map_list (par_map_list (n))I think the reason the error message comes up is because par_map_list is a associate array / PL/SQL table and cur_map_list is based on %rowtype. Although I could be wrong. However I am not sure what I should be doing so that I don't get such an error message.
I was reading through page 623 on Web Development 9i (by Brown; pub. McGrew-Hill) and pages 357-358 of Oracle Web Application Programming for PL/SQL Developers (by Boardman, Caffrey, Morse, Rosenzweig; pub. Prentice Hall), in order to try and write my code. As well as Oracle's Application Developer’s Guide - Fundamentals (Release 2), page 11-6. In particular the Web Development book uses the following:
create or replace procedure query_department
(in_dept_no owa_util.ident_arr)
is
cursor dept_cursor (nbt_dept_no emp.deptno%TYPE) is
select empno, ename, mgr, sal, comm
from scott.emp
where deptno = nbt_dept_no;
begin
for x in 1 .. in_dept_no.count loop
for dept_rec in dept_cursor(in_dept_no (x)) loop
end loop;
end loop;
end;In that example the cursor selects empno, ename, mgr, sal and comm from emp. So if it is doing that the cursor must be of a VARCHAR2 and NUMBER data type. What I don't understand is the for dept_rec in part. For a start I am not sure where dept_rec comes from? If it is a NUMBER data type, how can the in_dept_no, which is a owa_util.ident_arr associate array / PL/SQL data type work with it. Unfortunately because the example is incomplete and doesn't include procedures relating to the in variables, I am unable to run it and try and learn from what it is doing, so that I can try and relate the concept to my own work.
My programme is as follows. There may be other errors in the code not relating to this error. If so I hope to find these and resolve them once I understand what I should be doing here:
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
var_xml_theme VARCHAR2(32767);
BEGIN
PROCMAPLIST (empty, var_xml_theme);
END maps;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr,
par_xml_theme OUT VARCHAR2
AS
CURSOR cur_map_list IS
SELECT MT.map_title
MI.map_id
OMSN.map_sheet_number_id
WRMF.web_raster_map_id
FROM MAP_TITLE MT
MAP_INFO MI
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF,
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
var_map_list cur_map_list%ROWTYPE;
var_xml_theme VARCHAR2(32767);
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR n IN 1 .. par_map_list.COUNT
LOOP
FOR var_map_list IN cur_map_list (par_map_list (n))
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "WRMFB'||
var_map_list.web_raster_map_id||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
NAME = "Display selected maps"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;Thank you for reading. Kind regards
TimDear everyone
I have now resolved the problems I was having with multiple values and checkboxes, thanks to comments in this thread, read large chucks of Oracle PL/SQL Programming by Steve Feuerstein and suddenly realising where I am going wrong in terms of thinking.
For a start, I when I was dealing with the multiple values, I was trying to get PL/SQL to pass them out. Of course this is done by the action part of the input form. Although I have not done much web coding, I did know about this. However because I was so engrossed in trying to understand how multiple values work, I didn't relate the two ideas. I even mind mapping the problem and still didn't get it.
I also did not think to change my the action from post command to get, so that I could see what was coming out. However that would not have made too much of a difference because the other problem I had was related to where sub programmes were declared. The function which received the values was privately declared, and not in the package spec. This meant the web browser could not find the function as that can only make use of the programmes declared publicly.
Once I made these changes, as well as correcting other minor typing mistakes, the values passed through as expected. The only other mistake I made was to include the name option after the submit input type. In my case I did not need to submit the value of that button. The revised code is as follows. In this version I replaced the function with a procedure that simply prints the checkbox values to screen. I have also made the input form action get, instead of post, so that the values can be seen in the web browser address bar:
create or replace
PACKAGE MAPSITE AS
PROCEDURE MAPS;
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT OWA_UTIL.IDENT_ARR
PROCEDURE PROCDISPLAY
(maplist IN OUT OWA_UTIL.IDENT_ARR);
END MAPSITE;
create or replace
PACKAGE BODY MAPSITE AS
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
BEGIN
PROCCHECKLIST (empty);
END MAPS;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr
AS
CURSOR cur_map_list IS
SELECT MT.map_title,
MI.map_id,
OMSN.map_sheet_number_id,
WRMF.web_raster_map_id
FROM MAP_TITLE MT,
MAP_INFO MI,
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR var_map_list IN cur_map_list
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "maplist"
CHECKED = "' ||
par_map_list ||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;
---PROCDISPLAY PROCEDURE---
PROCEDURE PROCDISPLAY (maplist IN OUT owa_util.ident_arr)
IS
BEGIN
FOR n IN 1..maplist.COUNT
LOOP
htp.print('Checkbox value i.e. var_map_list.web_raster_map_id is: ' ||maplist(n)||'
<P>');
END LOOP;
END PROCDISPLAY;
END MAPSITE;Kind regards
Tim -
Hi,
I have the below Oracle procedure with two parameters , the first one i IS TABLE OF number INDEX BY BINARY_INTEGER, and the second one is of type Ref cursor of predifned RECORD type.
PROCEDURE Proc1(p_proj_comp_no_list IN core_util.ref_t,
p_proj_comp_post_query_cursor OUT t_proj_comp_post_query_cursor
) IS
This has been working fine while we were using DEVART Oracle drivers. however, as soon we move to ODP 11.2.0.1.1 Beta version we get the below error while executing the procedure via ODP.
{"ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to 'PROJ_COMP_POST_QUERY'\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored"}
Below is the debug watch result of the two parameters of the COMMAND being executed.
Best Regards,
Prabhakar
+ *base {P_PROJ_COMP_NO_LIST} System.Data.Common.DbParameter {Oracle.DataAccess.Client.OracleParameter}*
ArrayBindSize null int[]
ArrayBindStatus null Oracle.DataAccess.Client.OracleParameterStatus[]
CollectionType None Oracle.DataAccess.Client.OracleCollectionType
DbType String System.Data.DbType
Direction Input System.Data.ParameterDirection
IsNullable false bool
Offset 0 int
OracleDbType Long Oracle.DataAccess.Client.OracleDbType
OracleDbTypeEx Long Oracle.DataAccess.Client.OracleDbType
ParameterName "P_PROJ_COMP_NO_LIST" string
Precision 0 byte
Scale 0 byte
Size 1 int
SourceColumn "" string
SourceColumnNullMapping false bool
SourceVersion Current System.Data.DataRowVersion
Status Success Oracle.DataAccess.Client.OracleParameterStatus
UdtTypeName "" string
+ Value {long[1]} object {long[]}
+ Static members
+ Non-Public members
- [1] {P_PROJ_COMP_POST_QUERY_CURSOR} object {Oracle.DataAccess.Client.OracleParameter}
+ *base {P_PROJ_COMP_POST_QUERY_CURSOR} System.Data.Common.DbParameter {Oracle.DataAccess.Client.OracleParameter}*
ArrayBindSize null int[]
ArrayBindStatus null Oracle.DataAccess.Client.OracleParameterStatus[]
CollectionType None Oracle.DataAccess.Client.OracleCollectionType
DbType Object System.Data.DbType
Direction Output System.Data.ParameterDirection
IsNullable false bool
Offset 0 int
OracleDbType RefCursor Oracle.DataAccess.Client.OracleDbType
OracleDbTypeEx RefCursor Oracle.DataAccess.Client.OracleDbType
ParameterName "P_PROJ_COMP_POST_QUERY_CURSOR" string
Precision 0 byte
Scale 0 byte
Size 0 int
SourceColumn "" string
SourceColumnNullMapping false bool
SourceVersion Current System.Data.DataRowVersion
Status Success Oracle.DataAccess.Client.OracleParameterStatus
UdtTypeName "" string
+ Value {} object {System.DBNull}
+ Static members
+ Non-Public membersHi,
Can you please show the actual code that creates and appends the parameters instead, along with cmd.commandtext?
Thanks
Greg
Edited by: gdarling on Jun 30, 2010 11:54 AM
Also note that unless you're using Oracle Developer Tools for VS to generate the code, this would probably be more appropriate in the ODP forum:
ODP.NET
Maybe you are looking for
-
In SSMS after creating the query Report, how to export excel the same report from SSMS
for Beginners in SSMS after the report is created , how to export the same report to excel, I did try the option to task and export and follow the procedure, this procedure does not export the same report, the one was created, unless I am missing som
-
Business area wise vendor balances report in S_ALR_87012082
Hello Friends, In a Vendor Balances report, the document selection is not available in the dynamic selections and hence i am not able to select the business area to suit the requirement. We have only, vendor master and company code in the dynamic sel
-
My paid for apps wont transfer fron my iphone to my ipad
hi i got a ipad for xmas but my paid for cookery apps wont transfer properly it said i have to pay for parts again
-
Duplicate Invoice Reference Number
Dear All I have a requirement that while Parking an Invoice system should tell me for Duplicate Invoice Number exists, when I am enetring it in Reference filed MIR7. Regards Manoj
-
Physicall inventory with Handling Units
hello, I´m trying to do a program that simulates HUINV03 transaction. Sap Help recomend to use FM HUINV_DOCUMENT_COUNTING to introduce data as HUINV03 does. When I execute the FM via abap report the results seems OK, but when I go to post the documen