• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] how to use tMSSqlOutput instead of tMSSqlRow

#1 2012-05-04 11:05:12

dchambon
Member
Company: Le Figaro
Registered: 2009-10-28
Posts: 153
Website

[resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi,

I want to convert the following request using MSSqlIntput, tMap and tMSSqlOutput :


UPDATE CRM_COORD
SET CRM_COORD.ID_CRM = Z_CRM_DEDUP_XXX.ID_CRM
FROM CRM_COORD,Z_CRM_DEDUP_XXX
WHERE CRM_COORD.ID_CRM = -1 AND CRM_COORD.CD_SOURCE = 'DOL'
AND CRM_COORD.ID_SOURCE = Z_CRM_DEDUP_XXX.ID_SOURCE


I have succeeded using a tMSSqlRow (see screenshots) but I'd prefer to use a tMSSqlOutput

Here are the create statement of table CRM_COORD and Z_CRM_DEDUP_XXX

CREATE TABLE [dbo].[Z_CRM_DEDUP_XXX](
    [ID] [int] NULL,
    [ID_CRM] [int] NOT NULL,
    [CD_SOURCE] [char](3) NOT NULL,
    [ID_SOURCE] [int] NULL,
    [email][varchar](128) NULL
) ON [PRIMARY]


CREATE TABLE [dbo].[CRM_COORD](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [ID_CRM] [int] NOT NULL,
    [CD_SOURCE] [char](3) NOT NULL,
    [ID_SOURCE] [int] NOT NULL,
    [CD_MARQUE] [char](3) NULL,
    [ADR1] [varchar](50) NULL,
    [ADR2] [varchar](50) NULL,
    [ADR3] [varchar](50) NULL,
    [ADR4] [varchar](50) NULL,
    [CP] [varchar](10) NULL,
    [VILLE] [varchar](50) NULL,
    [PAYS] [varchar](50) NULL,
    [TEL] [varchar](20) NULL,
    [MOB] [varchar](20) NULL,
    [FAX] [varchar](20) NULL,
    [email][varchar](128) NULL,
    [IS_DELETED] [bit] NULL,
    [ID_DOMAINE] [smallint] NULL,
    [IS_DOMAINE_PERSONNEL] [char](1) NULL,
CONSTRAINT [PK_CRM_COORD] PRIMARY KEY CLUSTERED
(
    [ID_CRM] ASC,
    [CD_SOURCE] ASC,
    [ID_SOURCE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
CONSTRAINT [IX_CRM_COORD] UNIQUE NONCLUSTERED
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]


thanks for your help,
Didier


Uploaded Images

Last edited by dchambon (2012-05-04 11:06:49)

Offline

#2 2012-05-04 11:33:59

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi

I think what you configure in tMap is correct.
Judging from your update sql statement, the query of tMSSQLInput seems to be wrong.
There should be no 'where ID_CRM <>-1'.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-05-04 11:55:37

dchambon
Member
Company: Le Figaro
Registered: 2009-10-28
Posts: 153
Website

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Thanks Pedro, I've made the correction

I've replaced the tMSSqlRow with a tMSSqlOutput (see screenshots)

In the designer the number of rows are correct but none are commited

How can I see the details of the error from tMSSqlOutput

-------------------
|      x Error!     |
-------------------
|                      |
|                      |
|"CRM_COORD"|
-------------------


Uploaded Images

Offline

#4 2012-05-04 12:00:34

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi

Is there any errors occurred on console?
Do you select the option 'Using an existing connection?
Is there a tMSSQLCommit component in your job?

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-05-04 13:12:23

dchambon
Member
Company: Le Figaro
Registered: 2009-10-28
Posts: 153
Website

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

pedro wrote:

Hi
Is there any errors occurred on console?

There was no error on console

Do you select the option 'Using an existing connection?

forgot to do it ... but with the option select same result

now I have the following error on console :

incorrect syntaxe near ')'.

Is there a tMSSQLCommit component in your job?

no, I use a tMSSqlConnection with "Auto Commit" on


Regards,
Didier

Offline

#6 2012-05-07 03:56:37

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi Didier

According to this error on console, please click on 'Code' tag  and show us the rows with red underline.
There must be some wrong settings in this job.

Regards,
Pedro


Only Paranoid Survive.

Offline

#7 2012-05-07 08:02:28

dchambon
Member
Company: Le Figaro
Registered: 2009-10-28
Posts: 153
Website

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi Pedro,

Sorry non rows with red underline in Code tag.


Regards,
Didier

Offline

#8 2012-05-07 08:03:47

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi Didier

It's weird.

Please send me an email and attach this job. I will test it for you.

Regards,
Pedro


Only Paranoid Survive.

Offline

#9 2012-05-07 08:24:43

dchambon
Member
Company: Le Figaro
Registered: 2009-10-28
Posts: 153
Website

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Pedro,

I've found the problem :

I was focusing on the "Advanced settings" of the tMSSqlOutput while on "Basic settings", "Action on data" was set to "Insert" instead of "Update" ...



Best regards,
Didier

Offline

#10 2012-05-07 08:26:06

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Hi Didier

Glad to know it has been fixed.

Feel free to ask any questions here.

Regards,
Pedro


Only Paranoid Survive.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] how to use tMSSqlOutput instead of tMSSqlRow

Board footer

Powered by FluxBB