|
1) I am not sure that you can do that by using a User Defined Type instead. But it bears looking into. Doesn't it make sense to define a field as a Social Security Number, rather than defining it as a numeric, or a formatted alphanumeric? 2) Another option is to use a view instead of querying the physical file itself. The column in the view could be a UDF that has that field passed to it and properly edited. Another beauty of the view is that you can already set up the joins so that the user doesn't have to do it each time they create a query. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com |-----------------------------+-------------------------------------------| | Jim Essinger | | | <esinger@xxxxxxxx> | | | Sent by: | To| | midrange-l-bounces@midrang| Midran| | e.com | ge | | | System| | 07/23/2004 05:10 PM | s | | | Techni| | Please respond to | cal | | Midrange Systems | Discus| | Technical Discussion | sion | | <midrange-l@xxxxxxxxxxx| <midra| | m> | nge-l@| | | midran| | | ge.com| | | > | | | cc| | | | | | Subject| | | Re: | | | Field | | | Refere| | | nce | | | File | | | (was | | | SQL | | | vs. | | | tradit| | | ional | | | I/O?) | | | | | | | | | | | | | | | | | | | |-----------------------------+-------------------------------------------| What about edit codes? When using DDS you can tell the file what editing to use on a field. We do a lot with Social Security numbers and have a system edit code setup to display correctly (999-99-9999). When using the iSeries Nagivator to generate SQL statements I get warning/error messages such as; SQL150D 10 EDTCDE (EDTWRD) in column DBT_ORIG_BAL ignored. Can SQL define a column with predefined editing? Sure saves a lot of time when doing adhoc queries, and works for date data types, dollar amounts, Social Security Numbers, and the like. Jim At 02:00 PM 7/23/2004, you wrote: Jim, You can emulate a field reference file using the WITH NO DATA clause. CREATE TABLE EMPLOYEE AS (SELECT EMPLOYEE_ID, NAME, etc. FROM FIELDREF) WITH NO DATA Not sure if it was V5R1 or V5R2 it was introduced. HTH Paul Tuohy >> Jim Essinger wrote The other thing that DDS _can_ bring to the table is using field reference files, if you design your files that way. Not do-able in SQL if I remember right. Jim -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.