×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I like SQL Stored Procedures but they have the quirkiest behaviors.
I have this stored procedure. I see plenty of examples of the same thing
but when I compile I get a:
SQL0104 30 20 Position 13 Token C1 was not valid. Valid tokens:
GLOBAL.
If I comment out the call statement, it will compile but not with it in
there.
I have run into this before where SQL will not compile something before
the declare statement even though the books have all kinds of examples.
Anybody got an idea what the devil is going on here?
Create Procedure MAPDBA/MRPGETSTATUS2
(In InItemNumber Varchar(15),
In InProgramEnv Char(1),
In InFileEnv Char(1))
Dynamic Result Sets 1
Language SQL
Not Deterministic
Reads SQL Data
Begin
Call SetLibraryList(InProgramEnv,InFileEnv);
Declare C1 Asensitive Scroll Cursor With Return For
Select VarChar(a.FITEM,15,037) As ItemNumber,
iDate(a.SSTDT) As StartDate,
iDate(a.ODUDT) As DueDate,
VarChar(a.ORDNO,7,037) As OrderNumber,
VarChar(c.OPSEQ,4,037) As OperationsSequence,
VarChar(c.OPDSC,20,037) As OperationsDescription,
VarChar(b.ITDSC,30,037) As ItemDescription,
VarChar(c.WKCTR,5,037) As WorkCenter,
VarChar(c.OPSTC,2,037) As OperationStatus,
a.DOSCH As DaysOffSchedule,
VarChar(a.JOBNO,12,037) As Notes
From MOMAST a
Inner Join ITMRVA b
On b.STID = a.FITWH And
b.ITNBR = a.FITEM
Inner Join MOROUT c
On c.ORDNO = a.ORDNO And
c.WKCTR <> '0000'
Where a.FITEM = InItemNumber And
a.OSTAT <= '40'
Order By a.FITWH,
iDate(a.ODUDT),
iDate(a.SSTDT),
a.ORDNO,
c.OPSEQ;
Open C1;
End;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.