× 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.



Oops, I didn't notice that I wasn't calling the stored proc, but the
program directly.

--
Mike Wills
http://mikewills.me



On Wed, Mar 9, 2011 at 9:52 AM, Mike Wills <mike@xxxxxxxxxxxx> wrote:
`call MPRLIB.MPRLRCHK (cast(275611 as decimal(10,0)), cast(' ' as
char(1)))` gives me the following error:

SQL State: 42601
Vendor Code: -104
Message: [SQL0104] Token CAST was not valid. Valid tokens: <INTEGER>
<CHARSTRING> DLVALUE DATE TIME TIMESTAMP. Cause . . . . . :   A syntax
error was detected at token CAST.  Token CAST is not a valid token.  A
partial list of valid tokens is <INTEGER> <CHARSTRING> DLVALUE DATE
TIME TIMESTAMP.  This list assumes that the statement is correct up to
the token.  The error may be earlier in the statement, but the syntax
of the statement appears to be valid up to this point. Recovery  . . .
:   Do one or more of the following and try the request again: --
Verify the SQL statement in the area of the token CAST. Correct the
statement.  The error could be a missing comma or quotation mark, it
could be a misspelled word, or it could be related to the order of
clauses. -- If the error token is <END-OF-STATEMENT>, correct the SQL
statement because it does not end with a valid clause.

Just as Joe said not casting causes issues too. I have also tried
DEC(275611, 10, 0) with a similar error.

I am not seeing where the problem is. We are on V6R1. I have V4R5 of
iSeries Access (due to our .NET programming).

--
Mike Wills
http://mikewills.me



On Wed, Mar 9, 2011 at 9:15 AM, Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx> wrote:
You can call a stored procedure in iNav and pass the variables.  iNav
will then show you the result of any INOUT or OUTPUT fields.

Make sure you cast you parameters correctly.

call MPRLIB.MPRLRCHK (cast (123 as decimal(10,0), cast (' ' as char(1))

That should get you your result.

Joe

I am not sure what is going wrong here. I have a stored procedure that
calls an SQLRPGLE program. The program is running fine as I have
verified in the debugger and sends the return value as expected. What
is returned to my ASP.NET program when looking at
`cmd.Parameters["@ISMATCH"].Value` is {}. I am guessing I am doing
something wrong. What could it be? How can I test calling the stored
procedure to make sure the procedure is working as expected.

My RPG program:
        // Entry Parms
      D MPRLRCHK        PR                  extpgm('MPRLRCHK')
      D  id                           10P 0
      D  isMatch                       1A

The stored procedure:
CREATE PROCEDURE "MPRLIB"."CHECKHOURS" (EMPLOYEEID DECIMAL(10 , 0),
              INOUT ISMATCH CHAR(1))
      LANGUAGE RPGLE
      PARAMETER STYLE SQL
      NOT DETERMINISTIC
      MODIFIES SQL DATA
      SPECIFIC CHECKHOURS
      NEW SAVEPOINT LEVEL
      EXTERNAL NAME 'MPRLIB/MPRLRCHK';

I have the rest of the code documented at
http://stackoverflow.com/q/5238834/2535.

--
Mike Wills
http://mikewills.me

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.