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



How do you declare and use a Boolean value in an SQL Stored
Procedure on the IBM i? I've searched the online references and can't
find anything about it. There is even a page showing the SQL equivalent
data type for ILE RPG data types but the RPG IND data type is omitted from
that page.

Without testifying that they do what I expect (yet), I've at least
found that SQL doesn't complain about the following statements in a stored
procedure:

SET variable = True;
SET variable = False;

And though I found that it won't let me use the first statement
syntax, below, at least it doesn't complain about the second.

If CursorOpen Then ...
If CursorOpen = True Then ...

However, it won't let me use data type Boolean or Default False in
a variable declaration statement (yet). But the RSE editor does show the
words Boolean and False in blue -- indicating it thinks they are part of
the SQL syntax.

Declare CursorOpen Boolean Default False;

Anyone know how to define a Boolean variable in an IBM i SQL
Stored Procedure? Thanks.

Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.