Programming / SQL


Introduction to SQL, Part 4 PDF Print E-mail
Programming - SQL
Written by James Buck   
Wednesday, 10 April 2013 00:00

Editor's note: This article is an excerpt from Mastering IBM i, published by MC Press.

jim buckWritten by James Buck and Jerry Fottral

SQL's version of a logical file is a view. Although a view is conceptually similar to a logical file, SQL's greater flexibility and ability to use functions and expressions make views far more powerful than logical files. For example, in a logical file there is no way to select group summary records based on the value returned by a column function, as we did in the final example of the previous article. Nevertheless, in SQL, creating such a view is easy; in fact, we already have most of the code for it. The only thing we need to do is prefix our earlier Select statement with a Create View statement and then name the virtual column created by the Min function. Here is the statement to create the view of department elders:

Last Updated on Friday, 05 April 2013 12:29
Read more...
 
User Rating: / 1
PoorBest 
Practical SQL: OLAP, Part 1 PDF Print E-mail
Programming - SQL
Written by Joe Pluta   
Wednesday, 03 April 2013 00:00

Online Analytical Processing (OLAP) adds a variety of processing features to SQL syntax that makes it much more useful as an ad hoc analysis tool, and this article introduces the first of those functions.

joe plutaWritten by Joe Pluta

SQL has always been a great tool for querying data. The problem is that SQL doesn't always lend itself to the sort of pattern analysis that's needed in enterprise data processing. Something goes awry in the database and the only way to identify the source of the problem is to backtrack through history. Let me give you a real-world example (the data has been changed to protect the innocent, but the situation is pretty common).

Last Updated on Tuesday, 02 April 2013 12:24
Read more...
 
User Rating: / 2
PoorBest 
Introduction to SQL, Part 3 PDF Print E-mail
Programming - SQL
Written by James Buck   
Wednesday, 13 March 2013 00:00

Editor's note: This article is an excerpt from Mastering IBM i, published by MC Press.

jim buckWritten by Jim Buck and Jerry Fottral

If you tell SQL to retrieve rows that have the same column values, it will do that, duplicating those rows in the result table. For example, if you wanted to list the employee numbers of any employees assigned to any project, you might simply type...

Last Updated on Wednesday, 13 March 2013 00:00
Read more...
 
User Rating: / 3
PoorBest 
Enhance Your SQL Queries with User-Defined Table Functions PDF Print E-mail
Programming - SQL
Written by Jim Staton   
Wednesday, 20 February 2013 00:00

Simplify your SQL SELECT statements, provide an interface to pass parameters to create dynamic tables, automatically log access to tables, and create a single point of maintenance for the SQL code you use repeatedly.

jim statonWritten by Jim Staton

In my previous article, "Reuse Your RPG Code with SQL User-Defined Functions," I discussed how you could reuse RPG business logic in SQL by taking an RPG program or service program that returns a single value and then using the SQL CREATE FUNCTION command to make the business logic available to any high-level language (HLL), such as PHP or Java, or any tool that uses SQL to access data on your system. There are times, however, when you might want a function that returns not just a single value but a set of values or even a table. In that case, you could consider using a User-Defined Table Function (UDTF).

Last Updated on Tuesday, 19 February 2013 15:21
Read more...
 
User Rating: / 3
PoorBest 
Simplified Management of SQL Procedures and Functions PDF Print E-mail
Programming - SQL
Written by Kent Milligan   
Wednesday, 02 January 2013 00:00

The recently announced Technology Refresh #5 for the IBM i 7.1 release includes an enhancement that makes management of SQL stored procedure and function objects easier.

kent milligan 117x117Written by Kent Milligan

SQL procedures and functions have been supported by DB2 for i for many releases. This support enables developers to create procedural SQL objects like the example procedure shown in Figure 1. When the SQL Create Procedure statement in Figure 1 is executed, DB2 for i generates a C program object into the specified library (TESTLIB). The generated C program object gets called whenever an application invokes the TestProc stored procedure.

Last Updated on Wednesday, 02 January 2013 00:00
Read more...
 
User Rating: / 3
PoorBest 
Introduction to SQL, Part 2 PDF Print E-mail
Programming - SQL
Written by James Buck   
Wednesday, 12 December 2012 00:00

Editor's Note: This article is an excerpt from Mastering IBM i (MC Press, 2011).

jim buckWritten by Jim Buck and Jerry Fottral

In the first article of this series, we began to examine the basic form of an SQL statement to obtain information from a database table or tables:

Last Updated on Monday, 10 December 2012 12:32
Read more...
 
User Rating: / 4
PoorBest 
Introduction to SQL, Part 1 PDF Print E-mail
Programming - SQL
Written by James Buck   
Wednesday, 14 November 2012 00:00

This article is an excerpt from Mastering IBM i (MC Press, 2011).

jim buckWritten by Jim Buck and Jerry Fottral

Structured Query Language (SQL) has become the mainstay for data manipulation on most platforms today. It is important for today's IBM i professional to understand the traditional DDS tools, but most new database systems are created and manipulated using SQL. The intent of this series of articles is to expose the reader to both the traditional tools and the latest tools and concepts. SQL is a complete database language with data-definition, data-manipulation, and data-control components.

Last Updated on Monday, 12 November 2012 14:01
Read more...
 
User Rating: / 3
PoorBest 
Simplify SQL "With" Common Table Expressions PDF Print E-mail
Programming - SQL
Written by Sam Lennon   
Wednesday, 19 September 2012 00:00

Use the WITH keyword to make your SQL statements easier to code and maintain.

sam lennonWritten by Sam Lennon

Common table expressions (CTEs) allow you to break down complex SQL logic into smaller pieces. This makes development and testing easier, and when you come back to the code next year you'll understand it more quickly. That can't be bad, and a CTE is not hard to use. In this article, I'll provide working examples of CTEs that demonstrate their ease of use and the clarity they can provide.

Last Updated on Friday, 14 September 2012 08:18
Read more...
 
User Rating: / 4
PoorBest 
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Page 1 of 13

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM