head	1.7;
access;
symbols
	REL7_2_8:1.4
	REL7_2_7:1.4
	REL7_2_6:1.4
	REL7_2_5:1.4
	REL7_2_4:1.4
	REL7_2_3:1.4
	REL7_2_STABLE:1.4.0.6
	REL7_2:1.4
	REL7_2_RC2:1.4
	REL7_2_RC1:1.4
	REL7_2_BETA5:1.4
	REL7_2_BETA4:1.4
	REL7_2_BETA3:1.4
	REL7_2_BETA2:1.4
	REL7_2_BETA1:1.4
	REL7_1_2:1.4
	REL7_1_STABLE:1.4.0.4
	REL7_1_BETA:1.4
	REL7_1_BETA3:1.4
	REL7_1_BETA2:1.4
	REL7_1:1.4
	REL7_0_PATCHES:1.4.0.2
	REL7_0:1.4
	REL6_5_PATCHES:1.1.0.2;
locks; strict;
comment	@# @;


1.7
date	2002.08.30.16.48.42;	author momjian;	state dead;
branches;
next	1.6;

1.6
date	2002.07.02.06.11.23;	author momjian;	state Exp;
branches;
next	1.5;

1.5
date	2002.06.20.16.00.43;	author momjian;	state Exp;
branches;
next	1.4;

1.4
date	99.10.30.16.18.44;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	99.10.30.16.01.04;	author momjian;	state dead;
branches;
next	1.2;

1.2
date	99.09.20.22.32.39;	author scrappy;	state Exp;
branches;
next	1.1;

1.1
date	99.09.13.18.47.19;	author momjian;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	99.09.13.18.47.19;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Remove pgaccess from CVS.  It has its own home now.
@
text
@<html><head><title>PgAccess Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess Tutorial - Editing a table</h1>
<img src="sel_tbl.jpg" border=1 align=right>
<h2>Adding records</h2>
Once you have a table, you can begin to add entries to it.  In the main
PgAccess window, when you click the <em>Tables</em> button, you should see the
new table appear in the list of tables.  Highlighting the table name by clicking
on it and clicking on the <em>Open</em> button will open that table in another
window, as shown below.<p>
The most straighforward way to add records to a table is to type the information
directly into the fields.  Two records have been entered in the table shown.  As
is common with this user interface, clicking the mouse while the pointer is in a 
field will allow keyboard entry to that field.  This type of entry is adequate
when the information arrives infrequently in small parcels, for instance in
keeping a table of contact information about other researchers.  However, what
do you do when someone emails you the entire reference list for their doctoral
dissertation?<p>
This is best handled using the SQL <em>COPY</em> command. 
First, the information will have to be massaged into shape in what is called a
'flat' ASCII file.  This is simply a text file in which each line is a record,
and each field in each record is separated by a <em>delimiter</em> such as a
tilde (~).  The fields will have to be in the same order as those in your table,
and there will have to be the same number of fields in each record as are in the
table, otherwise you may get unexpected data or no data at all.  Say you produce
a text file named <samp>newref.txt</samp> that starts like this:<p>
<samp>Cassileth, BR~Unorthodox Cancer Medicine~Cancer Investigation~~1986~4~6~591-598
<br>...</samp><p>
Notice that there are two consecutive tildes to allow for the fact that this
particular entry doesn't have anything in the <b>Editor</b> field.
You can then perform a <em>Query</em> as follows:<p>
<samp>COPY psyref FROM '/home/jim/newref.txt' USING DELIMITERS
'~';</samp><p>
This will read the records from <samp>newref.txt</samp> and insert them into the
table <samp>psyref</samp>. See the PostgreSQL documentation under the headings 
<br><b>Tutorial|The Query Language|Populating a Class with Instances</b><p>
<img src="addref.jpg" border=1 align=right>
<a href="index.html#tut">Back to index</a>
</body></html>
@


1.6
log
@Update to pgaccess 0.91.
@
text
@@


1.5
log
@Improve COPY syntax to use WITH clause, keep backward compatibility.
@
text
@d32 1
a32 1
<samp>COPY psyref FROM '/home/jim/newref.txt' WITH DELIMITER
@


1.4
log
@Add 0.98.
@
text
@d32 1
a32 1
<samp>COPY psyref FROM '/home/jim/newref.txt' USING DELIMITERS
@


1.3
log
@Remove 0.96 for update to 0.98
@
text
@@


1.2
log
@
fixing it more..
@
text
@@


1.1
log
@file tut_edit.html was initially added on branch REL6_5_PATCHES.
@
text
@d1 39
@


1.1.2.1
log
@Update pgaccess 0.98
@
text
@a0 39
<html><head><title>PgAccess Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess Tutorial - Editing a table</h1>
<img src="sel_tbl.jpg" border=1 align=right>
<h2>Adding records</h2>
Once you have a table, you can begin to add entries to it.  In the main
PgAccess window, when you click the <em>Tables</em> button, you should see the
new table appear in the list of tables.  Highlighting the table name by clicking
on it and clicking on the <em>Open</em> button will open that table in another
window, as shown below.<p>
The most straighforward way to add records to a table is to type the information
directly into the fields.  Two records have been entered in the table shown.  As
is common with this user interface, clicking the mouse while the pointer is in a 
field will allow keyboard entry to that field.  This type of entry is adequate
when the information arrives infrequently in small parcels, for instance in
keeping a table of contact information about other researchers.  However, what
do you do when someone emails you the entire reference list for their doctoral
dissertation?<p>
This is best handled using the SQL <em>COPY</em> command. 
First, the information will have to be massaged into shape in what is called a
'flat' ASCII file.  This is simply a text file in which each line is a record,
and each field in each record is separated by a <em>delimiter</em> such as a
tilde (~).  The fields will have to be in the same order as those in your table,
and there will have to be the same number of fields in each record as are in the
table, otherwise you may get unexpected data or no data at all.  Say you produce
a text file named <samp>newref.txt</samp> that starts like this:<p>
<samp>Cassileth, BR~Unorthodox Cancer Medicine~Cancer Investigation~~1986~4~6~591-598
<br>...</samp><p>
Notice that there are two consecutive tildes to allow for the fact that this
particular entry doesn't have anything in the <b>Editor</b> field.
You can then perform a <em>Query</em> as follows:<p>
<samp>COPY psyref FROM '/home/jim/newref.txt' USING DELIMITERS
'~';</samp><p>
This will read the records from <samp>newref.txt</samp> and insert them into the
table <samp>psyref</samp>. See the PostgreSQL documentation under the headings 
<br><b>Tutorial|The Query Language|Populating a Class with Instances</b><p>
<img src="addref.jpg" border=1 align=right>
<a href="index.html#tut">Back to index</a>
</body></html>
@
