Insert/Update on SQL SERVER Database

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Insert/Update on SQL SERVER Database

Post by reddy »

Hi Guys,

Based on Customer type i would like to update or insert records in to a sqlserver database table.

I created Transform with 2 links one for update and another for Insert

I am getting database locked error.

It works fine for Informix database.

Please help me out how to solve this problem.

Thanks
Narasa
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Check whether some other person / application is modifying the table.
reddy
Premium Member
Premium Member
Posts: 168
Joined: Tue Dec 07, 2004 12:54 pm

Post by reddy »

I am sorry guys it's not locking error it's not updating correctly.

please help me.

Thanks for prompt reply.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

reddy,
not updating correctly
? Does this mean when you enter a "3" it actually updates a "7"? Or that records are being deleted instead of inserted? Or that updates are not being performed? You will need to tell us a bit more...
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

As ArndW has pointed out, you need to supply some examples for others to understand and answer.
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post by shawn_ramsey »

Sainath.Srinivasan wrote:Check whether some other person / application is modifying the table.
Actually it is most likely his own job that is causing the problem. When you have the stage in the job twice it is opening 2 separate sessions to SQL Server.

If this is the case you can usually fix the issue by setting the commit point to 1. Another option would be to have the stage do an insert/update itself instead of doing it in the transform.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

The user had 'insert or update rows' in a single link and not 2 different links. So that cannot be the reason for lock.
pnchowdary
Participant
Posts: 232
Joined: Sat May 07, 2005 2:49 pm
Location: USA

Re: Insert/Update on SQL SERVER Database

Post by pnchowdary »

Hi Sai,
reddy wrote:Hi Guys,

Based on Customer type i would like to update or insert records in to a sqlserver database table.

I created Transform with 2 links one for update and another for Insert

I am getting database locked error.

It works fine for Informix database.

Please help me out how to solve this problem.

Thanks
Narasa
From the OPs post, it seems like he did create two links from Transformer, one for update and another for insert, unless I am misinterpreting his words.
Thanks,
Naveen
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's not about the links, it's about the stages. Two links into two stages = possible locks. Two links into one stage = no locks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post by shawn_ramsey »

chulett wrote:It's not about the links, it's about the stages. Two links into two stages = possible locks. Two links into one stage = no locks.
With SQL Server 2000 you will have the same issue going into one stage since SQL Server does not support multiple open statements against a single session. The OLEDB API simulates this by opening multiple sessions.

http://msdn.microsoft.com/library/defau ... nSQL05.asp
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, that's too darn bad. :?

I was speaking from my Oracle experience, should have figured SQL Server would work differently...
-craig

"You can never have too many knives" -- Logan Nine Fingers
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post by shawn_ramsey »

chulett wrote:Well, that's too darn bad. :?

I was speaking from my Oracle experience, should have figured SQL Server would work differently...
Unfortunately I am speaking from experience on this one. :( I guess the good news is that SQL 2005 is supposed to correct that issue.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
Post Reply