NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 15 16 17 18 19 … 159 Next »
May I borrow an SQL'ers brain for a moment??

 
  • 0 Vote(s) - 0 Average
May I borrow an SQL'ers brain for a moment??
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#1
2014-01-08, 11:21 AM
Having just setup my device in npvr with 150 odd blaster channel numbers I would like them in that order in the EPG rather than the random order that they took from importing the EPG....

In effect what I would like is the channel table number field replaced with the channel_mapping table channel_source_number where the channel_mapping channel_oid is the same as the channel oid

I suspect it is easy to do but all my attempts so far have failed dismally...... ;(
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#2
2014-01-08, 01:14 PM (This post was last modified: 2014-01-08, 01:17 PM by Graham.)
Using the UPDATE ... WHERE EXISTS example from http://www.techonthenet.com/sql/update.php

We get

update channel
set channel.number = (select channel.source_number from channel_mapping where channel.oid = channel_mapping.Channel.oid)
where exists (select channel.source_number from channel_mapping where channel.oid = channel_mapping.Channel.oid);

The "where exists" may be redundant because there is a one to one match of rows in the two tables ... but it can't hurt.

I don't claim to be a SQL'er ... but I think this is okay.

I am on my way to your house to stand over you and make sure that you take six backups before before you attempt any of this.

PS I guess that you know that you can change the channel number in the Channel Details dialog box shown at http://www.nextpvr.com/nwiki/pmwiki.php?...n.Channels . Apologies if I am preaching to the choir.
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#3
2014-01-08, 04:31 PM
Thanks for that Graham, syntax error at the moment, but I now have enough to go on and incentive to have a read of the link you gave.
My searching only seems to find docs with unhelpful alphabetical listings rather than real examples.

I did know of the abiluty to change the channel nr in npvr, the problem being there are 150-odd of them and you can't see teh device channel numbers at the same time, so I am scrolling up and down like a madthing an up to date channel list. http://www.wildsat.com/

A wishlist item for both device and settings config pages please sub - ability to sort alphabetically Wink as this would speed things up no end.
martint123
Offline

Posting Freak

UK, East Yorkshire
Posts: 4,658
Threads: 208
Joined: Nov 2005
#4
2014-01-10, 04:59 PM
[quote=Graham]

A slight tweak and job done by the looks of it. Thanks for getting me in the right area Graham.

UPDATE channel
SET number = (SELECT channel_mapping.channel_source_number FROM channel_mapping WHERE channel_mapping.channel_oid = channel.oid)
WHERE EXISTS (SELECT channel_mapping.channel_source_number FROM channel_mapping WHERE channel_mapping.channel_oid = channel.oid);
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Smile moment Bobins 2 1,528 2020-05-17, 04:26 PM
Last Post: sub
  I need to borrow (or buy) a Nebula PCI card bgowland 4 2,087 2006-04-09, 11:05 PM
Last Post: bgowland

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode