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/

Similar Messages

  • How can i pass a parameter to the query to filter the result of this lookup

    Hello,
    i'm developping a web application with JDeveloper 10.1.2 and JHeadStart.
    i realy need to know how can i filter the lookup (LOV) query result.
    in other word, when i click on the lookup, it show all the row that exist in may data base table.
    what i want is how can i pass a parameter to the query to filter the result of this lookup ?
    Thank you

    Hi,
    have a look if this helps
    http://oracle.com/technology/products/jdev/tips/fnimphius/restrictlovlist/restrictlov.html
    Frank

  • Omniportler HTML Layout - How do I pass a parameter to another page?

    How do I pass a parameter to another page from an HTML Layout like I can with the Tabular layout?

    If I have a parameter I can pass it from one page to another, i.e. if I have a list of customers and I want data for that particular customer alone, I can create a page parameter form or an omniportlet where I would then pass the value of that portlet to the page. I would use a string like the following: https://test.test.com/test/page?_pageid=536,7483646&_dad=portal&_schema=test&customer=##CUSTOMER_NAME##

  • How do I pass URL parameter after Update record?

    I have an update record page that successfully updates a record, but when it is redirected to the page it came from it loses any parameters to filter record sets to obtain the correct records.
    When I try to use the Parameters dialog box from the Update Records "select a redirect" dialog box, it results in an error indicator in front of the Update Records line in the Server Behavior, and the web page ceases to update the records.
    How do I pass a parameter to the next page?
    Thanks

    I have found a work around for this issue. By selecting the Insert or Update button and adding a hyperlink with parameter settings. The Hyperlink has the same destination as the Insert records Behavior. When the button is clicked it performs the Insert, and passes the parameters to the destination page..

  • 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."

  • How to use a Sybase table in Oracle SQL statement?

    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.

    user12088323 wrote:
    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.Any Oracle client connected to the Oracle database can access Sybase data through the <font style="background-color: #FFFFCC">Database Gateway for Sybase</font> (it requires an additional license) or the <font style="background-color: #FFFFCC">Database gateway for ODBC</font> (it's free).
    The Oracle client and the Oracle database can reside on different machines. The gateway accepts connections only from the Oracle database.
    A connection to the gateway is established through a database link when it is first used in an Oracle session. In this context, a connection refers to the connection between the Oracle database and the gateway. The connection remains established until the Oracle session ends. Another session or user can access the same database link and get a distinct connection to the gateway and Sybase database.
    Database links are active for the duration of a gateway session. If you want to close a database link during a session, you can do so with the ALTER SESSION statement.
    To access the Sybase server, you must create a <font style="background-color: #FFFFCC">database link</font>. A public database link is the most common of database links.
    SQL> CREATE PUBLIC DATABASE LINK dblink CONNECT TO
    2  "user" IDENTIFIED BY "password" USING 'tns_name_entry';
    --dblink is the complete database link name.
    --tns_name_entry specifies the Oracle Net connect descriptor specified in the tnsnames.ora file that identifies the gatewayAfter the database link is created you can verify the connection to the Sybase database, as follows:
    SQL> SELECT * FROM DUAL@dblink;
    Configuring Oracle Database Gateway for Sybase
    <font style="background-color: #FFFFCC">{message:id=10649126}</font>

  • How do I place an image and insert a different photo for the "mouse down" state?

    I have placed an image within an accordian widget and when I select the "mouse down" area in the states dialog box, i click "fill" in the toolbar and insert the photo i want to display when the image is clicked but this image is "covered up" by the originally placed image and is not seen in my states dialog box.
    I have done this before when i made rectangles and placed images in rectangles. But i soon realized that you cannot add alternative text to images in rectangles for some frustrating reason.
    How do I place and image and have a different image for the mouse down state?

    Hello,
    This effect can only be achieved when you use the images as a Rectangle Fill. And as you mentioned it above, you cannot add alternative text to images because it is added as a fill and not as a image.
    I would suggest you to post this as a feature request on our "Ideas for features in Adobe Muse" section of the forums : http://forums.adobe.com/community/muse/ideas
    Regards,
    Sachin

  • HOW do I create a href to an sql statement?

    Answer to query:
    “You sould create a href to an sql statement ( create new user / passwd : and insert in a table (C_user,C_PASSWD), to have a list of users registred at your application)
    A htp page can manage this
    you should create roles that be granted to users,
    1- create &user dientified by &passwd;
    2- create role1....;
    3- grant &role1 to &user1;
    :user will be added by user if he chooses registration href.
    then he must add information in order to continue registration or push OK to confirm registration and let oracle grant previleges to the new user, a trigger can insert the new informations to the user_table_traces.”
    MY QUESTION:
    HOW do I create a href to an sql statement?
    Thank You

    Hello,
    I have an application written in PL/SQL that sits on top of an Oracle database. I want to know how add a password/login feature to the application. In other words the user can go to a certain URL to access and use the application. However when the user clicks on a certain link that is restricted, then the webpage displays fields so that the user has to enter a username and password. In order to access restricted features of the application such as ADD, UPDATE and DELETE.
    Thanks

  • How to call a FoxPro .prg file through SQL statement

    I created a program exclusive.prg which basically consisted of the statement USE my table exclusive. How can i call this function through a SQL statement using java

    Hi,
    Thank you for he reply.
    Runtime.getRuntime().exec(..)works fine with .exe files.
    but, when a foxpro program file(.prg) is compiled, a (.fxp) file is produced and not a .exe file
    when i write some thing like
    statement.execute("exclusive.fxp")i'm getting an error. here is the stack trace
    java.sql.SQLException: [Microsoft][ODBC Visual FoxPro Driver]Syntax error or access violation
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
         at excel.TestMom.main(TestMom.java:28)i also tried using
    statement.execute("do exclusive.fxp") and
    statement.execute("do exclusive.prg")I got the same error.
    Dont know what else to do.Can you please suggest some way to work around.

  • How to pass a parameter into execute sql task and later use it into dataflow task?

    i am in a situation, where i have a logging table in which i have a primary key called ETL_log_ID which is an identity column and acts as a foreign key for various fact table and dimension tables which are populated using SSIS packages. Now i wanna use the
    ETL_log_ID as a parameter in the execute sql task which populates the log table and pass the same value in the data flow task which populates the facts and dimension. Can you let me know how to pass the parameter in a step by step procedure.
    Thanks,
    Nikhil
      

    Nikhil,
    You can check the following :
    http://www.programmersedge.com/post/2013/03/05/ssis-execute-sql-task-mapping-parameters-and-result-sets.aspx
    http://stackoverflow.com/questions/7610491/how-to-pass-variable-as-a-parameter-in-execute-sql-task-ssis
    Regarding the usage in Dataflow task, Can you elaborate on that a little?
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • How to pass a parameter into a sql expression?

    How to pass a report parameter into a sql expression?

    Hi Donald,
        The functionality of using a parameter in a function is only available in the formula editor and not in SQL Expression. Parameters cannot be passed to the SQL Expression, the main purpose of the SQL Expression is to make use of Database functions to make calculations at the database level but the current functionality of the product only allows you to use Database fields.
    There is an article that talks on SQL Expressions and can be useful http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2016184&sliceId=&dialogID=6018612&stateId=1%200%206020316
    Regards,
    Vinay

  • How can i Pass a parameter to JNLP ?

    How to pass a prarmeter from HTML or JSP or PHP to JNLP ?
    (Not JNLP to application <--- that's i knew)

    Actually, i want to pass a parameter tfrom HTML to JNLP <parameter> field and execute JNLP from HTML

  • How can i pass a parameter into paintComponent()?

    public void paintComponent(Graphics g)
    Graphics2D g2 = (Graphics2D) g;
              for(int i = 150;i<=250;i+=20)
                   for(int a = 50;a<=200;a+=50)
              Rectangle box = new Rectangle(i, a, 15, 15);
    g2.draw(box);
    this is my paintComponent method. as far as i'm concerned, all our codings for drawing must be inside this method rite? My assignment is to create something like a cinema ticket system where we will display all the seats then user enters a position then we mark it. when i prompt the user for the position..how do i pass it into this method? pls help me. obviously the coding to prompt is in another .java file.

    //this is my main
    public class AirAsia extends JComponent {
              static JLabel input, input2;
         private static void test(){
              JFrame frame = new JFrame("Aeroplane Seating");
              frame.setSize(500,500);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
              String prompt = JOptionPane.showInputDialog("Enter x");
         input = new JLabel("You have entered " +prompt);     
    String prompt 2= JOptionPane.showInputDialog("Enter x");
         input 2= new JLabel("You have entered " +prompt2);     
              RectangleComponent component = new RectangleComponent();
    frame.add(component);
              frame.setVisible(true);
    private static void createAndShowGUI()
         JFrame.setDefaultLookAndFeelDecorated(true);
              test();
    public static void main(String[] args)
    createAndShowGUI();
    //now this is my paint component in another file
    public class RectangleComponent extends JComponent
    public void paintComponent(Graphics g)
    Graphics2D g2 = (Graphics2D) g;
              for(int i = 150;i<=250;i+=20)
                   for(int a = 50;a<=200;a+=50)
              Rectangle box = new Rectangle(i, a, 15, 15);
    g2.draw(box);}
              for(int i = 60;i<=160;i+=20)
                   for(int a = 240;a<=820;a+=15)
              Rectangle box = new Rectangle(i, a, 15, 15);
    g2.draw(box);
    first of all, i ask the user to enter 2 inputs which are x and y. so now how do i pass in the x and y into paint component method so i can mark/draw the box?

  • How can I pass URL parameter value to text field?

    Dear Masters,
    I have a text field. I want it to have a value based on the URL parameter, for example:
    http://myapplication.net:7777/pls/apex/f?p=102:1:::::P1_RTNUM:9448,P1_EMAILADD:email.add.here
    I want the value of the text field = P1_EMAILADD after the form was loaded. Also, please have it read-only.
    Thanks a lot.
    Edited by: user6368519 on Sep 16, 2009 11:39 PM

    Thanks Saad,
    Can I email you(I would need your email) for any concerns or just create a new thread for you to look?
    This is ok now. I'm sorry but I just marked this one as an "answered" one last time.
    Thanks for all the help again I appreciate it. ;)
    Thanks,
    Aaron
    [email protected]

  • How to bind/pass multiple input parameters to sql query in BPEL Process

    Hi,
    I have a requirement to invoke a query on a database table to fetch the records based on the few input values or bind variables?
    I have created a Partner link using the DBAdapter service and have used custom SQL, how can i bind and pass multiple bind/input parameters for these queries.
    foreg: if i have to query employee records based on name , desgination and age, these three params would be my input parameter that i will pass when i invoke the BPEL process, bow how can i pass these parameters to the partner link using DBADAPTER service.
    Please help
    Regards

    If the parameter-value is not known beforehand and cannot be determined based on the process instance data at that time, there are 2 options. Either invoke the PL/SQL procedure you named using a DB adapter service to get the value and pass it to the other DB adapter service. Or create a single service (e.g. PL/SQL procedure) that determines the parameter value, executes the query and returns the result. However, this is more a design issue. Does it makes sense to combine these actions in a separate service and use it or are these actions not related? You furthermore state that additional (DB adapter) services make the process heavier. Do you have strict requirements on the time process-instances may run or other such requirements? If not, I think the design-choice on whether combining these actions in a single service should have more priority.

Maybe you are looking for

  • How do I make apples loops that show up in the loop browser

    How do I make apples loops from my audio files that show up in the loop browser, and where do they reside on the computer so that I know they are there.

  • Hyperion Reporting and Analysis - DAS, IR and Job Services Replication..

    Dear All, We are on Hyperion System 9.3.1 on Windows box and Repository in Oracle 10g Database. We have around 300 Interactive scheduled jobs. When these jobs are getting executed Hyperion Services are getting hang and In logs we are getting "Process

  • UI Mass Command opening new window

    Hi all, I need your help. I would like to create new UI Mass Command which will open new IE window. For better understanding of my problem: I've created UI Mass Command which take selected resources and add them to ZIP archive. The final ZIP stream I

  • Error and Warning message documentation

    Hi. I'm looking for general documentation that I can use as a reference whenever the compiler/linker/etc. spews out an error or warning message. For example, I'm trying to build a UnitTest framework and I'm getting the following error from the linker

  • How to troubleshoot CS6 uninstall problems?

    After migrating to a new MacBook Pro (unfortunately without first deactivating source computer Adobe suite), I am now seeking to uninstall Adobe software on new MacBook Pro. Uninstallation repeatedly fails. I used CC cleaner tool, but no CS6 products