Solved

PeopleCode Action calling Stored Procedure abends (Executing SQL directly; no cursor.)

Posted on 2011-02-21
2
2,052 Views
Last Modified: 2013-11-23

We have an App Engine that executes a couple of stored procedures. We are running MS SQL Server and the process has run successfully in the past but has been failing for some time.

Is there some restriction on executing stored procedures from within the PeopleCode Action? Any clues?

Here is the section of the log that seems most relevant.

SQL error. Function:  SQLExec

  Error Position:  0

  Return:  8601 - [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.
[Microsoft][SQL Native Client][SQL Server]Process Started
[Microsoft][SQL Native Client][SQL Server]Creating daily backup of PS_B_EMP_SCHED_DEN table
[Microsoft][SQL Native Clie

  Statement:  EXEC B_SP_RB_CREATE_IND :1

  Original Statement:  EXEC B_SP_RB_CREATE_IND :1
2011-02-21-15.26.00.999369  AePcdExecutePeopleCode [174] Exception logged: RC=100.

SQL error in Exec. (2,280) B_RB_LVRUPD.DmmyCrt.GBL.default.1900-01-01.Create.OnExecute  PCPC:3039  Statement:32
2011-02-21-15.26.00.999369  DoStepActions [1797] Exception logged: RC=100.
0
Comment
Question by:simonpaul64
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
simonpaul64 earned 0 total points
ID: 34953097

I have located the source of the problem.

There is a section of the SP that has the following code (pasted below) - and with that code - the execute of the sp fails. When I comment that bit out it runs great.

There is a comment that this code is helpful when the sp is run "manually" - but it screws us up.

DECLARE @X INT
SET @X = @@TRANCOUNT
WHILE @X > 0
BEGIN
  COMMIT
  SET @X = @X - 1
END
0
 
LVL 5

Author Closing Comment

by:simonpaul64
ID: 34953119
The solution is to comment out that code in my last post.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have problems displaying reports in CRM after a new installation, review the following steps: Check that SQL Server Reporting Services is working On the server that has SQL Server Reporting Services (SQL SRS) installed, check that the S…
Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question