Все вопросы: [sqlite]

996 вопросов

1
голосов
5ответов
105 просмотров

Is there a way to tell whether a function is getting executed in a unittest?

I'm using a config file to get the info for my database. It always gets the hostname and then figures out what database options to use from this config file. I want to be able to tell if I'm inside a unittest here and use the in memory sqlite database instead. Is there a way to tell at that po...

915
голосов
22ответов
462007 просмотров

How do I check in SQLite whether a table exists?

How do I, reliably, check in SQLite, whether a particular user table exists? I am not asking for unreliable ways like checking if a "select *" on the table returned an error or not (is this even a good idea?). The reason is like this: In my program, I need to create and then populate some tabl...

2
голосов
4ответов
8585 просмотров

SQL Client on Android

I'm developing on Android and currently haev various methods which manage my database in a convenient class. What I'd ideally like, though, is a (preferably GUI) sql client that would allow me to view the contents of a different apps' DB. Eg: I install my own app (App1). It creates and uses a ...

1
голосов
2ответов
519 просмотров

iPhone: Sharing data between native and webapp

I would need to share data (not necessarily a large amount) between a native iPhone app, and a safari/webkit javascript app... Do you know how this could be done ? I considered sqlite.. But it seems an application can only read/write inside its own bundle (so, not in the webkit databases directo...

8
голосов
2ответов
4044 просмотров

How do I list all the available views of a particular table in SQLite?

I want to access all the particular views of any particular table in Sqlite . I know I can get the list of all the available tables in the database using sqlite_master SELECT name from sqlite_master WHERE type='table'; And the list of all the available views using SELECT name from sqlite_m...

0
голосов
1ответов
1914 просмотров

Why does SQLite complain about the syntax of my prepared statement?

I'm having trouble getting a prepared statement in sqlite3 to work. I'm working with Perl and the Perl DBD framework. Below is the code I use: #This is a function I have defined sub query([email protected]){ my $st = $db->prepare(shift); $st->execute(@_); } #And it is used like so query("UPDATE ...

0
голосов
1ответов
2788 просмотров

Synchronize Core Data with SQL or MySQL Via SQLite

I am trying to build an iPhone application using core data's built in table management. I want synchronize the data with an MSSQL or MySQL database. Core data is compatible with SQLite so I thought it might work as a bridge. Can anyone think of how one might achieve this functionality?

3
голосов
3ответов
2296 просмотров

Can I get the table names from an SQL query with Perl's DBI?

I am writing small snippets in Perl and DBI (SQLite yay!) I would like to log some specific queries to text files having the same filename as that of the table name(s) on which the query is run. Here is the code I use to dump results to a text file : sub dumpResultsToFile { my ( $query ) =...

1
голосов
3ответов
3067 просмотров

Insert into SQLite with variables using javascript

I am developing an extension for Firefox and I have created SQLite DB. When inserting values into the table I get an error message: Error: Permission denied for http://en.wikipedia.org to call method UnnamedClass.toString on <>. The string values to be inserted are stored in a varia...

0
голосов
1ответов
4783 просмотров

C# SQLite error Insufficient parameters supplied to the command

I get the error SQLite error Insufficient parameters supplied to the command when running an insert statement in my program. However, I've got it narrowed down to it will only occur if I try to insert data into two different tables in succession. Meaning I insert data into one and everything in...

5
голосов
2ответов
3306 просмотров

sqlite3 and cursor.description

When using the sqlite3 module in python, all elements of cursor.description except the column names are set to None, so this tuple cannot be used to find the column types for a query result (unlike other DB-API compliant modules). Is the only way to get the types of the columns to use pragma tabl...

2
голосов
1ответов
5260 просмотров

SQLite INSERT Statement

I have created the following insert method which works fairly well but I know it could be more efficient. Could someone show me how to convert this method to use parameters and/or increase its efficiency? public static void SQLiteTableINSERT(string tableName) { int colCount = 0; using (...

0
голосов
1ответов
930 просмотров

SQLite gurus: how can I display very detailed metadata about a file?

I have a situation where a simple query against a table is returning incorrect values in Flex, but not in other GUI front-ends to SQLite. select title from ttl where ttl.ttl = 140 // ttl is also the column name of the PK column is returning the title that belongs to the row whose PK = 1400. ...

0
голосов
2ответов
557 просмотров

SQLite subquery not working in PHP

I'm working on a simple voting system, using php and sqlite. I prebuild a whole scenario and tested it in the sqlite commandline, where it worked nicely. But one query, which should return all possible answers of a poll and the users that voted for it, doesn't work anymore... Tables: CREATE TAB...

4
голосов
2ответов
1563 просмотров

Prepared statements and the IN expression

I have a database where users can search for records that have one or more of a list of items. I'm using IN to do the search, but I can't get IN to work with prepared statements. This is what I've tried: SELECT * FROM tbl1 WHERE col IN (?) But the prepared statement treats the list of items I ...

0
голосов
1ответов
2393 просмотров

C# SQLite Bulk Insert or Parameterized Insert Efficenecy

I have a DataTable which I want to save to a SQLite Database Table. Here is my dilemma, I don't know which way to go. At most the DataTable would contain 65,000 rows and probably 12 columns. So, would it be faster to save the DataTable to a CSV file and then Bulk Insert it into SQLite (which...

5
голосов
2ответов
12670 просмотров

How can I delete data with specific row number (sqlite)

I have a table people (name, address, phone), my table have 2000+ rows. I want to delete 1000 rows. How's about the query?

1
голосов
3ответов
3202 просмотров

When using py2exe, PyQt application cannot load SQlite database

My PyQt application works fine when running on Linux, when in my Windows build environment, or frozen on the machine where it was build with py2exe. But after moving the frozen executable and its supporting files to another machine it can't load the database driver. It worked fine when I had Pyt...

1
голосов
2ответов
13858 просмотров

C# Dynamically Add Columns to table in Database

I am still learning quite a bit about programming so this may be an obvious question but I am in the process of writing a program where a user can import an excel file with no column constraints (meaning each excel file could have a different number of columns and so on). What I want to do is be...

0
голосов
3ответов
4724 просмотров

Simple Forum Engine with Support for SQLite

I need a simple forum backed by a SQLite 3 database which I can easily integrate into my new project, something in the line of Vanilla forum. What do you suggest?

2
голосов
1ответов
971 просмотров

How to use SQLite database in JME?

How to use SQLite database in JME?

4
голосов
1ответов
1241 просмотров

Should I use a flat file or database for storing quotes for a random quotations app on Android?

I am developing an app on Android that will randomly pick and display an inspirational quotation (or verse) from a large collection of quotations. On Android I can choose between a flat file and an SQLite database. The app should satisfy the following conditions: Be scalable to 10^6 quotation...

7
голосов
4ответов
8613 просмотров

SQLite: Combine SELECT and DELETE in one statement

I need to run two statements like so: Select amount from db where ID=5 DELETE from db where ID=5 Currently I prepare and run two different statements. I wonder if there is a way to combine it in one statement. Basically all I need to do is to get an amount column from the row before it is ...

10
голосов
3ответов
9383 просмотров

Will I run into performance issues if I use a blob field as primary key in SQLite?

I have a sqlite database where all the primary keys are GUIDs. Currently they are stored as fixed length strings but I want to store them as blobs because it simplifies the code for storing and retrieving data. I converted part of the database and everything is functioning as expected. However...

6
голосов
3ответов
7403 просмотров

How to speed up query with multiple INNER JOINs

I've been toying around with switching from ms-access files to SQLite files for my simple database needs; for the usual reasons: smaller file size, less overhead, open source, etc. One thing that is preventing me from making the switch is what seems to be a lack of speed in SQLite. For simple S...

0
голосов
1ответов
1076 просмотров

iPhone + sqlite3 + not in query

I want to write a in query in my code. My query is something like: SELECT PlayerID, PlayerName, Type, BattingSkills, BallingSkills from Player where TeamId = 6 and PlayerID not in (163,174) order by battingSkills desc limit 4 In my xCode I am writing the query like below const cha...

9
голосов
1ответов
19794 просмотров

How to copy data between two tables in SQLite?

I have two table with different column like this: table1 ( _id, title, name, number, address ) table2 ( _id, phone, name, address ) How can I copy data 'name', 'address' from table1 to table2. And my question have two situation: First: table1, table2 in ...

0
голосов
2ответов
1998 просмотров

What is causing this propel error?

I'm geting this error in propel when I run my app: PropelException: Unable to open PDO connection [wrapped: SQLSTATE[HY000] [14] unable to open database file] I've tried everything I can think of but can't figure out what is causing the problem. my build.properties is: propel.project = Link...

1
голосов
2ответов
2163 просмотров

SQLite Access in Objective-C and Cocoa

I am in the process of learning Objective-C for Mac/iPhone development and decided to try and write something useful without looking at the bible (Aaron Hillegass: Cocoa Programming 3rd Edition). I'm writing a simple puzzle game. The data that defines the levels is stored as a string in a SQLite...

3
голосов
1ответов
2283 просмотров

Ruby on Rails SQLite problem on Windows 7 x64

When I try to do db:create on sqlite database with this db config using Windows 7 x64 development: adapter: sqlite3 database: db/development.sqlite3 timeout: 5000 I get this, kinda funny error unknown error C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize' C:/Ruby/lib/ruby/1.8/dl/imp...