<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Ha ha! Thanks John<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I use SQL to edit stuff on another database all the time (successfully), but this is different, and not my primary area (hence the checking). I shall check the MySQL for dummies again as I have clearly mis-read
 it&#8230;.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Many thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Claire<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-GB"> eprints-tech-bounces@ecs.soton.ac.uk
 [mailto:eprints-tech-bounces@ecs.soton.ac.uk] <b>On Behalf Of </b>John Salter<br>
<b>Sent:</b> 20 September 2012 12:04<br>
<b>To:</b> 'eprints-tech@ecs.soton.ac.uk'<br>
<b>Subject:</b> [EP-tech] Re: MySQL query to update a column value<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">&gt;I think your initial command would have set the 'type' (eprint type) to 'text' for all your eprints. Eeek!</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">Actually, it should complain about an unknown column 'field'. If there was a column named 'field' in the eprints table, and it contained
 the value 'num_pieces' then the 'type' column for it would have been set to 'text'.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">You did the right thing in checking - it's a dangerous (but powerful) thing having this level of database access :o)</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p>&nbsp;</o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-GB">
<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
<a href="mailto:[mailto:eprints-tech-bounces@ecs.soton.ac.uk]">[mailto:eprints-tech-bounces@ecs.soton.ac.uk]</a>
<b>On Behalf Of </b>John Salter<br>
<b>Sent:</b> 20 September 2012 11:55<br>
<b>To:</b> 'eprints-tech@ecs.soton.ac.uk'<br>
<b>Subject:</b> [EP-tech] Re: MySQL query to update a column value</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">NOOO! STOP STOP STOP!</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">An 'update eprint' command will edit the data in the table, not the structure of the table itself.</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">You need an 'ALTER TABLE' command, something like (this is untested, and off-the-top-of-my-head-and-therefore-possibly-not-right. Anyone
 else care to comment?):</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">ALTER TABLE eprint MODIFY num_pieces TEXT;</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">See this (or an appropriate version for your MySQL version)</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><a href="http://dev.mysql.com/doc/refman/5.1/en/alter-table.html"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">http://dev.mysql.com/doc/refman/5.1/en/alter-table.html</span></a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">I think your initial command would have set the 'type' (eprint type) to 'text' for all your eprints. Eeek!</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">&nbsp;<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">Cheers,</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:blue;mso-fareast-language:EN-GB">John</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p>&nbsp;</o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-GB">
<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
<a href="mailto:[mailto:eprints-tech-bounces@ecs.soton.ac.uk]">[mailto:eprints-tech-bounces@ecs.soton.ac.uk]</a>
<b>On Behalf Of </b>Claire Eskriett<br>
<b>Sent:</b> 20 September 2012 11:37<br>
<b>To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br>
<b>Subject:</b> [EP-tech] MySQL query to update a column value</span><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal">Hi all<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;ve edited eprints.pl to change the property of an eprint field from an integer to text but running update_database_structure has not updated the eprint table. I&#8217;ve been advised to update manually using MySQL and have come up with the
 following:<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Use &lt;database name&gt;<o:p></o:p></p>
<p class="MsoNormal">Update eprint<o:p></o:p></p>
<p class="MsoNormal">Set type = text<o:p></o:p></p>
<p class="MsoNormal">Where field = num_pieces<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I think this is ok &#8211; I&#8217;ve specified the table (eprint) and the field that I want to update (num_pieces) and the column that I want updating is &#8216;type&#8217;. The current row in the table is as follows:<o:p></o:p></p>
<p class="MsoNormal"><b>Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Null | Key | Default | Extra<o:p></o:p></b></p>
<p class="MsoNormal">num_pieces&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | int(11)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | YES&nbsp; | MUL | NULL&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Can anyone take pity on me and reassure me that this is ok? I ask as a MySQL novice.
<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Many thanks for any advice!<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Claire<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;mso-fareast-language:EN-GB">Claire Eskriett, Systems Librarian<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;mso-fareast-language:EN-GB">(Days of work are Mon, Tues, Thurs &amp; Fri)<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">Information Services<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">Cockcroft Building<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">University of Brighton<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">Lewes Road<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">Brighton BN2 4GJ<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">T: 01273 642766<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">E:
<a href="mailto:C.Eskriett@brighton.ac.uk">C.Eskriett@brighton.ac.uk</a><o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-GB"><br>
___________________________________________________________<br>
This email has been scanned by MessageLabs' Email Security<br>
System on behalf of the University of Brighton.<br>
For more information see <a href="http://www.brighton.ac.uk/is/spam/">http://www.brighton.ac.uk/is/spam/</a><br>
___________________________________________________________<br>
<br>
___________________________________________________________<br>
This email has been scanned by MessageLabs' Email Security<br>
System on behalf of the University of Brighton.<br>
For more information see <a href="http://www.brighton.ac.uk/is/spam/">http://www.brighton.ac.uk/is/spam/</a><br>
___________________________________________________________<o:p></o:p></span></p>
</div>
<br clear="both">
___________________________________________________________<BR>
This email has been scanned by MessageLabs' Email Security<BR>
System on behalf of the University of Brighton.<BR>
For more information see http://www.brighton.ac.uk/is/spam/<BR>
___________________________________________________________<BR>
</body>
</html>