Programming / SQL


Practical SQL: UDFs and Service Programs, Part I PDF Print E-mail
Programming - SQL
Written by Joe Pluta   
Wednesday, 02 November 2011 01:00

In this installment of our continuing series on using SQL in real business applications, we introduce the concept of invoking service programs from within SQL.

joe_plutaWritten by Joe Pluta

We continue to provide you with examples of integrating SQL with traditional RPG. In this article, we're going to focus on how we can use a service program to extend SQL and provide an essential feature that SQL is sorely lacking: converting binary data in a character field to numeric values. Note that this is the opposite of something like the HEX function, which returns the hexadecimal representation of a field. This function will take some alphanumeric data, either in packed or binary form, and return the numeric value the data represents. This practical extension to SQL can be used by any shop.

Add a comment
Last Updated on Wednesday, 02 November 2011 01:00
Read more...
 
User Rating: / 2
PoorBest 
Practical SQL: Three Ways to JOIN PDF Print E-mail
Programming - SQL
Written by Joe Pluta   
Wednesday, 05 October 2011 01:00

JOINing tables is one of the fundamental tasks in SQL, and this article explains three basic syntactical approaches.

joe_plutaWritten by Joe Pluta

SQL is the tool of choice for querying relational data, and the whole idea behind relational data is that the tables are related. What this means is that a common field in two tables can be used to tie rows from each table together into a coherent set of data. In SQL, this is performed via the JOIN, which has three distinct syntactical variations. This article will explain the differences, including a recent change that might catch you unaware.

Add a comment
Last Updated on Wednesday, 05 October 2011 01:00
Read more...
 
User Rating: / 4
PoorBest 
Practical SQL: Calling RPG from SQL, Part II PDF Print E-mail
Programming - SQL
Written by Joe Pluta   
Wednesday, 04 May 2011 01:00

This second article on combining the strengths of RPG and SQL shows how to turn a stored procedure into a user-defined function (UDF).

joe_plutaWritten by Joe Pluta

In my previous article, I showed you how to create a stored procedure that will invoke an RPG program (or COBOL or CL or any other program, ILE or non-ILE). I also showed you how to test it and even explained the primary shortcoming of stored procedures: they can't be used in SELECT statements. I explained that in order to use external business logic inside of a SELECT statement, you need to use the other SQL extension technique, the user-defined function (UDF). This article shows how to create a UDF that uses your stored procedure.

Add a comment
Last Updated on Wednesday, 04 May 2011 01:00
Read more...
 
User Rating: / 8
PoorBest 
Practical SQL: Calling RPG from SQL, Part I PDF Print E-mail
Programming - SQL
Written by Joe Pluta   
Wednesday, 06 April 2011 01:00

This first article on combining the strengths of RPG and SQL focuses on defining and testing stored procedures.

joe_plutaWritten by Joe Pluta

SQL and RPG are powerful and complementary tools. SQL does things well that are difficult or nearly impossible in RPG and vice versa. The trick is to develop programming strategies that take advantage of both. IBM recognized this and created the potent embedded RPG tooling, which allows you to easily take advantage of SQL from within RPG programs. This article is going to focus on the related technique of calling RPG from within SQL.

Add a comment
Last Updated on Wednesday, 06 April 2011 01:00
Read more...
 
User Rating: / 7
PoorBest 
Use SQuirreL SQL During RPG Development with Embedded SQL PDF Print E-mail
Programming - SQL
Written by Thomas Snyder   
Wednesday, 16 March 2011 01:00

Any OS, any programming language, any database—SQuirreL is a perfect fit for almost any situation involving SQL!

tom_snyderWritten by Tom Snyder

In a previous article, I showed you how to install the SQuirreL SQL client to run interactive SQL on your IBM i. With all the new stuff to learn about and all the options that are out there, sometimes a little introduction to the basics will be all it takes to get rolling. In this article, I'll cover some of my favorite features that come with it.

