Error while fetching data from DB2 through Azure Data Factory

Himanshu Devrani 11 Reputation points
2022-02-04T05:41:20.127+00:00

I am trying to fetch data from on premise DB2 using Azure Data Factory through copy activity but getting an error while doing the same. I have created Linked Service and connection is successful but while listing tables in Dataset or previewing data I am getting this below error:

"The package corresponding to an SQL statement execution request was not found. SQLSTATE=51002 SQLCODE=-805,"

I have referred the MS documentation https://learn.microsoft.com/en-us/azure/data-factory/connector-db2?tabs=data-factory#linked-service-properties in which they are telling that collection package should be filled where we want to query. Currently package is getting created by default in Collection which is based on the username.

So, What should be the location of package so that I can query data and preview data in DB2. Furthermore, what value(database name, repository name) should I specify in CollectionPackage of Linked Service???

I am attaching The snippet for this for reference.171236-db2.png171149-ls-db2.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

2 answers

Sort by: Most helpful
  1. SandipKhandelwal-MSFT 96 Reputation points Microsoft Employee
    2022-02-07T13:26:34.84+00:00

    @Himanshu Devrani

    Can you try with keeping package collection value as NULLID ?

    DB2 packages are by default created under the NULLID collection.

    1 person found this answer helpful.

  2. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2022-02-07T08:42:14.423+00:00

    Hi @Himanshu Devrani ,

    Thank you for posting query in Microsoft Q&A Platform.

    For "packageCollection", Specify where needed packages are auto creating by service when querying database. If we skip it then service uses {username} as the default value.

    If you are not sure where packages are auto created then checking with DB2 admin may helpful.

    database name is your DB2 database name.

    When you say repository name, what you mean by that? Kindly elaborate more on that?

    Below is the format of connection string that can be used for DB2 linked service.
    server=<server:port>;database=<database>;authenticationType=Basic;username=<username>;password=<password>;packageCollection=<packagecollection>;certificateCommonName=<certname>;

    Hope this will help. Please let us know if any further queries. Thank you.

    --------------------

    Please consider hitting Accept Answer. Accepted answers helps community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.