table.</para> \r
</step>\r
<step>\r
+ <para>Copy records into staging table from a comma delimited file.</para>\r
+<programlisting language="sql">\r
+COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone, password) \r
+ FROM '/home/opensrf/patrons.csv' \r
+ WITH CSV HEADER; \r
+</programlisting>\r
+ <para>The above script wil vary depending on the format of your patron load file (<filename>patrons.csv</filename>). You may want to review \r
+ <link xl:href="http://www.postgresql.org/docs/9.0/static/sql-copy.html" xl:title="PostgreSQL - COPY">PostgreSQL documentation</link></para> \r
+ </step>\r
+ <step>\r
<para>Formatting of some fields to fit Evergreen filed formatting may be required. Here is an example of sql to adjust phone numbers in the staging \r
table to fit the evergreen field:</para>\r
<programlisting language="sql">\r
</programlisting>\r
<para>Data <quote>massaging</quote> may be required to fit formats used in Evergreen.</para>\r
</step>\r
+ \r
+\r
+\r
+\r
<step>\r
<para>Insert records from the staging table into the <link linkend="actor.table.usr">actor.usr</link> Evergreen table:</para>\r
<programlisting language="sql">\r
INSERT INTO actor.usr (\r
profile, usrname, email, passwd, ident_type, ident_value, first_given_name, \r
family_name, day_phone, home_ou, claims_returned_count, net_access_level) \r
- SELECT profile, students.usrname, email, student_id, ident_type, student_id, \r
+ SELECT profile, students.usrname, email, password, ident_type, student_id, \r
first_name, last_name, phone, home_ou, claims_returned_count, net_access_level \r
FROM students;\r
</programlisting> \r
\r
\r
--Copy records from your import text file\r
-COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone) \r
+COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone, password) \r
FROM '/home/opensrf/patrons.csv' \r
WITH CSV HEADER; \r
\r
INSERT INTO actor.usr (\r
profile, usrname, email, passwd, ident_type, ident_value, first_given_name, family_name, \r
day_phone, home_ou, claims_returned_count, net_access_level) \r
- SELECT profile, students.usrname, email, student_id, ident_type, student_id, first_name, \r
+ SELECT profile, students.usrname, email, password, ident_type, student_id, first_name, \r
last_name, phone, home_ou, claims_returned_count, net_access_level FROM students;\r
\r
--Insert records from the staging table into the actor.usr table.\r
INSERT INTO actor.usr (\r
profile, usrname, email, passwd, ident_type, ident_value, first_given_name, \r
family_name, day_phone, home_ou, claims_returned_count, net_access_level) \r
- SELECT profile, students.usrname, email, student_id, ident_type, student_id, \r
+ SELECT profile, students.usrname, email, password, ident_type, student_id, \r
first_name, last_name, phone, home_ou, claims_returned_count, net_access_level \r
FROM students;\r
</programlisting> \r
); \r
\r
--Copy records from your import text file\r
-COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone) \r
+COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone, password) \r
FROM '/home/opensrf/patrons.csv' \r
WITH CSV HEADER; \r
\r
INSERT INTO actor.usr (\r
profile, usrname, email, passwd, ident_type, ident_value, first_given_name, family_name, \r
day_phone, home_ou, claims_returned_count, net_access_level) \r
- SELECT profile, students.usrname, email, student_id, ident_type, student_id, first_name, \r
+ SELECT profile, students.usrname, email, password, ident_type, student_id, first_name, \r
last_name, phone, home_ou, claims_returned_count, net_access_level FROM students;\r
\r
--Insert records from the staging table into the actor.usr table.\r