Add a comment
Last Updated on Wednesday, 16 March 2011 01:00
Read more...
 
User Rating: / 1
PoorBest 
An Open-Source DB2 SQL Graphical Tool That You Can Use for All Your Databases PDF Print E-mail
Programming - SQL
Written by Thomas Snyder   
Wednesday, 16 February 2011 01:00

Install SQuirreL SQL client to run interactive SQL on your IBM i.

tom_snyderWritten by Tom Snyder

As you start using embedded SQL more frequently within your RPG code, you'll soon find that your SQL statements are becoming larger and larger and the interactive SQL tool on the green-screen starts becoming quite cumbersome. In this article, I will introduce Squirrel SQL, which is an open-source SQL client that gives you not only a better interface to your DB2 database, but also access to numerous other databases.

Add a comment
Last Updated on Wednesday, 16 February 2011 09:50
Read more...
 
User Rating: / 10
PoorBest 
Practical SQL: SQLCOD and SQLSTT PDF Print E-mail
Programming - SQL
Written by Joe Pluta   
Wednesday, 03 November 2010 01:00

This article compares SQLCOD and SQLSTT and shows you how to avoid one of the primary gotchas you face when using SQLSTT.

joe_plutaWritten by Joe Pluta

Embedded SQL programming is one of the most productive additions ever made to the IBM i development environment. But it's rarely used to run the traditional example statements you see in the SQL programming books: statements that increase the price of every item by 15 percent. Instead, the most often used construct in the embedded SQL toolkit is the cursor, which essentially provides a dynamically built logical file to your RPG program. And like any logical file, an essential part of using the file is knowing when you've hit the end. RPG provides two variables: SQLCOD and SQLSTT. SQLSTT is the more standard technique, but its improved accuracy does not come without some cost. Fortunately, that cost is pretty low, and I'll even pick up the tab!

Add a comment
Last Updated on Wednesday, 03 November 2010 01:00
Read more...
 
User Rating: / 6
PoorBest 
Why Use Embedded SQL Within RPG? PDF Print E-mail
Programming - SQL
Written by Thomas Snyder   
Wednesday, 20 October 2010 01:00

Let's evaluate the reasons you might want to take this approach.

tom_snyderWritten by Tom Snyder

You've heard about embedded SQL and maybe you've tried embedded SQL, but you may be asking yourself, "Why would I use embedded SQL?" That's the course that I have taken. Of course, when a new capability comes out, I am usually eager to start digging into it and figuring out how it works. And I have done that with SQL, but I couldn't easily find a reason to justify its use until recently.

Add a comment
Last Updated on Tuesday, 19 October 2010 11:34
Read more...
 
User Rating: / 10
PoorBest 
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Page 6 of 16

WEBCAST

MC Webcast CenterFEATURED WEBCAST

See What i Can Do With Modern RPG Development

Your applications deserve more than just a new look! Change the perception of the IBM i as “old” with modern development tips from IBM and Profound Logic Software.
Watch as Barbara Morris, Brian May and Alex Roytman dive beneath the GUI surface to show the benefits of:

 

  • Working with free-format RPG in IBM i TR7
  • Breaking free from “The Cycle” of traditional RPG development
  • Going beyond the 10 character limit in display and database files
  • And more!

You'll also see a live demonstration of these techniques as the presenters create a modern web application before your eyes! 

 

Watch the Webinar Now!

 

TRIAL SOFTWARE

MS Office Connector for Query/400

NGS' Qport Office enables Windows users to run IBM Query/400 queries to: 

 - Create and update Excel spreadsheets and Access databases

 - Create Word documents

 - Send to Windows screen and PC printers

No query conversion is required. Works with i5/OS V5R1 & above. Installs in minutes!

If you don’t have a budget to replace IBM Query/400, but want your users to have one click enhanced output of their queries.… Request the online license agreement and product download instructions today!

Offer good through December 31, 2013.

   MC-STORE.COM