fhg
Volume 8, Number 5 -- February 6, 2008

Don't Let SQL Name Your Baby

Published: February 6, 2008

Hey, Ted:

We have started using SQL Data Definition Language (DDL) to define our physical files. One feature we really like is that we can use column (field) names longer than 10 characters. One feature we don't like is that SQL creates ugly alternate names of 10 characters that we end up using in our RPG programs. Is there any way we can rename these ugly names?

--Paul


I know what you mean, Paul. If a column name is more than 10 characters long, SQL creates a shorter column name from the first five characters of the field name and a five-digit sequence number. For example, look at this DDL.

create table SomeTable                                       
  (ID integer,                                                
   Name varchar(20),                                         
   PreferredName varchar(20))                                

The generated fields would be known as ID, NAME, and PREFE00001 in RPG programs. If you want to use a different shorter name than PREFE00001, include FOR COLUMN in the column definition.

create table SomeTable2                                      
  (ID integer,                                                
   Name varchar(20),                                         
   PreferredName for column prefname varchar(20))            

RPG programs will refer to the third field as PREFNAME.

--Ted




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
HELP/SYSTEMS

SEQUEL is the single solution for all your System i business intelligence needs.

                                                          · Executive Dashboards
                                                          · Graphical Query and Reporting
                                                          · Drill-Down Data Analysis
                                                          · Multi-Platform Database Access
                                                          · E-Mail Report and File Distribution
                                                          · Secure Web Access

Rely on SEQUEL to meet all your System i data access requirements.

Visit our Web site at http://www.helpsystems.com/400g


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Bytware:  Start the new year off with better security!
COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
Seagull Software:  Update your System i apps with LegaSuite GUI


 

IT Jungle Store Top Book Picks

Getting Started with PHP for i5/OS: List Price, $59.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket Developers' Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
iSeries Express Web Implementer's Guide: List Price, $59.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
WebFacing Application Design and Development Guide: List Price, $55.00
Can the AS/400 Survive IBM?: List Price, $49.00
The All-Everything Machine: List Price, $29.95
Chip Wars: List Price, $29.95


 
The Four Hundred
Entry System p Servers Get Power6 Chips, System i Boxes Await

The Power6 Server Ramp: Better Than Expected

IBM Takes System i Disk Clustering Up a Notch with HASM

The X Factor: Survive, Adapt, Repeat

i5/OS V5R3 Support Ends in April 2009

The Linux Beacon
Novell Taps Zonker to Manage openSUSE Project

Novell Partners with SNA to Make Mainframe Linux Easier

IBM Gets Power6 Chips into Entry System p Servers

The X Factor: Survive, Adapt, Repeat

High Voltage DC Systems for Data Centers Cut Power Use

Four Hundred Stuff
New Web Console Debuts with i5/OS V6R1

RPG to .NET Reduces Maintenance Pain, Adds Rich User Interface

IBM Makes DB2 Web Query More Affordable

Bug Busters' HA Offering Gets Role Swap Function

Security Vulnerability Reported in i5/OS

Big Iron
Motherboarding

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
February 2, 2008: Volume 10, Number 5

January 26, 2008: Volume 10, Number 4

January 19, 2008: Volume 10, Number 3

January 12, 2008: Volume 10, Number 2

January 5, 2008: Volume 10, Number 1

December 29, 2007: Volume 9, Number 52

The Windows Observer
Record Revenue Reported by Microsoft

Microsoft Quietly Ships Dynamics CRM 4.0

IBM to Buy AMD? Seems Unlikely, But an Interesting Idea

SQL Server 2008 Delayed--Is Windows Server 2008 Next?

Performance Expert Says AMD Beats Intel on Quad-Core Server Efficiency

The Unix Guardian
IBM Gets Power6 Chips into Entry System p Servers

IBM Creates Entry PowerVM Hypervisor, Gives Rebates on Unix Gear

Sun Makes an Honest Profit in Fiscal Q2 on Weak Growth

As I See It: Avatar Nation

IBM to Buy AMD? Seems Unlikely, But an Interesting Idea

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

WorksRight Software
Help/Systems
Guild Companies


Printer Friendly Version


TABLE OF CONTENTS
Setting Up A PHP/Web Environment On System i: Where Do I Start?

Don't Let SQL Name Your Baby

A Checklist For Moving System i Boxes

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
FTP in arrival sequence

S36 environment problem

QSH won't write in batch!

SQL Trigger

usine switches in RPGIII???





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement