[mythtv-users] Storage groups: How to set 'SGweightLocalStarting' to 0?

Brad DerManouelian myth at dermanouelian.com
Wed Oct 8 22:15:08 UTC 2008


On Oct 8, 2008, at 3:07 PM, Jonathan Larson wrote:

>> On Oct 8, 2008, at 2:43 PM, Jonathan Larson wrote:
>>
>>>> I'm new to the SQL CLI, so I didn't even realize there was a
>>>> functional difference between "" and NULL. Should the insert
>>>> command look like this?:
>>>
>>> INSERT settings (value, data, hostname) VALUES
>>> ("SGweightLocalStarting", 0, NULL);
>>
>> Since you already have an entry in your database for
>> SGweightLocalStarting your command should now look like this:
>>
>> UPDATE settings SET hostname = NULL WHERE value =
>> 'SGweightLocalStarting';
>
> Thanks Brad,
>
> I was just asking about the initial INSERT command because I wanted  
> to add this to the wiki and I wanted to make sure it would be  
> accurate.

Gotcha... yeah, that's right if there is no current entry. Personally,  
I'm a fan of REPLACE INTO which will act as an INSERT of the primary  
key doesn't exist and an UPDATE if it does. I think this only works in  
mysql, though so I can see why SQL purists would frown on it.

Bottom line is yeah, that command is correct. ;)

-Brad



More information about the mythtv-users mailing list