Data Types and Runsqlstm
Data Types and Runsqlstm
Agenda
• Lab 1 demo this week
– Bring your lab notes!
• Create your own Data Types
• Label on
• Authority
• RunSQLstm
Create your own Data Types
• Also known as User-Defined Types (UDTs)
• Used to create specific versions of standard data
types
• Eg:
Create Distinct Type CustIDType
as Dec(7, 0)
with Comparisons
Creates a data type called CustIDType that is a 7 digit
decimal. The ‘with Comparisons’ allows the use of >,
=, etc with this data type
Create a new Customer table
with a unique Customer Code
using a UDF
Label on
• Table or view – description
• Column
– Column Heading (20 characters per line)
– Text description
Authorization Terms
• See Chapter 9, figure 9.1 from text book
Object Ownership
• WRKOBJOWN
– Displays all objects that you own
• The owner automatically has *ALL
authority to an object
• Every object must have an owner
If you’re not the owner
• Then you can have
– Explicit authority
– Part of an authorization list
– Belong to a group profile
– Part of *PUBLIC
EDTOBJAUT
• RUNSQLSTM
SRCFILE(LAURIN/QSQLSRC)
SRCMBR(RUNTST) NAMING(*SQL)
– Naming convention must be changed to *SQL
if the sql convention, library.object is used
Use WRKSPLF to view the
resulting Spooled File