Solved

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

Posted on 2011-02-21
2
1,985 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
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
simonpaul64 earned 0 total points
Comment Utility

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
Comment Utility
The solution is to comment out that code in my last post.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

When CRM stops functioning propperly or mysteriously disappears then this is something you should always check. This can be useful when looking at an end users machine or your own machine if you are the end user. It may be fairly obvious to some but…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now