Contact | Privacy Policy
 
Join us for the next RPG & DB2 Summit
October 17-19, 2017 in Minneapolis
Sponsors & Special Offers
News Headlines
March 27, 2017
SAVE THE DATE! Join us in Minneapolis October 17-19, 2017 for the next RPG & DB2 Summit!
December 5, 2016
RPG & DB2 Summit attendees see tangible results of their education
December 5, 2016
Summiteer Ake Olsson describes modernization journey
May 17, 2016
20th RPG & DB2 Summit Teaches Latest OLAP, Temporal Capabilities in DB2 for i
February 10, 2016
Gantner, Paris & Tuohy each earn 2016 IBM Champion honor.
January 12, 2016
New IBM i DB2 Track Debuts at March 2016 Summit

SQLScalar - RPGLE Wrappers for SQL Scalar Functions

SQL Offers a host of powerful scalar functions. Nearly every one of these functions can be "wrapped" in an RPGLE subprocedure

Using an SQL Scalar Function can be a lot easier than the RPG alternative:-

  • Use the UPPER function instead of defining two translation strings and using %XLATE
  • Use DAYNAME function instead of calculating the day of the week and using an array to provide the day name.
  • Using the REGEXP_ functions as opposed to calling the regular expression APIs
  • Using the ENCRYPT/DECRYPT functions instead of calling APIs
  • Using the SOUNDEX function instead of - well, there is no alternative.

The SQLSCALAR service program contains subprocedure wrappers for the SQL scalar functions ABS, ACOS, ANTILOG, ASCII, ASIN, ATAN, ATAN2, ATANH, BIT_LENGTH, CEIL, CHR, COALESCE, COS, COSH, COT, DATABASE, DAYNAME, DAYOFWEEK, DAYOFWEEK_ISO, DAYOFYEAR, DECRYPT_CHAR, DEGREES, DIFFERENCE, ENCRYPT_AES, ENCRYPT_RC2, ENCRYPT_TDES, EXP, FLOOR, GETHINT, HEX, IFNULL, JULIAN_DAY, LAND, LAST_DAY, LCASE, LEFT, LN, LNOT, LOG10, LOR, LOWER, LPAD, MAX, MIDNIGHT_SECONDS, MIN, MONTHNAME, NEXT_DAY, PI, QUARTER, RADIANS, RAND, REGEXP_COUNT, REGEXP_INSTR, REGEXP_REPLACE, REGEXP_SUBSTR, REPLACE, RIGHT, ROUND_TIMESTAMP, RPAD, SIN, SINH, SOUNDEX, TAN, TANH, TRUNC_TIMESTAMP, TRUNCATE, UCASE, UPPER, VALUE, WEEK, WEEK_ISO and XOR.

The download is a zip file containing a save file (1.9M) of the SQLSCALAR library and a READ_ME document which contains details on how to install and use the service program


Download SQLSCALAR Service Program Library

Check out the article at IT Jungle


Please note that this is not a supported product - the source of the programs is included and you are free to chop and change them as you wish (see standard disclaimer below). Of course, if you come across any bugs please let us know

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

More Downloads

Stay on top of download updates, new freebies and other news. Subscribe to our Email Alerts!
* (required field).

Email*
Re-Enter Email*
First Name
Last Name
List Choices *




You will receive a notification e-mail when you subscribe to the Mailing List

  • You may unsubscribe from our list at any time and we will immediately remove you.
  • We will never share your e-mail address or other personal information with any third party company without your express permission.
Home | Conferences | About Us | System i Community | Privacy Policy | Legal Notices | Email Webmaster | Contact
System i Developer,LLC © 2014