Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Enterprise Integration Forum

Enterprise Integration Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Sue M Wemp 27.Apr.06 04:44 PM a Web browser
Connector for OLE DB LEI - All Releases All Platforms


Background
I'm trying to connect Notes to a DB2 database. Right now, I'm just trying to connect to one table in the DB2 database, but before I can add new rows to the DB2 table, I need to update index information in several other tables. Here is the SQL that has been provided by the DB2 DBA:

DECLARE @NextCall_ID as NUMERIC
DECLARE @GetTableID as NUMERIC
DECLARE @GetTableID2 as NUMERIC
DECLARE @task_date as DATETIME
SET @task_date = getdate()

SELECT @NextCall_ID = idt_NextID FROM IdentityDef WHERE idt_TableName = 'CALL_ID'
UPDATE IdentityDef SET idt_NextId = (@NextCall_ID + 1) WHERE idt_TableName = 'CALL_ID' AND idt_NextID = @NextCall_ID

SELECT @GetTableID = idt_NextID FROM IdentityDef WHERE idt_TableName = 'DD_ID'
UPDATE IdentityDef SET idt_NextId = (@GetTableID + 1) WHERE idt_TableName = 'DD_ID' AND idt_NextID = @GetTableID
INSERT INTO datadescription values (@GetTableID,' ',' ','',1073742848)

SELECT @GetTableID2 = idt_NextID FROM IdentityDef WHERE idt_TableName = 'DD_ID'
UPDATE IdentityDef SET idt_NextId = (@GetTableID2 + 1) WHERE idt_TableName = 'DD_ID' AND idt_NextID = @GetTableID2
INSERT INTO datadescription values (@GetTableID2,' ',' ','',1073742848)

INSERT INTO task
VALUES (@NextCall_ID, 0, 0, '0000188', 0, 0, 0, 0, 0, @GetTableID, @GetTableID2, @task_date, '2100-12-31', '2100-12-31', '2100-12-31',0, 0, 0, ' ', 0)

What I've tried:
Created an agent using lsxlc but can't map the names and insert without running the SQL first.
Creating a Command Line activity in LEI with a dependent Direct Transfer and I still get the following Error: Violation of PRIMARY KEY constraint 'PK_Call'. Cannot insert duplicate key in object 'Call (DB2 table I'm trying to update)'.
Creating a Replication activity but don't know where to put the SQL statement so that it updates the index field accordingly.

Where's I've looked:
Notes forums
Sandbox
Redbook - Implementing IBM Lotus Enterprise Integrator 6
Andre's presentation - Accessing Relational Data with the Lotus Connectors LSX
Lotus Connector LotusScript Extensions Guide
Lotus Connector and Connectivity Guide

Questions:
Is it possible to use this SQL statement either in LEI or in the connection.execute statement? and if so...how do I write it? each statement in quotes and concatinated?
Should I be looking at a different method of transferring the information? e.g. Direct Transfer to a text file and have the DB2 database do it's own updating of information?

Thanks for any input you can provide!
Sue






Complex SQL before Transfer/Replica... (Sue M Wemp 27.Apr.06)
. . RE: Complex SQL before Transfer/Rep... (Rami Jundi 28.Apr.06)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow