NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 46 47 48 49 50 … 93 Next »
SQLite vs Access query differences

 
  • 0 Vote(s) - 0 Average
SQLite vs Access query differences
fla
Offline

Posting Freak

Posts: 804
Threads: 39
Joined: Mar 2006
#1
2007-02-04, 05:33 PM
I've found database queries in XRecord suite that use syntax like:

select top 10 * from ...

SQLite seems to want this syntax:

select * from ... limit 10

Is there a syntax to accomplish this that can work for both SQLite and Access? If not, from within a plugin how can I ask gbpvr which database is currently in use? That way I can use the correct syntax for the current database.
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 102,437
Threads: 743
Joined: Nov 2003
#2
2007-02-04, 08:11 PM
Quote:I've found database queries in XRecord suite that use syntax like:

select top 10 * from ...

SQLite seems to want this syntax:

select * from ... limit 10

Is there a syntax to accomplish this that can work for both SQLite and Access?
No, I dont think there is. I've luckily managed to avoid having to deal with that difference.

These types of difference are a pain in the butt.

Quote:If not, from within a plugin how can I ask gbpvr which database is currently in use? That way I can use the correct syntax for the current database.
You can call DatabaseHelperFactory.getDbProviderFactory().getDbConnectionString() and examine that to determine what database is in use.
fla
Offline

Posting Freak

Posts: 804
Threads: 39
Joined: Mar 2006
#3
2007-02-05, 05:32 PM
Thanks. I put in different syntax for Access and SQLite.

Strange thing. I found that there was already code in XGuide looking at the config.xml's DatabaseConnectionString and searching for "jet". This check works fine to distinguish between Access and SQLite but I wonder why XGuide already had this method since the initial load way before gb-pvr supported SQLite?
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 102,437
Threads: 743
Joined: Nov 2003
#4
2007-02-05, 06:12 PM
Some poeple have used other databases like SQLServer etc, pretty much forever.
psycik
Offline

Posting Freak

Posts: 5,206
Threads: 422
Joined: Sep 2005
#5
2007-02-05, 08:03 PM
hey sub, while on the subject, have you found differences in parameter processing in mdb and sqllite? Found I had to drop Parameter.Add from MDB because it just wasn't finding anything but now it looks like I need it again for SQL-Lite (to handle quotes on works). You ever seen anything like that?
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 102,437
Threads: 743
Joined: Nov 2003
#6
2007-02-05, 08:38 PM
psycik Wrote:hey sub, while on the subject, have you found differences in parameter processing in mdb and sqllite? Found I had to drop Parameter.Add from MDB because it just wasn't finding anything but now it looks like I need it again for SQL-Lite (to handle quotes on works). You ever seen anything like that?
No, I've found them very consistent.

I use Parameters.Add in lots of places.
psycik
Offline

Posting Freak

Posts: 5,206
Threads: 422
Joined: Sep 2005
#7
2007-02-05, 09:07 PM
sub Wrote:No, I've found them very consistent.

I use Parameters.Add in lots of places.

hmm, must have been something I was doing....might have to revisit it.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR 5: When is PIN Required for API Access? pkscout 3 1,878 2020-05-26, 04:45 AM
Last Post: sub
  API access to artwork and deleting recordings cncb 29 12,450 2016-11-06, 02:20 AM
Last Post: mvallevand
  Need help with some real-world SQL query results bgowland 17 4,030 2013-02-01, 02:12 PM
Last Post: mvallevand
  Access 'Stay on top' setting from a plugin? McBainUK 5 1,723 2011-11-07, 04:43 PM
Last Post: sub
  Access ImportHDPVRChannelsForm mvallevand 62 9,414 2011-08-09, 03:37 AM
Last Post: mvallevand
  Access to Schedules inside standalone progs dero 1 1,027 2008-12-09, 12:03 PM
Last Post: dero
  Linking gbpvr.db3 to Access 2003: get readonly tables Khurram 5 3,245 2008-09-11, 08:35 AM
Last Post: Khurram
  Access to FSE switch idkpmiller 12 3,008 2008-07-05, 04:01 PM
Last Post: whurlston
  SkipTool, do you use the GBPVR SQLite database? mkenyon2 1 1,192 2008-04-21, 07:30 PM
Last Post: pastro
  Access DB and DateTime idkpmiller 5 1,730 2008-04-14, 10:37 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