472,976 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 software developers and data experts.

Compilation error, stored procedure, sql, iseries v5r4 (as400), urgent help plz.

When i try to run this SQL statements in iSeries Access for windows
(against my customers db2) i get:

SQL State: 42904
Vendor Code: -7032
Message: [SQL7032] SQL procedure, function, or trigger
GET_INVENTORY_SEQUENCE in BPCSAX_PRD not created. Cause . . . . . :
SQL procedure, function, or trigger GET_INVENTORY_SEQUENCE in
BPCSAX_PRD was not created. The compile was not successful. SQL creates
an SQL procedure, function, or trigger as a C program that contains
embedded SQL. Errors not found during the initial parsing of the
CREATE PROCEDURE, ALTER PROCEDURE, CREATE FUNCTION, or CREATE TRIGGER
statement can be found during the precompile. Recovery . . . : If a
compile error occurred, see the appropriate listing in QSYSPRT. If the
SQL precompile failed, there is always a listing with the error. If the
C compile failed, the listing is only created if requested. Specify SET
OPTION OUTPUT=*PRINT prior to the routine body in the CREATE statement
if listings are required.

Processing ended because the highlighted statement did not complete
successfully

The problem is that the very same procedure compiled/worked fine on
v5r3, but after they upgraded to v5r4 it wont compile.

Any ideas?

CREATE PROCEDURE BPCSAX_PRD.GET_INVENTORY_SEQUENCE ()
RESULT SETS 1
LANGUAGE SQL
BEGIN

-- Declare the custId variable that we will use for fetching a
customer
DECLARE pSequence NUMERIC (20,0) ;

-- Declare dummy statement variable
DECLARE pStmt CHAR (512) ;

-- Declare the result set cursors
DECLARE c1 CURSOR WITH RETURN FOR s1 ;

UPDATE BPCSPUF.P_ILI
SET ADB_L_DELIVERY = 'I'
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LWHS) = 'FI';

UPDATE BPCSPUF.P_ILI
SET ADB_L_DELIVERY = 'I'
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LWHS) = 'VV';

UPDATE BPCSPUF.P_ILI
SET ADB_L_DELIVERY = 'I'
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LWHS) = 'VT';

UPDATE BPCSPUF.P_ILI
SET ADB_L_DELIVERY = 'I'
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LWHS) = 'PB';

UPDATE BPCSPUF.P_ILI
SET ADB_L_DELIVERY = 'I'
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LWHS) = '07';

UPDATE BPCSPUF.P_ILI
SET ADB_L_DELIVERY = 'E'
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LLOT) = '';

SELECT ADB_SEQUENCE INTO pSequence
FROM BPCSPUF.P_ILI
WHERE ADB_L_DELIVERY = 'N'
AND TRIM(LLOT) <''
AND TRIM(LWHS) <'FI'
AND TRIM(LWHS) <'VV'
AND TRIM(LWHS) <'VT'
AND TRIM(LWHS) <'PB'
AND TRIM(LWHS) <'07'
FETCH FIRST 1 ROW ONLY;

-- ok now we should have a customer id in pCustId.
IF pSequence IS NULL THEN
return -1 ;
END IF ;

UPDATE BPCSPUF.P_ILI SET ADB_L_DELIVERY = 'R' WHERE ADB_SEQUENCE =
pSequence;

SET pStmt = 'SELECT ADB_SEQUENCE, ''SE'' as LOCATION from
BPCSPUF.P_ILI WHERE ADB_SEQUENCE = ?' ;
PREPARE s1 from pStmt ;
OPEN c1 USING pSequence ;

END;

Oct 23 '06 #1
0 5178

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Naeem | last post by:
Using the ISeries Access Driver v9.00.04.00 when selecting a column which contains null i get erroneous data. If I keep refreshing the query the results returned with keep changing for the null...
5
by: Dave Sisk | last post by:
Hey folks: I'm trying to do this: CREATE TRIGGER datawhse.emp_ti AFTER INSERT ON emp REFERENCING NEW AS n FOR EACH ROW MODE DB2ROW BEGIN DECLARE v_rrn DECIMAL(15,0);
6
by: Wojciech Wendrychowicz | last post by:
Hello to All, I'm trying to retrieve records from AS/400 in an VBA application. So, I've made an RPG program, then a stored procedure wchich calls that RPG program, and finally some VBA code to...
2
by: jbow | last post by:
I am new to creating DB2 SQL Procedures and I need a little help. This works perfectly when I am just using it through my SQL Editor: SELECT * FROM SALESTABLE WHERE VENDOR LIKE 'ELK' || '%' AND...
0
by: bobby_b_ | last post by:
Hello, I'm trying to access a stored procedure on our AS400 that is written in RPG. I know that the stored procedure works (I've called it from an RPG program on the AS400), and I know that the...
2
by: scase | last post by:
I need some trying to figure out what is happening on our AS/400. I am not an AS/400 programmer, but I am using ASP.NET (VB) and the IBM.Data.DB2.iSeries control for .NET to access our DB2...
0
by: jk9427 | last post by:
Hello all, I have a weird situation here. We are on an ISeries AS400. We have created an SQL table and can access it just fine when the COBOL program is called directly. The problem exists when...
6
by: Al G | last post by:
Can someone tell me what I need to get connected to our AS400? I am trying to write an app in VS2005(Data source, Gridview) that requires data from files on our AS400. I've downloaded DB2, and...
2
by: jmuehe | last post by:
Hello, What are the optimal settings to use in a CREATE PROCEDURE – when creating a SQL procedure on the iSeries? To read data? To update? Here is a pretty standard one of ours. I know the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.