By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,851 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,851 IT Pros & Developers. It's quick & easy.

Difference between a 'file' and a 'table'

P: n/a

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?

--
Texeme
http://texeme.com
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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 *FILE
and a Type *TBL, maybe I will ask the next question, what is the difference
between the two?

Thanks,

RdR

"John Bailo" <ja*****@texeme.com> wrote in message
news:zP********************@speakeasy.net...

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?

--
Texeme
http://texeme.com

Nov 12 '05 #2

P: n/a
RdR
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

"RdR" <ro*@delrosario.ca> wrote in message
news:Q_****************@nnrp.ca.mci.com!nnrp1.uune t.ca...
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

"John Bailo" <ja*****@texeme.com> wrote in message
news:zP********************@speakeasy.net...

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?

--
Texeme
http://texeme.com


Nov 12 '05 #3

P: n/a
RdR wrote:
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

"John Bailo" <ja*****@texeme.com> wrote in message
news:zP********************@speakeasy.net...
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?

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/iserie...tm#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

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.