• 1 reply
  • Latest Post - ‏2013-10-02T05:39:49Z by B.Hauser
Eddie Price
Eddie Price
1 Post

Pinned topic SQL Table using references

‏2013-10-01T19:11:34Z |

I have an old PF that I have converted to a SQL table.  In the PF, it is using a reference:

A                                      REF(ICMSFREF)
A          R IMTCIDR                               

A            ITSTAT    R               REFFLD(STAT)


How do I use this reference in my new SQL Table?  Currently I've redefined the entire table.  Since we have lots of old PFs, I would like to be able to use the references.



Eddie Price

  • B.Hauser
    290 Posts

    Re: SQL Table using references


    SQL does not support reference files in the way DDS does.

    But it is possible to create a table by referencing on columns in other tables.

    CREATE TABLE YourSchema/YourTable (ITSTAT, ...)
    as (SELECT STAT, ....
         From ICMSFREF)
    With No Data;

    However only the absolute definition of the generated column ist stored, i.e. the information on which reference field the column referred is not stored.

    If you have to modify the reference field, you have to alter manually all columns that originally referred to this reference field.