2018-10-22         Kerr

Converting Syntax from sqllite to postgresql

I have a sqlLite database which contain in some field sql statement, this sql statement are needed to create some chart in an IOS Application. Now I need to display this chart in a web application which use PostgresqlI need to find a script who convert from sqllite syntax to postgresql syntax things like printf, current date etc... I am asking if there is some ready to use script for this kind of conversion PS : I am using Symfony for the back-end so PHPExample:SELECT r.agent AS gebiet, r.invoiceno ...

 sqlite                     1 answers                     61 view
 2018-10-22         Walker

SQLite delete columns where all values are null?

Is there a way to delete columns with all null values in SQLite? I've got nearly 200 columns and I don't want to list them all. For SQLite you will want to try something along to lines of:DELETE FROM myTable WHERE myColumn IS NULL OR trim(myColumn) = ''; [XXX]

 sqlite                     1 answers                     65 view
 2018-10-22         Ryan

insert new CSV data into sqlite data base

I want to insert new data from a csv file into my database. I would appreciate if any one can help me with a "file.csv" looking like:NO. from to date1 antony bits 1/1/20002 bits antony 1/2/2000and the database has an additional column and looks like this UNO NO. from to date1 1 antony bits 1/1/20002 3 mike antony 1/1/2001the result may probably look like:UNO NO. from to date1 1 antony ...

 sqlite                     1 answers                     74 view
 2018-10-22         Steven

How can I use SQLite to create an index with a create table command?

I am using this code to create a table:db2.CreateTable<Phrase>();Here's the Phrase class:public class Phrase : IPhrase{ [PrimaryKey, NotNull] public string PhraseId { get; set; } public int PhraseNum { get; set; } public int CategoryId { get; set; } public string English { get; set; } public string Romaji { get; set; }}When I hover over the CreateTable it gives a message saying that it creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. Does anyone know how I could for example c...

 sqlite                     2 answers                     77 view
 2018-10-22         Sandra

xamarin sqlite SQLiteException: near ")": syntax error add

I am trying to learn xaml and C# used in Xamarin Forms, and now I want to implement SQLite functionality.I am simply trying to add a value into a SQL table but get the following error:Unhandled Exception:SQLite.SQLiteException: near ")": syntax error occurredMy Database connection interface is as follows:using SQLite;namespace TestSQLite{ public interface IDatabaseConnection { SQLiteAsyncConnection GetConnection(); }}My Android specific Database Connection (iOS is identical) is as follows:using SQLite;using System.IO;using TestSQLite; using Xamarin.Forms;[as...

 sqlite                     1 answers                     76 view
 2018-10-22         Cheryl

How to refresh ListView in previous activity by updating DB in current activity?

I am using Xamarin Android. In the current activity i am having an editing form and on button click event i have an update query in the current activity.private void OnclickSaveDATAButton(object sender, EventArgs e) { var CNICCARDNUMBER = Intent.Extras.GetString("NIC"); var conn = Connection(); conn.BeginTransaction(); var hf = conn.Table<mof>(); var search = hf.Where(x => x.CNICNO == CNICCARDNUMBER).ToList().FirstOrDefault(); //Linq Query var Hofid = Convert.ToString(search.HOFID); var data = conn.Query<hof>...

 sqlite                     1 answers                     82 view
 2018-10-22         August

Can/should I run my web site against a SQLite database?

I'm about to build a new personal blog/portfolio site (which will be written in ASP.NET), and I'm going to run it against a SQLite database. There are a few reasons for this:The site will not be getting a lotof traffic, and from what I've read,SQLite is able to support quite alot of concurrent users for readinganywayI can back up all the contenteasily, just by downloading the dbover FTPI don't have to pay my hostingcompany every month for a hugeSQL2008 database that I'm hardlyusingSo, should I go for it, or is this a crazy idea? I'm not so sure about #2 (what happens if ...

 sqlite                     9 answers                     87 view
 2018-10-22         Sibyl

CoreData fetch request through abstract managed object to concrete managed object

I'm trying to execute a fetch request against a Managed Object Context with a predicate that tests against a keypath that exists in some subclasses of an abstract class.For example here is a part of the object model Library::NSManagedObject - AllMovies::to-many relationship->MovieMovie::NSManagedObject (abstract) - type::String - name::String - mylibrary::to-one relationship->LibraryHorrorMovie::Movie - monster::String - ghosts::BOOLRomanceMovie::Movie - percociouskid::String - hasferret::BOOLIf I set up the following fetch requestNSEntityDescription *entityDescriptio...

 sqlite                     1 answers                     91 view
 2018-10-22         Alfred

SQLite manually set column with insert from a SELECT

I need to create a ban list in my DB. Before you ask, no it's not actually for books, banning books is dumb. To do this, I'm selecting based on criteria already in the table and I'm inserting straight into the Bans table. The problem is, I want to include a manual string for the reason for the ban. I've included some sample data below and the SQL I'm using currently. Sample Data:BooksID | Author | Title1 | Mark Twain | Huckleberry Fin2 | Stephen King | IT3 | Mark Twain | Tom Sawyer4 | Stephen King | Carrie5 | William Shakes...

 sqlite                     1 answers                     97 view
 2018-10-22         Brady

Possibly corrupt sqlite database?

So I have this SQLite3 database. I've noticed a problem that when trying to select songs using the uid column, it does not return any rows; for example:SELECT * FROM songs WHERE uid = 'yzoiaVuicn5ISq1+4DaKGbM3trht/z/ONNm+vA=='Even though a row with the given uid exists. Replacing the '=' with 'LIKE' returns the correct row.I've been able to fix it using:UPDATE songs SET uid = uid || ''Is this a typical case of corrupt db? Or could it be an sqlite bug? How could this have happened? I don't believe this is an indication of corruption rather how = is handled.For example con...

 sqlite                     1 answers                     98 view
 2018-10-22         Griselda

Need some guidance for Sqlite database

I'm trying to create a database which have 8 roles. Id is PK with auto increment. After that those 4 headers, and one more Unitcode(Trying to do auto increment also), person in charge and last is LastTxnNo(Date).Is there any problem if I'm using this all types? After that Is this database can put into android studio and call it out? Is there any problem if I'm using this all types?No (unless you exceed 9223372036854775807 rows as explained below). However, you very likely don't need to use AUTOINCREMENT. AUTOINCREMENT just says that the id must be larger that any other...

 sqlite                     1 answers                     8 view
 2018-10-22         Bing

Data first many to many for EF Core

I have a SQLite DB that I am trying to use with EF Core database first.It has a table of users, and a table of groups that users can belong to, and it has a mapping table because users can belong to multiple groups.-- holds usersCREATE TABLE IF NOT EXISTS user ( _id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT,);-- holds groups users can belong toCREATE TABLE IF NOT EXISTS group ( _id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT,);-- holds user group membershipCREATE TABLE IF NOT EXISTS map_group_user ( group_id INTEGER, user_id INTEGER, UNIQUE (gro...

 sqlite                     1 answers                     102 view
 2018-10-22         Louis

ServiceStack OrmLite using Sqlite64 as memory database results in missing auth tables

I am trying to use Sqlite as a memory database with ServiceStack ORMlite in my unit tests. If I run my tests with SQLite saving to a file, ie. using the connectionstring "Data Source=|DataDirectory|unittest.db;Version=3;", it works fine and auth tables are generated fine by ServiceStacks userRepository.CreateMissingTables(); However, when I try using SQLite as a memory database by using this connectionstring":memory:"I get an exception when sayingSQLite errorno such table: UserAuththe first time I try to fetch a user by doing thisuserRepository.GetUserAuthByUserName(...)Thi...

 sqlite                     1 answers                     82 view
 2018-10-22         Reginald

Aggregation Queries

Is it possible to do the following query in SQLite.Swift without resorting to arbitrary SQL (which I do have working but would prefer to avoid)?select table1.id, sum(table1.col1*table2.col2)from table1, table2where table1.id=table2.idgroup by table1.idI've attempted the following: the SQL (through asSQL()) appears to be correct, but I can't find a way to reference the aggregate column from the returned row.let query = table1.select(id, (table1[column1]*table2[column2]).sum .join(table2, on: table1[id] == table2[id]) .group(id)Can you alias columns some...

 sqlite                     2 answers                     44 view
 2018-10-22         Kirk

SQLite Query decimal places

I have a SQLite DB, and i need to extract some values from DB..I use next query to do itSELECT date, code, model, price, SUM(Units),SUM(Total) FROM VTA_VTAdetalle where code = '07' GROUP BY date, code, price ORDER BY date ASCAll is Ok with the Query but i can't make it to display 3 decimal places.i have used round(value,3) but when sum has 0 at right (1.100) it only display 1.1what i need is that all the time display 1.100.Thanks. printf("%.3f", value) should work for you [XXX]

 sqlite                     1 answers                     88 view
 2018-10-22         Payne

How to fix a DateTime update issue in Xamarin.Forms?

I am using xamarin forms. I have some issue on datetime field in SQLite update.The following Table in I am using:public class DataTable{ [PrimaryKey, AutoIncrement] public int ID { get; set; } public int WorkOrderId { get; set; } public Nullable<DateTime> TargetDateTime { get; set; }}For DatePicker.Date, I am using DatePicker in design with the selection of any date:DateChange dateChange=new DateChange();dateChange.WorkOrderId=1;dateChange.RescheduleDate=DatePicker.Date;AddMwoReschedule(dateChange);This is the update statement, I am using:public List<En...

 sqlite                     1 answers                     15 view

Page 1 of 41  |  Show More Pages:  Top Prev Next Last