Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
SteveEly Absent Member.
Absent Member.
1966 views

AcuSQL parse error when trying to call a stored procedure.

I am trying to use a cursor to read a stored procedure, but get "parse error at :ret-code" on the following declare:

EXEC SQL
DECLARE FpReportIdCursor CURSOR FOR
:ret-code = exec
CBM.dbo.FileProcessingReportDetail_SelectByReportID
(:ws-report-id)
END-EXEC

I assume I am missing something on the exec line but the syntax above is just like the example in the manual.
I use cursors in AcuSQL to read tables with no problem but this is my first attempt at a stored procedure.

The manuals example gets the same parse error when I try to compile it.

There are several similar questions on this forum but no answers.

Any help would be appreciated.

Thanks,
Steve

0 Likes
6 Replies
Micro Focus Expert
Micro Focus Expert

RE: AcuSQL parse error when trying to call a stored procedure.

Are you using the -Ps compile option? What other pre-compiler options are you using?

0 Likes
SteveEly Absent Member.
Absent Member.

RE: AcuSQL parse error when trying to call a stored procedure.

Yes. My compile line is:

ccbl32.exe -o H:\cbl740\%r -Ps -Pk mssql -cr -DS -za -lfo list.sbe --nodata32bit %r%e

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: AcuSQL parse error when trying to call a stored procedure.

Using the example in the docs:

EXEC SQL declare spcursor cursor for

          :ret-code = exec sp_listcustomer (:c-last-name,

           :num-rows out)

          END-EXEC.

I was able to compile using -Ps and -Pk

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: AcuSQL parse error when trying to call a stored procedure.

I'm certainly not an expert .. I believe the CBM.dbo.FileProcessingReportDetail_SelectByReportID  is the issue, when I reduced this to FileProcessingReportDetail_SelectByReportID it compiled for me

0 Likes
SteveEly Absent Member.
Absent Member.

RE: AcuSQL parse error when trying to call a stored procedure.

I am still trying to get the example in the docs to compile.

Also, I don't really think it is the CBM.dbo that is the problem because the following compiles and runs just fine:

          EXEC SQL

             DECLARE VendorReportCursor CURSOR

             FOR

             SELECT *

             FROM CBM.dbo.Reports_Products

             WHERE VendorCode = :ws-vendor

          END-EXEC

I am reading through the docs again to see if there is something I am missing.

Are you using any sql related environment variables?

0 Likes
SteveEly Absent Member.
Absent Member.

RE: AcuSQL parse error when trying to call a stored procedure.

It looks like it is an issue with the 7.2.1 compiler.

When I started using 9.1.2 it complies.

Also, as you mentioned it does not like CBM.dbo in the cursor for exec but does not mind it in the cursor for select.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.