Error linked server access to Db2

  • Hi,

    I have setup a linked server access to Db2 using Neon ODBC connection.I am using this connection in my SQL stored procedure to insert/update rows in Db2.Now,whenever my insert update fails it throws me out of the stored procedure without going into the custom error message that I am writen right below it.

    what I basically did was

    insert into ..abc.tablename values(11)

    if @@error<>0

    print 'error occ'

    It never comes to the code that checks for errors.Please help me .

  • Don't expect much from me, I haven't worked with Db2 or Neon before.  I'm just brainstorming as a disconnected outsider.

    Are you absolutely sure you are getting completely thrown out of the stored procedure?  Is there code after the @@error check that you know does not get executed?  Like I say, I have not worked with Db2 or Neon, and is it possible that an error in that connection may not set the SQL Server @@error flag?  Kind of a shot in the dark, I know, because you would think an insert statement executed in a SQL Server stored procedure would set the SQL Server @@error flag.

     

  • Thanks.I have a print just after the insert statement but that 'print' never shows up when an error occurs

    I am not sure if it has some to do with the Neon ODBC provider.

     

     

     

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply