> With OS400, all files are objects that can be accessed relationally.
>
[quoted text clipped - 5 lines]
>
> So, what is the difference between a table and a file?
I found an answer to my question. A Type *TBL was created through SQL and a
*FILE was created through OS/400's utilitites. Apparently, a *TBL will be
very similar to a table used outside the AS/400 like NULLS can be used, a
varchar can be used but it seems for a type *FILE, there are limitations.
But both can be accessed through STRSQL.
To expound on that, a *FILE may also mean it is a saved file (a file that
you use to restore) which in this case cannot be accessed through STRSQL.
Also there are externally described files as in flat files or system 36
files whose structure is described separate from the file itself.
RdR
> Without being strict in its definition a file and a table in OS/400 are
> the same. If you go into object types you will find that there is a Type
[quoted text clipped - 14 lines]
>>
>> So, what is the difference between a table and a file?
Karl Hanson - 29 Jul 2005 16:21 GMT
> I found an answer to my question. A Type *TBL was created through SQL and a
> *FILE was created through OS/400's utilitites. Apparently, a *TBL will be
[quoted text clipped - 18 lines]
>>>
>>>So, what is the difference between a table and a file?
No, SQL does not create OS/400 objects of type *TBL. The *TBL objects
are for translation of data (see documentation for the OS/400 CRTTBL CL
command). The SQL CREATE TABLE statement creates a physical file (*FILE).
See this link for an overview of mapping SQL to OS/400 objects:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/sqlp/rbafymstxdbterms.htm
#HDRXDBTERMS
Although an SQL table is a physical file (*FILE object type), there are
many other types of OS/400 *FILE objects, and many are *not* accessed
relationally. Examples are save files and device files. Try this
simple test on any OS/400 command entry:
> CRTSAVF FILE(QTEMP/XYZ)
> dspfd qtemp/xyz
> crtsrcpf qtemp/src
> dspfd qtemp/src
> CRTTAPF FILE(QTEMP/TAP)
> dspfd qtemp/tap
In each dspfd command output, see the "Type of file" information. The
crtsrcpf command is just a quick (non-SQL) way to create a physical file
with 3 predefined columns (not normally used for relational access, but
most often used to store source code for programs - RPG, C/C++, etc).
--
Karl Hanson