Advertisement
Guest User

Untitled

a guest
Nov 1st, 2011
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. Code gets all the chanids to be operated on:
  2.  
  3. query.prepare( "SELECT chanid FROM channel WHERE (chanid >= :STARTCHANID )"
  4. " ORDER BY chanid LIMIT :NUMCHAN" );
  5.  
  6. Then runs this to get the guide data:
  7.  
  8. QString querystr = QString(
  9. "SELECT DISTINCT program.chanid, program.starttime, program.endtime, "
  10. " program.title, program.subtitle, program.description, "
  11. " program.category, channel.channum, channel.callsign, "
  12. " channel.name, program.previouslyshown, channel.commmethod, "
  13. " channel.outputfilters, program.seriesid, program.programid, "
  14. " program.airdate, program.stars, program.originalairdate, "
  15. " program.category_type, oldrecstatus.recordid, "
  16. " oldrecstatus.rectype, oldrecstatus.recstatus, "
  17. " oldrecstatus.findid, program.videoprop+0, program.audioprop+0, "
  18. " program.subtitletypes+0 "
  19. "FROM program "
  20. "LEFT JOIN channel ON program.chanid = channel.chanid "
  21. "LEFT JOIN oldrecorded AS oldrecstatus ON "
  22. " oldrecstatus.future = 0 AND "
  23. " program.title = oldrecstatus.title AND "
  24. " channel.callsign = oldrecstatus.station AND "
  25. " program.starttime = oldrecstatus.starttime "
  26. ) + sql;
  27.  
  28. and appends this as "sql":
  29.  
  30. QString sSQL = "WHERE program.chanid >= :StartChanId "
  31. "AND program.chanid <= :EndChanId "
  32. "AND program.endtime >= :StartDate "
  33. "AND program.starttime <= :EndDate "
  34. "GROUP BY program.starttime, channel.channum, "
  35. "channel.callsign, program.title "
  36. "ORDER BY program.chanid ";
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement