Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
SQL Query File for Web/Mobile is used here to generate this Scroll Table containing RPG IV Edit Codes. You can also output the data directly as JSON if you prefer.
To create this example, I embedded an SQL Query File for Web statement that retrieved the rather lengthy SQL SELECT statement and processed it, and then returned the complete scrolling Table HTML to the browser.
The SQL Statement uses the example EDITCODES table created in this blog entry. The SQL SELECT query statement was a bit long, but is standard SQL that could be run on any platform.
SQL Query File for web allows you to run any SQL SELECT statement from your web pages and receive the results as either HTML (as is the case here) or in JSON format. It is so easy to use, and no additional software is required.
I embedded the original EDITCODES table's SQL SELECT statement below, but to obscure it from viewers, I've placed it into a source file member and referenced it instead of directly embeddeding the SELECT statement--but the results are the same.
This is the simplest way to build a web element with your data. Just tell SQL Query File the type of output you want and then pass in the SQL SELECT statement and you get your data in that format. You can use it with JQUERY, pure JavaScript, HTML, Dojo, Ruby and any JSON-aware JavaScript library. You may even embedded an App/Excel header so that it opens Excel from a Webpage for our users. It's so easy and reliable that you'll think it's part of the operating system, only better.
Edit Code |
Print Commas |
Print Decimal Point |
Negative Sign |
Zero Supress |
Print Blanks When Zero |
Examples 1 Packed(7,2) 1234.50 |
Examples 2 Packed(7,2) 0.00 |
Examples 3 Packed(7,2) -1000.00 |
|
---|---|---|---|---|---|---|---|---|---|
1 | Yes | Yes | Yes | Yes | 1,234.50 | .00 | 1,000.00 | ||
2 | Yes | Yes | 1,234.50 | 1,000.00 | |||||
3 | Yes | Yes | Yes | 1234.50 | .00 | 1000.00 | |||
4 | Yes | 1234.50 | 1000.00 | ||||||
A | Yes | Yes | CR | Yes | Yes | 1,234.50 | .00 | 1,000.00CR | |
B | Yes | CR | Yes | 1,234.50 | 1,000.00CR | ||||
C | Yes | CR | Yes | Yes | 1234.50 | .00 | 1000.00CR | ||
D | CR | Yes | 1234.50 | 1000.00CR | |||||
J | Yes | Yes | Right | Yes | Yes | 1,234.50 | .00 | 1,000.00- | |
K | Yes | Right | Yes | 1,234.50 | 1,000.00- | ||||
L | Yes | Right | Yes | Yes | 1234.50 | .00 | 1000.00- | ||
M | Right | Yes | 1234.50 | 1000.00- | |||||
N | Yes | Yes | Left | Yes | Yes | 1,234.50 | .00 | -1,000.00 | |
O | Yes | Left | Yes | 1,234.50 | -1,000.00 | ||||
P | Yes | Left | Yes | Yes | 1234.50 | .00 | -1000.00 | ||
Q | Left | Yes | 1234.50 | -1000.00 | |||||
X | Embed | Yes | 0123450 | 0000000 | 010000} |