Passing a parameter to a method in the dataTable's value attribute

Hi,
I'm brand new to JSF, so I might be overlooking something really simple. I'm trying to use a dataTable to display data from a database. It works fine until I try to pass a parameter to "#{customer.all}". My backer bean is ready (or so I believe) and is included after the jsp code snippet. What do I need to do to the jsp/jsf code in order to pass this parameter?
jsp code:
<html>
   <%@ taglib uri="http://java.sun.com/jsf/core"  prefix="f" %>
   <%@ taglib uri="http://java.sun.com/jsf/html"  prefix="h" %>
   <f:view>
      <head>
         <link href="styles.css" rel="stylesheet" type="text/css"/>
         <title>
            <h:outputText value="#{msgs.pageTitle}"/>
         </title>
      </head>
      <body>
         <h:form>
            <h:dataTable value="#{customer.all}" var="customer"
               styleClass="customers"
               headerClass="customersHeader" columnClasses="custid,name">
               <h:column>
                  <f:facet name="header">
                     <h:outputText value="#{msgs.customerIdHeader}"/>
                  </f:facet>
                  <h:outputText value="#{customer.Cust_ID}"/>
               </h:column>
               <h:column>
                  <f:facet name="header">
                     <h:outputText value="#{msgs.nameHeader}"/>
                  </f:facet>
                  <h:outputText value="#{customer.Name}"/>
               </h:column>
               <h:column>
                  <f:facet name="header">
                     <h:outputText value="#{msgs.phoneHeader}"/>
                  </f:facet>
                  <h:outputText value="#{customer.Phone_Number}"/>
               </h:column>
            </h:dataTable>
         </h:form>
      </body>
   </f:view>
