Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / July 2005

Tip: Looking for answers? Try searching our database.

Difference between a 'file' and a 'table'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Bailo - 26 Jul 2005 19:51 GMT
With OS400, all files are objects that can be accessed relationally.

When I view the file system from Navigator (windows client), I see there is
the Database and SQL tables, then there is the filesystem.

I can manipulate both these objects (tables, files) with SQL.

So, what is the difference between a table and a file?

Signature

Texeme
http://texeme.com

RdR - 27 Jul 2005 14:29 GMT
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 *FILE
and a Type *TBL, maybe I will ask the next question, what is the difference
between the two?

Thanks,

RdR

> 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?
RdR - 28 Jul 2005 22:08 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
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.