Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2011
    Posts
    2

    Post Unanswered: DB2 insert query

    i have 2 databases.

    Database1 has tables which contain events. So when any event is inserted into the databse1. a trigger should trigger and insert data from certain columns into database2.

    Database1 table name tec_T_evt_rep. columns which should be updated into database2 - severity , hostname, msg.

    Database2 table available sms and the available columns are - message, hostname, smsnumber, severity, pickup.

    also when the data is inserted into database2 it should populate a number ex: mobile number.

    a friend had created a query based on MS SQL, can the syntax be converted to match for db2
    Last edited by aahabibullah; 09-13-11 at 08:40.

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    it could be, but
    to be able to update in a different db, you should declare the remote table as nickname
    check in doc how todo this. after that operation the remote table will be known as if was local.. also check if triggers support nicknames..
    CREATE TRIGGER
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Sep 2011
    Posts
    2

    Db2 insert query

    Thanks for the information. But while trying to create the nickname its throwing an error. My Db2 server is on windows 2003 and version is db2 9.1.6

    The instance for the database is not enabled for the specified
    action or operation. Reason code = "1".

    Explanation:

    An error has been detected at the instance level. The requested
    operation cannot be completed because a specified functional area
    was not installed or because a specified functional area was not
    enabled to the instance.

    The following is the list of reason codes and associated
    functional areas you can enable at the instance level:

    1. The ability to execute distributed request operations against
    multiple data sources in a single statement.



    User Response:

    Enable the instance for the requested action or operation.
    First, install the specified functional area if it is missing.
    Then, enable the specified functional area. Enablement steps vary
    by "<reason-code>":

    1. For a federated server, set the DBM variable <FEDERATED> to
    YES and then restart the database manager.



    sqlcode : -20076

    sqlstate : 0A502

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    I know some people do not have access to the doc,or don't know how to find it, or think it is easier to request this in the forum but try this link and check the setting of federated
    or read your previous reply
    1. For a federated server, set the DBM variable <FEDERATED> to
    YES and then restart the database manager.
    or if really needed, I can come over and type the command..

    GET DATABASE MANAGER CONFIGURATION
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •