PrintLogo

Updating Tables with SQL




As we mentioned in Using MCJ to Practice SQL Commands, the MCJ has the ability to run queries directly. We had a bunch of configuration and compile options that now should run with type for the build tab2. We can change all of the chroot types to prechroot with the SQL command:

update journal
set type = 'prechroot'
where type= 'chroot'

SQL Update

The types are now all changed. We can verify with the SQL command:

select * from journal where realm='mcjbuildtab2'



SQL Update

The dates are all off. It has been almost two years since we have been able to do much with the base NoNIC OS. We need to change all of the dates to today, and can do this with the SQL command:

update journal
set date='2008-07-18'



SQL Update

We had some types that were others we wanted changed to prechroot that were another type, so we can change all types with the same realm by running this SQL command:

update journal
set type= 'prechroot'
where realm='mcjbuildtab2'



SQL Update

Looks good:

SQL Update





This article comes from NetAdminTools:
http://www.netadmintools.com/

The URL for this story is:
http://www.netadmintools.com/art588.html

Copyright 1997-2008 NetAdminTools.com. Read our Terms of Use.