Unable to use fn-bea:execute-sql() in an XQuery in Workspace Studio 1.1

When we create an XQuery file in Workspace Studio 1.1 (ALSB 3.0), we are unable to use fn-bea:execute-sql(). It throws an error saying "unknown function". It doesnt allow us to publish the XQuery file to ALSB instance due to the "unknown function" error. However if we directly upload this file to ALSB console, it accepts it and the execute-sql function also works grrat. Can you please let us know if we have to configure anything on the Workspace studio to be able to use XQuery Extensions for Service Bus ? Or can you please let us know if we should declare any namespace in the XQuery file to use fn-bea:execute-sql() in Workspace studio ?

It sounds like a bug. Can you please contact bea support?
Gregory Haardt
ALSB Prg. Manager
[email protected]

Similar Messages

  • How to get multiple records using fn-bea:execute-sql()

    Hi,
    I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
    Regards,
    Nagaraju
    Edited by: user10373980 on Sep 29, 2008 6:11 AM

    Hi,
    Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
    For example:
    fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
    Id Name
    01 XXX
    02 YYY
    03 ZZZ
    I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
    <student>
    <Name>XXX</Name>
    </student>
    I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
    Please suggest.
    regards,
    Venkat

  • Insert query using fn-bea:execute-sql() function

    Hi ,
    How to use sql insert query in Xquery function fn-bea:execute-sql().
    Could you please anyone help me on this.
    Regards
    Rajesh.

    Hi
    Can i use stored procedure in that function to include insert query?
    could you please suggest me on this.
    Please provide some links or tutorial on that.
    Regards
    Rajesh

  • OSB10.3.1 fn-bea:execute-sql - nullable columns and type conversion

    Hi all,
    we are using the fn-bea:execute-sql function to retrieve data from an Oracle db:
    <ctx:route><ctx:service>{   
    fn-bea:execute-sql (
    fn:concat(xs:string($body/urn:clientDataLookup/ds/text()),'.SADataSource'),
    'resultset',
    'SELECT id, name, type_id, domi_country_id, open_date, close_date FROM my_table WHERE id=?',
    xs:string($body/urn:clientDataLookup/id/text())
    </ctx:service></ctx:route>
    Where my_table is defined as below:
    CREATE TABLE my_table
    ID NUMBER,
    NAME VARCHAR2(100 BYTE),
    TYPE_ID NUMBER,
    DOMI_COUNTRY_ID NUMBER,
    OPEN_DATE DATE,
    CLOSE_DATE DATE,
    As you can see ID,TYPE_ID,DOMI_COUNTRY_ID are defined as NUMBER and some columns could be null.
    Below an example of the result from the above query using fn-bea:execute-sql function:
    <resultset>
    <ID>161052.0</ID>
    <NAME>...</NAME>
    <TYPE_ID>3.0</TYPE_ID>
    <DOMI_COUNTRY_ID>2090.0</DOMI_COUNTRY_ID>
    <OPEN_DATE>2010-12-17T00:00:00</OPEN_DATE>
    </resultset>
    In the above example the column CLOSE_DATE is null for the given ID and the CLOSE_DATE tag, as you can see, is not included in the result.
    In addition the values for the columns defined as NUMBER are returned with decimals.
    Is there any way to return also tags for columns that are NULL ? E.g. something like <CLOSE_DATE null="Y"/> ?
    And for the columns defined as NUMBER that are returned with decimals what could we do to force the type without decimals ?
    We are wondering if fn-bea:execute-sql function accepts any extra param in order 'to drive' result format/structure ... as expected ...
    Thanks in advance
    ferp

    It sounds like a bug. Can you please contact bea support?
    Gregory Haardt
    ALSB Prg. Manager
    [email protected]

  • Using Union in Execute SQL Task

    I am using the following SQL statement in an Excute SQL Task:
    declare @RespAreaSubAreaID int, @UserLevelID int, @SubmittedByUserID int, @RespAreaID int, @SubAreaID int
    Set @RespAreaSubAreaID = ?
    Set @SubmittedByUserID = ?
    Set @UserLevelID = ?
    set @RespAreaID = ?
    set @SubAreaID = ?
    select users.User_EmailAddress + ';' As CC
    from users inner join UserLevelsNotificationFrequencys on users.user_Id = UserLevelsNotificationFrequencys.User_id
    where UserLevelID = @UserLevelID and RespAreaSubAreaID = @RespAreaSubAreaID and (NotificationFrequencyID = 4 and users.user_id <> @SubmittedByUserID)
    union
    select users.User_EmailAddress + ',' As CC
    from users inner join UserLevelsNotificationFrequencys on users.user_Id = UserLevelsNotificationFrequencys.User_id
    where UserLevelID = @UserLevelID and RespAreaSubAreaID = @RespAreaSubAreaID and (NotificationFrequencyID = 1)
     I have my parameter mapped correctly. My results set is set to xml because I want it all in one string to use as a variable named User:CC. On the Result Set tab the result name is 0 and the variable name is User:CC. When I run my package I am getting
    the error below. Can I not do a union query in the execute SQL task? I tried to not declare anything and just map to each of the variables that I am passing in the order that they are needed but that didn't work either. Thanks in advance for your help in this
    matter.
     [Execute SQL Task] Error: Executing the query "declare @RespAreaSubAreaID int, @NotificationID
    in..." failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection
    not established correctly.
    Reach for the unknown!

    Thank you for your reply but I am not using the Data Flow. All my work is happening on the Control Flow. I am looping through a set of records and emailing them to the correct
    people. Setting my result set to XML worked for the To Line (See my earlier post Execute SQL task for Email ToLine using COALESCE and two variables) and now I am working on the CC line which is more complicated because it uses a union statement.
    Reach for the unknown!

  • Unable to use backspace key in SQL Developer

    hi
    I am unable to use backspace or arrow keys in SQL worksheet using SQL developer.
    Can any one help me out...?
    You can also contact me on [email protected]
    regards
    Ahsan

    Hi,
    to give a worst case. I downloaded actual releases for JDeveloper and SQLDeveloper for MacOS and on my Mac this case is totally unsolved. I tried to check he settings within the preferences.xml but no "googled" solution works to get SPACE and BACKSPACE to work.
    I will try the older versions.
    I previously used my migrated versions from my older Linux system and everything worked fine. Installing the integrated MacOS versions is fine but using the linux way (using the shell command) seems to work. Hope this will help to find the bug within the packages.
    Bye,
    Holger

  • SSIS - Script Task creates a DTS var and using Foreach loop, Execute SQL needs to INSERT into table from this DTS var.

    I have a script task written in C# that creates an array of strings "arrayFields" after parsing a text file. It saves the array of strings in a DTS variable.
    Each row in array represents a row is comma separated and is a row that must be inserted into a table. For example,
    X and Z are fields in the table
    X1, X2,....Xn
    Z1,Z2,...Zn
    I am using a Foreach Loop  to grab each row and then  Execute SQL Task to take each row from the array and insert each field per row in a table,
    The SQL is something like,
    INSERT dbo.table values(field1, field2,...fieldn) arrayFields?
    What should this this INSERT look like?

    I guess you implemented
    Shredding a Recordset
    Based on what I understood (correct me if I am wrong) you have difficulties mapping the input parameters, if so here is the guide
    http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx
    In short it might look like
    INSERT dbo.table  (ColumnA, ColumnB,...) VALUES (?,?...)
    The syntax for the T-SQL INSERT is http://technet.microsoft.com/en-us/library/dd776381%28v=sql.105%29.aspx
    Arthur
    MyBlog
    Twitter

  • SSIS - Using Variables in Execute SQL Task Error

    The following query in my Execute SQL Task throws the following error when run - [Execute SQL Task] Error: Executing the query "SELECT @columnz = COALESCE(@columnz + ',[' + times..." failed with the following error: 
    "Must declare the scalar variable "@columnz".". Possible failure reasons: Problems with the query, 
    "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Query:
    drop table tmpNCPCNCDownstreamMaxUtilization3wks
    select node, max(utilization) as max_Utilization, DATE
    into tmpNCPCNCDownstreamMaxUtilization3wks
    from stage_ncpcncdownstream_temporal
    WHERE Date BETWEEN DATEADD(day, -20, GETDATE()) AND GETDATE() 
    group by node, date
    order by node
    go
    alter table tmpNCPCNCDownstreamMaxUtilization3wks add Timestamp varchar(50)
    go
    update tmpNCPCNCDownstreamMaxUtilization3wks
    set Timestamp = 'WeekOf_' + cast(left(Date, 11) as varchar)
    go
    --drop table tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
    --go
    declare @columnz varchar (8000)
    go
    SELECT @columnz = COALESCE(@columnz + ',[' + timestamp + ']','[' + timestamp+ ']')
    FROM tmpNCPCNCDownstreamMaxUtilization3wks group by timestamp order by timestamp
    go
    --pivot contents in @columns
    declare @query varchar(8000)
    SET @query ='select * into tmpNCPCNC_DownstreamNodeUtilizationMaxPivot from 
    (select node, timestamp, Max_Utilization from tmpNCPCNCDownstreamMaxUtilization3wks)a
    pivot
    sum(max_Utilization) for timestamp in('+ @columnz +')
    )as p'
    execute (@query)
    --empty contents from NCPCNCDownstreamMaxUtilization3wks
    update tmpNCPCNCDownstreamMaxUtilization3wks
    set timestamp =''
    truncate table tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    --load to table to be joined to Node feature class
    insert into tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    (Node, TwoWeeksAgo, PreviousWeek, CurrentWeek)
    select * from tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
    --calculate average utilization for all values in each record
    update tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    set average = (coalesce(twoweeksago, 0) + coalesce(previousweek, 0) + coalesce(currentweek, 0))/3
    from tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    Scott

    Issue is with variable @columnz.
    Scope of variables is only limited to the batch and if batch is over Variable is no more accessible.
    Reproduce Steps: 
    DECLARE @columnz int = 0
    Go --Scope of @columnz ends here
    SELECT @columnz -- Ends up with error
    So you have to remove GO keyword. I have commented 2 of them in below:
    DROP TABLE tmpNCPCNCDownstreamMaxUtilization3wks
    SELECT node
    ,max(utilization) AS max_Utilization
    ,DATE
    INTO tmpNCPCNCDownstreamMaxUtilization3wks
    FROM stage_ncpcncdownstream_temporal
    WHERE DATE BETWEEN DATEADD(day, - 20, GETDATE())
    AND GETDATE()
    GROUP BY node
    ,DATE
    ORDER BY node
    GO
    ALTER TABLE tmpNCPCNCDownstreamMaxUtilization3wks ADD TIMESTAMP VARCHAR(50)
    GO
    UPDATE tmpNCPCNCDownstreamMaxUtilization3wks
    SET TIMESTAMP = 'WeekOf_' + cast(left(DATE, 11) AS VARCHAR)
    GO
    --drop table tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
    --go
    DECLARE @columnz VARCHAR(8000)
    --GO
    SELECT @columnz = COALESCE(@columnz + ',[' + TIMESTAMP + ']', '[' + TIMESTAMP + ']')
    FROM tmpNCPCNCDownstreamMaxUtilization3wks
    GROUP BY TIMESTAMP
    ORDER BY TIMESTAMP
    --GO
    --pivot contents in @columns
    DECLARE @query VARCHAR(8000)
    SET @query = 'select * into tmpNCPCNC_DownstreamNodeUtilizationMaxPivot from
    (select node, timestamp, Max_Utilization from tmpNCPCNCDownstreamMaxUtilization3wks)a
    pivot
    sum(max_Utilization) for timestamp in(' + @columnz + ')
    )as p'
    EXECUTE (@query)
    --empty contents from NCPCNCDownstreamMaxUtilization3wks
    UPDATE tmpNCPCNCDownstreamMaxUtilization3wks
    SET TIMESTAMP = ''
    TRUNCATE TABLE tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    --load to table to be joined to Node feature class
    INSERT INTO tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week (
    Node
    ,TwoWeeksAgo
    ,PreviousWeek
    ,CurrentWeek
    SELECT *
    FROM tmpNCPCNC_DownstreamNodeUtilizationMaxPivot
    --calculate average utilization for all values in each record
    UPDATE tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    SET average = (coalesce(twoweeksago, 0) + coalesce(previousweek, 0) + coalesce(currentweek, 0)) / 3
    FROM tmpNCPCNC_MaxDownstreamNodeUtilzationChart3Week
    -Vaibhav Chaudhari

  • Unable to use two SQL choices Input parameters in Production Reporting 9.0

    Hi Experts, <BR>I am unable to use two parameters as SQL Choices in Production Reporting. When i use only 1 SQL Choice parameter, it works fine but when i use more than one SQL Choice parameter, it gives error. It works fine in Production Reporting Server but when i publish it on System9 workspace, it doesn't work.<BR><BR>any help would be appriciated.<BR><BR>Thanks & Regards<BR>Arpit Shanker

    Azeroth wrote:
    @Twinkle.. it doesnt work
    SQL> create table ignore_columns
      2  (a varchar2(90),
      3  b varchar2(90));
    Table created.
    SQL> CREATE OR REPLACE PROCEDURE
      2   input_columns
      3   (
      4   table_name IN user_tab_columns.table_name%TYPE,
      5   column_list IN VARCHAR2
      6   ) IS
      7   stmt VARCHAR2(3000);
      8   BEGIN
      9   stmt := 'INSERT INTO ignore_columns VALUES (:1,:2)';
    10 
    11   EXECUTE IMMEDIATE stmt using table_name,column_list;
    12 
    13   END;
    14   /
    Procedure created.
    SQL> execute input_columns('HELL', 'HELLO');
    PL/SQL procedure successfully completed.
    SQL> select * from ignore_columns;
    A
    B
    HELL
    HELLOTwinkle

  • Unable to use PL/SQL Debugger, Production SQL Developer on OS X 10.4

    I am still unable to use the PL/SQL debugger in OS X.
    When I start the debugger I get this:
    Connecting to the database testdb.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: ALTER SESSION SET PLSQL_COMPILER_FLAGS=INTERPRETED
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '172.16.81.33', '49260' )
    Debugger accepted connection from database on port 49260.
    Processing 56 classes that have already been prepared...
    Finished processing prepared classes.
    Then nothing, it never gets to a breakpoint or does anything else. It works just fine on my Win XP box, just not on my OS X machine.
    Anyone having this problem or have any tips to try? I've never gotten the debugging to work on any Raptor or SQL Developer build in OS X. However, JDeveloper debugging works just fine on this mac.

    I am also experiencing this problem.
    Perhaps the following excerpt from the console can shed some light on the problem.
    Exception in thread "JPDA Event Processor" java.lang.VerifyError: (class: com/sun/tools/jdi/OracleReferenceTypeImpl, method: <init> signature: (Lcom/sun/tools/jdi/ReferenceTypeImpl;)V) Bad access to protected data
         at com.sun.jdi.OracleExtension.convert(OracleExtension.java:38)
         at oracle.jdevimpl.debugger.jdi.DebugJDI.getOracleReferenceType(DebugJDI.java:559)
         at oracle.jdevimpl.debugger.jdi.DebugJDI.addClass(DebugJDI.java:626)
         at oracle.jdevimpl.debugger.jdi.DebugJDI.addClassForReferenceType(DebugJDI.java:549)
         at oracle.jdevimpl.debugger.jdi.DebugJDI.run(DebugJDI.java:2651)
         at java.lang.Thread.run(Thread.java:613)

  • SSIS: How to use one Variable as Input and Output Parameter in an Execute SQL Task

    Hello,
    i need your help,I'm working on this issue since yesterday and have no idea how to deal with it.
    As I already said in the tilte i want to start a stored procedure via a Execute SQL Task which has around 15 prameters. 10 of these should be used as input AND output value.
    As an example:
    i have three  Variable:
    var1    int        2
    var2    int     100
    var3    int     200
    the stroed procedure:
       sp_test
          @var1 int
          @var2 int output
          @var3 int output
       AS
       BEGIN
            SET @var2 = @var2 * @var1
            SET @var3 = @var3 + @var1
       END
    So in the Execute SQL Task i call the Stored Procedure as follwos:
        Exec sp_test  @var1 = ?, @var2 = ? output, @var3 = ? output
    (I use an OLE DB Connection)
    The parameter mapping is as follows:
    User::Var1        input                   numeric              0                 -1
    User::Var2        input/output         numeric              1                 -1
    User::Var3        input/output         numeric              2                 -1
    Now my problem. If i set  Var2 and Var3 as Input parameter the values are still the same after running the package. If i set them to a output value the are both Null because the procedure doesnt get any values.
    I already tried to list them a second time - like
        User::Var2        input                  numeric              1                 -1
        User::Var2        output                 numeric              1                 -1
    or i use a new variable
        User::Var2                  input                  numeric              1                 -1
        User::Var2Return        output                 numeric              1                 -1
    but i alwas get the error
    "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
    Has anybody an idea how I can solve this problem?
    Thanks a lot.
    Kind Regards,
    Alice

    Hi Alain,
    thx for your answer.
    I have around 15 procedures called one after the other to calculated and modify my values. Each procedure is responsible for an other but overlapping set of variables. So i thought it would be a good idea to call them one after the other with the needed variables via a execute sql task.
    So if i use a result set, how i get my stored procedure to return 10 values? I would have to use a Function instead of a procedure, wouldn't i?
    As if i have 15 procedures this would be a lot of work.
    But thanks a lot for the idea. I think an other idea would be to create one function which calls all stored procedures and returns all the calculated values as a result set, wouldn't it?.
    Kind Regards.
    Alice

  • The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Hello All,
    I am getting below error can you please help me
    Error:-
    The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Perhaps this thread will help you out
    http://stackoverflow.com/questions/11453066/error-the-transaction-associated-with-the-current-connection-has-completed-but
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • 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'>

  • Execute SQL task for Email ToLine using COALESCE and two variables

    Hello...
    I am converting an old DTS package to SSIS. The old package consist of mostly ActiveX Script so I am breaking it down into steps. Basically... I am retreving a set of records that need to be sent via email to multiple people.  In my package to create
    my ToLine for the Send Mail Task I am using several steps. Frist I am using:
    SELECT CASE
              WHEN EXISTS (  SELECT        users.User_EmailAddress
    FROM            dbo.Errors INNER JOIN
                             dbo.Users ON users.user_id = Errors.MonitorAuditor_User_Id
    WHERE        ([Audit_Id] = ?) AND ([ErrorCode_Id] = ?) ) THEN
                 1
              ELSE
                 0
           END AS ValidEventID
    I use this to see if there is any records to create my email string. This works fine.  After this I have a Script Task that splits my pipe in two. When no records exist (User::ValidEventID == 0) I am loging that event to a log. When records do exist
    I am using another Execute SQL task to create the actual ToLine:
    Declare @combinedString VARCHAR(max)
    SELECT      @combinedString = COALESCE(@combinedString + ', ', '') + Users.User_EmailAddress
    FROM            dbo.Errors INNER JOIN
                             dbo.Users ON users.user_id = Errors.MonitorAuditor_User_Id
    WHERE        ([Audit_Id] = ?) AND ([ErrorCode_Id] = ?)
    SELECT convert(varchar(4000),@combinedString) as StringValue
    I have my resultSet set to Single Row. I have two variables coming if for the Audit_Id and ErrorCode_Id. My Result Set is set to a Variable: User::EmailAddressString.
    Next it goes through a foreach loop to map to the ToLine email variable that I created named User:User_EmailAddress.
    Then I am using that in my Send Email Task.
    It all works fine when I hard code my variables into the COALESCE statement but as soon as I replace that with the ? that SSIS requires for variables I am getting the following error:
    [Execute SQL Task] Error: Executing the query "Declare @combinedString VARCHAR(max)
    SELECT      ..." failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,
    parameters not set correctly, or connection not established correctly.
    I have tried changing my resultset property, I have checked my paramenters and my connection. I don't understand why it works fine when I have my varaiables hard coded but not when I change them to the ?.
    Thanks in advance for you help in this matter.
    Reach for the unknown!

    Katherine... that did not work. 
    What I ended up doing was taking out the forloop all together. In my Execute SQL Task I changed the result set from single row to XML. I took out the  COALESCE statement and just went for something more basic:
    select users.User_EmailAddress + ';' as User_EmailAddress from Errors inner join users on users.user_id = Errors.MonitorAuditor_User_Id WHERE ([Audit_Id]  = ? AND [ErrorCode_Id] = ?)
    Currently I am just logging the string to a text file so I can see the results. In my text file the string is surrounded by <ROOT></ROOT>. So I will next I will work on triming that off the string and then populate my Send Mail Task.
    This is how I trimed off the <ROOT></ROOT>:
    Dts.Variables(
    "EmailAddressString").Value = Replace(Dts.Variables("EmailAddressString").Value,
    "<ROOT>",
    Dts.Variables(
    "EmailAddressString").Value = Replace(Dts.Variables("EmailAddressString").Value,
    ";</ROOT>",
    Thanks again everyone for the help!
    Reach for the unknown!

  • How to use a parameter in an Execute SQL Tasks in SSDT executed against Netezza

    Good Evening,
    How can I pass a parameter in an Execute SQL Tasks in SSDT executed against Netezza?  Below are my settings and error message.
    [Execute SQL Task] Error: Executing the query ""TRUNCATE TABLE" ?"_POC..JOHN_TEST"" failed with the following error: "Syntax error or access violation". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly.
    Thank you in advance for your assistance.
    Brett

    Hi Baloun,
    Based on my further research, just as you said, we cannot directly use table name as a variable.
    To fix this issue, we can change the SQL command in the SQLStatement property as below:
    declare @sql varchar(100)
    set @sql = 'TRUNCATE TABLE ' + ? +'_POC..JOHN_TEST'
    exec(@sql)
    go
    The Parameter Mapping pane use the former settings in your picture.
    Reference:
    http://www.bidn.com/blogs/kylewalker/ssis/2063/parameters-don-t-always-work-in-your-execute-sql-task
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for