[Koha] SQL help - Bulk Card Number modification

Pedro Amorim pjamorim91 at gmail.com
Fri Jan 19 00:02:58 NZDT 2018


Hello Satish,

I'm not sure I fully understand your situation but I'll try to provide help
based on what I could figure out:


*We use, students' register number as card number for circulation.
Andregarding bulk 'card number' modifications :*
Does this mean you use the patrons' borrowernumber as cardnumber? So
borrowernumber = cardnumber?



*After receiving 'permanent register number fromthe college office, I have
to replace 'temporary number' by 'permanent cardnumber'.*
How exactly is the temporary card number going to be assigned? What's the
pattern? Are you using the already present cardnumber and concatenating
something like "temp" to it?

If what I stated above is true, then this should help:

UPDATE borrowers
   SET cardnumber = CONCAT("TMP", borrowernumber)
   WHERE categorycode = 'STU';

UPDATE borrowers
   SET cardnumber = borrowernumber
   WHERE cardnumber LIKE "TMP*";

If what I stated above is false and/or makes no sense, then ignore
everything I said :)

GL,

Pedro Amorim


On 18 January 2018 at 04:57, SATISH <lis4satish at gmail.com> wrote:

> Hi,
>
> With Koha 16.11.11 / Package Installation/ Ubuntu 14.04 Desktop with
> MySQL -  mysql Ver 14.14 Distrib 5.5.57
>
> We use, students' register number as card number for circulation. And
> regarding bulk 'card number' modifications :
>
> I have a situation, where, first semester borrowers will only get
> 'permanent register number' during the time of examinations.
> Till that, I should manage borrowers' circulation with 'temporary card
> number' (assigned by me). After receiving 'permanent register number from
> the college office, I have to replace 'temporary number' by 'permanent card
> number'.
>
> Going editing/modifying each patron one by one is very tedious and time
> consuming, therefore, Is there any way I could use sql and some kind of
> script to replace card number? (at the terminal)
>
> Your suggesstions or best practices would be very helpful.
>
> Thank You.
>
> Satish MV
> Librarian
> Govt. Engineering College, Hassan
> www.gechassan.ac.in
>
>
> --
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list