</html>backer bean:
package com.corejsf;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.jsp.jstl.sql.Result;
import javax.servlet.jsp.jstl.sql.ResultSupport;
import javax.sql.DataSource;
public class CustomerBean {
   private Connection conn;
   public void open() throws SQLException, NamingException {
      if (conn != null) return;
      Context ctx = new InitialContext();
      DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mydb");
      conn = ds.getConnection();  
   public Result getAll(sName) throws SQLException, NamingException {
      try {
         open();
         Statement stmt = conn.createStatement();       
         ResultSet result = stmt.executeQuery("SELECT * FROM Customers where Name = '" + sName + "'");
         return ResultSupport.toResult(result);
      } finally {
         close();
   public void close() throws SQLException {
      if (conn == null) return;
      conn.close();
      conn = null;
}Thanks,
Dave

Mogambo,
Thanks for the response. Let me see if I understand. Let's say I have a login.jsp page, and after the user logs in I want to display all of his orders in a dataTable in summary.jsp. You're saying I should actually run the query in LoginBean.java after doing the submit, something like this right?
login.jsp:
<html>
   <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
   <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
   <f:view>
      <head>                 
         <title>A Simple JavaServer Faces Application</title>
      </head>
      <body>
         <h:form>
            <h3>Please enter your name and password.</h3>
            <table>
               <tr>
                  <td>Name:</td>
                  <td>
                     <h:inputText value="#{login.name}"/>
                  </td>
               </tr>            
               <tr>
                  <td>Password:</td>
                  <td>
                     <h:inputSecret value="#{login.password}"/>
                  </td>
               </tr>
            </table>
            <p>
               <h:commandButton value="Login"
                  action="#{login.doLogin}"/>
            </p>
         </h:form>
      </body>
   </f:view>
</html>
LoginBean.java:
public class LoginBean {
   private String name;
   private String password;
   private ResultSet results;
   // PROPERTY: name
   public String getName() { return name; }
   public void setName(String newValue) { name = newValue; }
   // PROPERTY: password
   public String getPassword() { return password; }
   public void setPassword(String newValue) { password = newValue; }
   // PROPERTY: results
   public ResultSet getResults() { return results; }
   public void setResults(String newValue) { results = newValue; }
   public String doLogin(){
       Integer liUserID = null;
       // authenticate user and return user's internal ID
       liUserID = authenticateUser(name, password);
       if ( liUserID == null){
            return "failure";
      else{
           results = getUserOrders(liUserID);
           return "success";
faces-config.xml:
<?xml version="1.0"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
        http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
     version="1.2">
   <navigation-rule>
      <from-view-id>/login.jsp</from-view-id>
      <navigation-case>
         <from-outcome>login</from-outcome>
         <to-view-id>/summary.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>
   <managed-bean>
      <managed-bean-name>login</managed-bean-name>
      <managed-bean-class>LoginBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
<navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
    <navigation-case>
      <from-action>#{login.doLogin}</from-action>
      <from-outcome>success</from-outcome>
      <to-view-id>/summary.jsp</to-view-id>
    </navigation-case>
     <navigation-case>
      <from-action>#{login.doLogin}</from-action>
      <from-outcome>failure</from-outcome>
      <to-view-id>/login.jsp</to-view-id>
    </navigation-case>
  </navigation-rule>
</faces-config>And then I assume that my summary.jsp would look like this, using login.results as my value for the dataTable?
<html>
   <%@ taglib uri="http://java.sun.com/jsf/core"  prefix="f" %>
   <%@ taglib uri="http://java.sun.com/jsf/html"  prefix="h" %>
   <f:view>
      <head>
         <link href="styles.css" rel="stylesheet" type="text/css"/>
         <title>
            <h:outputText value="#{msgs.pageTitle}"/>
         </title>
      </head>
      <body>
         <h:form>
            <h:dataTable value="#{login.results}" var="order"
               styleClass="orders"
               headerClass="ordersHeader" columnClasses="orderid,name">
               <h:column>
                  <f:facet name="header">
                     <h:outputText value="#{msgs.orderIDHeader}"/>
                  </f:facet>
                  <h:outputText value="#{order.Order_ID}"/>
               </h:column>
               <h:column>
                  <f:facet name="header">
                     <h:outputText value="#{msgs.nameHeader}"/>
                  </f:facet>
                  <h:outputText value="#{order.Name}"/>
               </h:column>
               <h:column>
                  <f:facet name="header">
                     <h:outputText value="#{msgs.phoneHeader}"/>
                  </f:facet>
                  <h:outputText value="#{order.Phone_Number}"/>
               </h:column>
            </h:dataTable>
         </h:form>
      </body>
   </f:view>
</html>Does this look reasonable?
Thanks,
Dave

Similar Messages

  • How do I pass a parameter to a portlet on the URL?

    I have a portlet on one tab that searches for parts. (This portlet is written and maintained by someone else.) When a user clicks on a part number in the result set on this portlet they need to be taken to another tab (different portlet on the same page) with that part number as a parameter. The second portlet then dynamically writes an
    <iframe src="http://someurl?partnumber=xyz" />
    to call an external application passing the part number as a URL parameter to the external application.
    Writing the <iframe /> dynamically is no problem. The problem is passing the part number from one portlet to another. We planned to do this by using hrefs in the part search portal using URLs like
    http://hostname:port/pls/portal/url/page/test1/portlet2?partnumber=xyz
    for each part number. The problem is that the URL parameter doesn't get passed to the second portlet. Here is the code in the second portlet:
    <%
    PortletRenderRequest portletRenderRequest =
    (PortletRenderRequest)request.getAttribute("oracle.portal.PortletRenderRequest");
    String partnumber = portletRenderRequest.getQualifiedParameter("partnumber");
    %>
    It always sees null for the partnumber parameter.
    I also have <passAllUrlParams>true</passAllUrlParams> in provider.xml.
    I've tried checking this by calling the URL of the second portlet directly from a browser. The portlet sees the partnumber parameter as null, but the URL window in the browser returns the modified URL from the portal with the partnumber parameter set properly. Portal is seeing the parameter but not passing it to the portlet.
    I haven't tried actually setting the in the first portlet and seeing if it all works when called from inside the portal, but I don't see why it shouldn't work by calling the second portlet URL directly with a parameter.
    Am I missing some step in order to pass a parameter from one portlet to another? The parameters I have to pass are dynamic, based on the result set returned by a search in the first portlet.

    My second to last paragraph should have been:
    "I haven't tried actually setting the hrefs in the first portlet and seeing if it all works when called from inside the portal, but I don't see why it shouldn't work by calling the second portlet URL directly with a parameter."

  • Passing Search Parameter to SRM-MDM Through the URL

    Greeting all,
    I would like to know how I can pass a search parameter to SRM-MDM using the URL in the web browser. This is needed to display the result directly instead of listing the whole catalog contents.
    I am trying to pass a search parameter (Text string) to the catalog through an R/3 SAP system. As a result, it should give only the material that I am looking for.
    I tried the "Background Search" as described in the OCI-specification paper but still couldn't get it!
    By using the parameters mentioned in chapter 3.2.4 of OCI-specification paper, I did the recommended configuration and use the following URL but still failed to pass the parameter:  http://....&FUNCTION=BACKGROUND_SEARCH&SEARCHSTRING=searchterm
    Can anyone help me on that?!
    Regards,
    Yousif

    Hi Yousif,
    Why dont u save the search as a named search in MDM and then pass it onto the SRM MDM.
    Save the records  as Named search in MDM Data Manager
    For eg:
    Named Search name -->> search1
    Now while passing the parameters to the SRM MDM Catalog specify the Named Search in its url.
    http://J2EESERVER:PORTNO/SRM-MDM/SRM_MDM?sap-locale=EN&HOOK_URL=&mask=&namedSearch=search1&username=Admin&password=PASSWORD&catalog=REPOSITORYNAME&server=MDMSERVERIPADDRESS&datalanguage=EN
    After passing the named search in the hook url the you will be able to see only the search which was saved in Data Manager.
    Hope dis helps u
    Regards Tejas.........

  • How to create a byte[] as parameter for a Method inside the Controller

    Hi Experts,
    I want to create a method getCachedWebResource inside the component controller which has a parameter file which is of type byte[].
    But in Netweaver Developer Studio I am not able to create this parameter with type byte[] .
    When I try creating a parameter of this type (byte[]) . I get only byte from drop down and  below Array type checkbox is disabled.
    Please help me in this regards.
    I am already highly obliged to his forum with lots of useful answers. Hoping the same this time too
    Best Regards,
    Roby..

    Robert-
    There are two ways of achieving this:
    1. Create a private getCachedWebResource() method inside your component controller's others section. i.e. do not create a method on the Methods tab, but instead code the method directly into the controller.
    2. Create a parameter of type java.lang.Byte[ ] instead of byte[ ]. This can be done by clicking on the Browse button next to the Type and then choosing the Java Native Type radio button. In the Java Native Type input field provide java.lang.Byte. Click on Ok and you should see the Array Type option getting enabled. Check it, and in the method you should convert from java.lang.Byte to byte.
    I would stick to option (1)
    Cheers-
    Atul

  • How to load values from database into the f:selectItems value attribute

    Hi,
    I am trying to load the drop down menu value i.e f:selectItems from the database with a list of values from a column in the databse table. how can i do this? Should i use binding? or is there any other way.
    Note:i am able to load values into f:selectItems from the faces-config.xml file but they are static values. i want the values from the database
    Please reply with sample codes of faces jsp, bean file and config.xml file

    But this is working for me,
    JSF
         <h:selectOneMenu value="#{loadbean.grade}" >
              <f:selectItems value="#{loadbean.gradelist}" />
         </h:selectOneMenu>
    bean
    private String grade;
    private List<SelectItem> gradelist;
    public String getGrade() {
              return grade;
         public void setGrade(String grade) {
              this.grade = grade;
         public List<SelectItem> getGradelist() {
              return gradelist;
         public void setGradelist(List<String> items) {
              gradelist=new ArrayList<SelectItem>();
              gradelist.add(new SelectItem("daniel"));//this value can be from data base
              gradelist.add(new SelectItem("pspindia"));
              gradelist.add(new SelectItem("prelude sys"));
    faces-config.xml
    <managed-property>
              <property-name>gradelist</property-name>
              <null-value/>
    </managed-property>
    this working fine for me. So setter method also works to load value for the h:selectItems
    Thanks a lot.

  • What should be the parameter for forName() method if i use MS SQL server

    if i use the MS SQL Server Personnal Edition, what string i should pass as parametter to forName() method of class Class.
    Class.forName ("XXXXXXXX");
    ie what should be in the place of XXXXXXX in the above line of code if i use SQL server
    thank u

    com.microsoft.sqlserver.jdbc.SQLServerDriver
    http://msdn2.microsoft.com/en-us/library/ms378956.aspx

  • Passing Parameter from fiori launchpad to the app in sapui5

    Hi All,
    I have a requirement to pass a parameter from Fiori launchpad to the application. Then i have to use that parameter to construct the OData service URL and read the data. So how can we pass the parameters from Fiori launchpad tile to app? Thank you in advance.
    Regards,
    Seshu
    Tags edited by: Michael Appleby (but please start doing this on your own)

    Hi Masa,
    I will explain scenario:
    I have Main.view.xml and Main.controller.js in my App. I read the data in Main.controller.js using the following statement.
    var bus_scenario="Lead to Deal Approval";
    oModel.read("BusScnCollection('"+bus_scenario+"')?$expand=BusinessProcess",null, null, true,function(data,response)
    Now my requirement is to get the value for bus_scenario variable from Fiori launchpad configuration.
    What I did in Fiori launchpad configuration:
    Then, When I launch my app by clicking on tile, the URL appears in the following way.
    https://<server>:<port>/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html#ZCIO_DASHBOARD-display?BUS_SCENARIO = "ORDER TO CASH"
    So I can read this parameter in Main.controller.js and assign to bus_scenario variable. But it is possible that user can change the parameter (from ORDER TO CASH to LEAD TO DEAL) directly in the URL, So that he can get the data corresponding to LEAD TO DEAL (which he should not get). Because when he clicks on ORDER TO CASH Tile, he should get only the data corresponding to it.
    So, is there any other way to send parameters from launchpad configuration to app, so that we can use those parameters in app (Main.controller.js) ?
    is there any way to hide parameters in the URL and send them?
    Thanks & Regards,
    Seshu

  • Passing a parameter to a LookupDispatchAction

    Hi guys. Any idea how am I gonna do that?
    I be got a LookupDispatchAction that has 3-4 methods. The method I am trying to access needs to be passed a parameter. I can get the parameter like
    <html:link page="/updateTLDThrottle.do" paramId="tldName" paramName="item" paramProperty="key">
    delete</html:link>but I want to access a specific method on the updateTLDThrottle action. And I only know how to do that with submit buttons. Any ideas?
    Cheers

    anyone guys?

  • Passing Dynamic Parameter to URL

    Hi All,
    I have a Webdynpro Application, where I am calling a separate iView through a URL (Quick link to that iView) using a LinkToAction UI element.
    Now, we need to pass a parameter (say Part Number) to the external iView through our webdynpro application.
    The external iView when called should be filled with a value by default. This value has to be retreived on some parameter from the main application.
    Can anybody suggest how to achieve this? We are presently using a common URL, so when the external window opens the iView will be blank. But now we need that when the user navigates to the external window, it should appear with the corresponding value.
    How can we make the URL to pass dynamic parameters?
    Any suggestions on this will be appreciated.
    Thanks,
    Becky.

    Hi Becky,
    A Web Dynpro application can get URL parameters passed to the iView with the following code:
    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter();
    You can send URL parameters to a Web Dynpro page in the following ways:
    ●      Add to the URL a parameter called DynamicParameter, whose value is a set of key-value pairs to send to the page.
    The following is the format for the DynamicParameter parameter:
    DynamicParameter="param1=value1&param2=value2&"&
    The value ("param1=value1&param2=value2&") must be URL encoded.
    ●      Add to the URL parameters that start with sap-.
    ●      Add parameters to the businessParameters parameter of the navigateAbsolute() or navigateRelative() method, as described in Absolute Navigation and Relative Navigation.
    iView Parameters
    The following are the URL parameters that get passed to each iView on the page, and then to the underlying Web Dynpro application:
    ·        The static parameters defined in the Application Parameters property for each iView. The property value is a set of key-value pairs in the following format:
    param1=value1&param2=value2&
    ·        The parameters passed to the page (those defined in the DynamicParameterparameter as well as all parameters starting with sap-).
    For isolated iViews in a Web Dynpro page, only the parameters specified in the Parameters to Pass from Page Request property for each iView are passed to that iView.
    The property value is a list of parameter names, separated by commas, as follows:
    param1,param2,param3
    To specify all parameters, enter an asterisk (*).
    We did same for one of the requirement in our project let us know if you have any issues.
    Regards
    Jeetendra

  • Calling the super class method from the subclass

    Hi all,
    I have a question about inheritence and redefinition of methods. Is it possible to call the superclass implementation of a method which is redefined in the subclass in another method of the subclass?There are possbilities like creation of an explicit super class instance or delegating the super class method implementation to another method which is also protected etc. What i mean is, is there a direct way of calling it?We have ,me,   as the reference for the instance we have(which is the subclass instance in this case), is there also a way of pointing the superclass implementation(with super we can reference in the subclass redefinition, my question is if we have such a parameter in other methods of the subclass too)
    Thanks in advance
    Sukru

    Hi,
    The super reference can only be used in redefined methods to call superclass implementation . So probably what you can do is use upcasting and access the required superclass implementation. I can think of only this way...;-)
    Ex data lr_super type ref to cl_superclass
    lr_super = lr_subclass.
    lr_super->method().
    ~Piyush Patil

  • Pass a Parameter to Function?

    Hi All,
    can you please tell me is it possible to pass a parameter to a function in the Select statement
    for example
    select * from table(test.get_trans_by_period('141', '123456874', '20000101', '20100101'))
    How can I use BI Publisher to pass the values using parameters
    I tried
    select * from table(test.get_trans_by_period(:p_param1, :p_param2, :p_param3, :p_param4))
    but it's not working
    BR,
    Rossy

    You can write a data template, and call the function from within the xml block for the data template, as in a database query.
    The rtf supports xsl code behind the tags, so can write xsl code in rtf.

  • Need to display the first 5 values of a Multi value parameter in SSRS report

    Hi All,
    I have SSRS report with multi value parameter. I need to display the parameter selection values in a text box. I've more than 50 records in the multi value parameter list. I've included the code to display "All" if I choose "select
    all" option otherwise it will show the selected values. But, I need to change the logic. I have to show only the 1st 5 records if I choose more than 5 records.
    How can I implement this?
    I have used the below code
    =iif(
    Parameters!Country.Count = Count(Fields!Country.Value,
    "Country")
    ,"All"
    ,iif(Parameters!Country.Count>5
    ,"Display the 1st 5 values"
    ,Join(Parameters!Country.Value,",")
    Regards,
    Julie

    Hi Julie,
    Per my understanding that you want to always show the first values from the param country to a textbox when you have select more then five values from the dropdown list, if you checked "select all", textbox will display "All", if
    you select <=5 amount of values. it will display the selected values, right?
    I have tested on my local environment and that you can create an hide parameter(Param2) to display just the first five values from the Country and when you select more then five values from country you will get the Join(Parameters!Param2.Value,",")
    to display.
    Details information below for your reference:
    Create an new DataSet2 which the Param2 will get the values from:
    SELECT     TOP (5) Country
    FROM        tablename
    Create an new param2 and hide this parameter, Set the "Available values" and "Default values" by select the "Get the values from a query"(DataSet2)
    You can also Specify first five value for the "Available values" and "Default values", thus you will not need to follow the step1 to create the dataset2
    Modify the expression you have provided as below:
    =iif(Parameters!Country.Count = Count(Fields!Country.Value, "DataSet1"),"All" ,iif(Parameters!Country.Count>5 ,Join(Parameters!Param2.Value,","),Join(Parameters!Country.Value,",")))
    Preview like below
    If you still have any problem, please feel free to ask.
    Thanks, 
    Vicky Liu
    If you have any feedback on our support, please click
    here.
    Vicky Liu
    TechNet Community Support

  • How to pass a value to the export parameter for a method (public instance)?

    Hello,
      I am trying ABAP OO newly. How to pass a value to the export parameter for a method (public instance) called in a report? This *export parameter has a reference type of structure.
    Thanks in advance,
    Ranjini

    Hi,
    "class definition
    class lcl... definition.
      public section.
        method m1 imporitng par type ref to data.  "now you can pass any reference to the method, but this way you have to maintain this reference dynamically inside the method (you can't be sure what that reference is really "pointing" at)
    endclass.
    "in program
    data: r_lcl type ref to lcl...
    create object r_lcl.
    call method r_lcl
      exporting
         par    =  "pass any reference variable here
    Regards
    Marcin

  • How do I Pass a parameter to a SQL Component Task where the source SQL statement is also a variable

    Hi,
    I have been tasked with making a complex package more generic.
    To achieve this I need to pass a parameter to a SQL Component Task where the source SQL statement is also a variable.
    So to help articulate my question further I have create a package and database as follows; -
    USE [KWPlay]
    GO
    /****** Object: Table [dbo].[tblTest] Script Date: 05/14/2014 17:08:02 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[tblTest](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [Description] [nvarchar](50) NULL,
    CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    I populated this table with a single record.
    I unit tested the SQL within SSMS as follows;
    SELECT * FROM dbo.tblTest
    Result; -
    ID           
    Description
    1             
    Happy
    DECLARE @myParam NVARCHAR(100)
    SET @myParam = 'Sad'
    UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    SELECT * FROM dbo.tblTest
    Result; -
    ID   
    Description
    1    
    Sad
    Within the package I created two variables as follows; -
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = @myParam FROM dbo.tblTest WHERE ID = 1
    Name: strStatus
    Scope: Package
    Data Type: String
    Value: Happy
    I then created a single ‘Execute SQL Task’ component within the control flow as follows; -
    However when I run the above package I get the following error; -
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = @myParam FR..." failed with the following error:
    "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. 
    The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the
    errors.
    SSIS package "Package.dtsx" finished: Failure.
    I also tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    However I received the error; - 
    SSIS package "Package.dtsx" starting.
    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "UPDATE dbo.tblTest SET [Description] = ? FROM dbo...." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with
    the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Task failed: Execute SQL Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
    the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    SSIS package "Package.dtsx" finished: Failure.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Tried; - 
    Name: strSQL
    Scope: Package
    Data Type: String
    Value: UPDATE dbo.tblTest SET [Description] = ? FROM dbo.tblTest WHERE ID = 1
    and; - 
    Result; - 
    SSIS package "Package.dtsx" starting.
    SSIS package "Package.dtsx" finished: Success.
    Therefore the answer was to put the parameter number rather than the parameter name under the parameter mapping tab-> parameter name column. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

  • Passing parameter in a method

    hi i have a situation where i have to pass parameter to my method i don't what to pass the parameter define from the viewO because am not using parameter to query from the view,i just what to pass it to my procedure,my method is
                    public void submit_agr(String par_id,String dref_id,String tas_id,String agr_id){
                        ViewObject sub = this.findViewObject("AGR1");
                      i don't what to use this-> sub.setNamedWhereClauseParam("tas_id", tas_id); the tas_id is not in AGR1 VIEWO
                      // sub.
                        sub.executeQuery();
                        Row row = sub.first();
                        par_id = (String)row.getAttribute("par_id");
                        agr_id = (String)row.getAttribute("id");
                        callPerformSdmsLogon("SMS_FORM_TO_ADf.delete_agr(?)", new  Object[] {par_id,dref_id,tas_id,agr_id});
                    }

    i try this AM IN jDEVELOPER 11.1.2.1.0
                    public void submit_agr(String par_id,String dref_id,String tas_id,String agr_id){
                        ViewObject sub = this.findViewObject("AGR1");                 
                        Row row = sub.first();
                        sub.setNamedWhereClauseParam("tas_id", new Number(10));-how will i pass this to my procedure
                        sub.setNamedWhereClauseParam("dref_id", new Number(10));-how will i pass this to my procedure
                        par_id = (String)row.getAttribute("par_id");
                        agr_id = (String)row.getAttribute("id");
                        sub.executeQuery();
                        callPerformSdmsLogon("SMS_FORM_TO_ADf.delete_agr(?)", new  Object[] {par_id,dref_id,tas_id,agr_id});
                    }how will i pass the two prameter to my procedure
    Edited by: Tshifhiwa on 2012/07/01 3:14 PM

Maybe you are looking for