NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 14 15 16 17 18 … 93 Next »
Merged database queries

 
  • 0 Vote(s) - 0 Average
Merged database queries
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#1
2011-06-26, 09:29 PM
I want to be to able to filter out on specific channels in a sql call and I was wondering if the channel tables for merged channels repeats the name and channel number repeated for all the merged channels and just the channel.oid is different

As an example a query that works with unmerged data would be

Code:
select scheduled_recording.name, event_details, channel.number
from scheduled_recording, channel
where scheduled_recording.channel_oid = channel.oid
and channel.number  not in (3, 7)

Would this work the same with merged channels?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2011-06-26, 09:35 PM
Assuming that query works on normal channels, then it should also work on channels that have been merged. When you have merged channels, then still only have a single entry in the CHANNEL table. The only difference is they can have more than one entry per channel in the CHANNEL_MAPPING table.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#3
2011-06-26, 09:41 PM
So maybe I made a wrong assumption is

scheduled_recording.channel_oid = channel.oid or channel_mapping.channel_oid

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2011-06-26, 09:47 PM
scheduled_recording.channel_oid = channel.oid. ie, you want to record a specific channel, for example CNN. This particular field doesnt relat to the device that'll do the recording.

scheduled_recording.capture_source_oid indirectly leads to a channel_mapping entry at recording time (when it looks for a channel mapping with that capture_source_oid and channel_oid). ie, looking for a channel mapping on that source that'll give the device the info it needs to record that particular channel.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,767
Threads: 954
Joined: May 2006
#5
2011-06-26, 09:56 PM
Ok, thanks, I will give the code a try and see how it works in the wild.


Martin
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Merged channels mvallevand 3 2,597 2014-04-11, 04:55 AM
Last Post: mvallevand
  Delete recordings from database but not from disk? spinnaker 8 3,744 2013-10-26, 10:51 PM
Last Post: spinnaker
  trying to fake npvr database for unit tests reven 3 2,233 2013-05-20, 08:53 AM
Last Post: reven
  NPVR database questions mvallevand 25 9,772 2011-01-06, 12:58 AM
Last Post: jksmurf
  NPVR database - why so stringy with the fields?? :0) carpeVideo 4 1,984 2010-09-21, 01:48 AM
Last Post: sub
  NPVR Database connection ralphy 4 2,427 2010-09-15, 12:09 AM
Last Post: sub
  How can I reset the Music plugin's database? mkenyon2 1 1,879 2009-10-15, 06:43 PM
Last Post: psycik
  SheduleRecording() locks database cb123 3 2,474 2009-02-14, 06:33 PM
Last Post: sub
  accessing database fluffykeith 3 1,851 2008-07-09, 05:43 PM
Last Post: sub
  SQL database and backticks idkpmiller 6 4,065 2008-05-26, 08:32 AM
Last Post: idkpmiller

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

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

Linear Mode
Threaded Mode