1
0
-1

scenario: 

CUST entity

   cust_no, cust_name, enter_dt

CUST_CHILD entity

   cust_no, cust_plant, enter_dt

CUST_XREF entity

    cust_no, old_company_cust_no, enter_dt

The trigger is coded to insert into the cust_xref table after a new record is inserted in to the CUST table. 

If you insert a row using SQL in SQL Management Studio, the insert and trigger work fine. 

When creating a new customer in Uniface, I am getting a Procerror of -6 on the write of the cust_child table. Looking at the proctrace, I see: 

HY000 [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
"$e:CUST_CHILD/$s:-6/$p:-6/08:34:20 : " (_write); WRIT; 4; [-6];


Any ideas? 


Mike W

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      We had similar problems when the trigger code

      did not contain this statement:

      set nocount on;



      1. . UliMerkel

        Interesting hint, will add it to my collection.

        Grüße an die Wattenscheider aus Frankfurt-Höchst.

      CommentAdd your comment...
    2.  
      1
      0
      -1

      After changing the asn MARS to ON and changing the driver to SQL Server Native Client, the trigger worked. Sort of. It appears that somehow SQL Server thinks UNIFACE did 2 inserts into the CUST table and 2 rows get written to the XREF table from the trigger. 

      Since this is not really a good solution, as we would need to do extensive testing to see if changing the driver to the client would cause other issues, we will just do manual inserts in proc to the XREF table. The reason for trying the trigger was due to needing to be able to do mass inserts of new customers through SQL Management Studio. 

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Shot in the dark - try using the multiple active result sets (MARS) in the MSS driver options...

        Knut

          CommentAdd your comment...