Passing a variable to an AS400 server using an OLE DB connection in SSIS

  • I am attempting to pull some data via an SSIS package from an AS400 database. The time on the AS400 is stored in a different format (ex '2013-05-04' would be stored as 1130504). I have a sql task that executes a stored procedure that gets the date in the correct format I need and stores it into a variable. However - when I create a data flow task and go into the OLE Source and choose the sql command text as the data access mode - I am getting errors.

    select

    customer_number,customer_type,mail_type,last_change_date,customer_class,address, city,zip,post_code

    from customers where last_change_date > ?

    I get the following error:

    SQL0313: Number of host variables not valid.

    I have set the variable up and have passed it along - but it is not liking it.

    So does anyone have any experience with this when querying an AS400 box?

    Thanks

  • Hello - I'm responding to an old post of yours. I'm having the exact same problem and was curious if you had found a resolution to this.

    Thank you

    Chris

  • I wasn't able to figure it out in SSIS. I was however able to pass a date variable in a stored procedure and pull the data via linked server. If you are interested in that - I can provide some example code.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply