I have a .sql file with insert statements in C:\sqldata\MyData.sql. I need to insert data into sqlite database in my Android App using this .sql file.   How could I do this?
1285
If your application requires a database and it comes with built in data, what is the best way to ship that application? Should I:   Precreate the SQLite database and include it in the .apk? Include the SQL commands with the application and have it create the database and insert the data on first use?   The drawbacks I see are:   Possible SQLite version mismatches might cause problems and I currently don't know where the database should go and how to access it. It may take a really long time to create and populate the database on the device.   Any suggestions? Pointers to the documentation regarding any issues would be greatly appreciated.
18446
For some reason I can't find a way to get the equivalents of sqlite's interactive shell commands:  .tables .dump   using the Python sqlite3 API.   Is there anything like that?
87815
I've been given a Sybase .db file by a client and I need to import that into a new SQL Server database so that I may see the data as well as the tables and their relationships, any ideas on how that might be done shall be really appreciated :)
15501
Anyone know a quick easy way to migrate a SQLite3 database to MySQL?
58209
What's the best method to pass parameters to SQLCommand? You can do:  cmd.Parameters.Add("@Name", SqlDbType.VarChar, 20).Value = "Bob";   or  cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = "Bob";   or  cmd.Parameters.Add("@Name").Value = "Bob";   It seems like the first one might be somehow "better" either performance-wise or error checking-wise. But I would like to know more definitively.
71370
I was trying to look for an answer of mine earlier and did a search like this:  user:me SQLite RunInTransaction   The above found nothing. So I changed it to  user:me SQLite   Which found a bunch of things. I dug through the results and saw this snippet for :     From my experience, wrapping as many database calls as possible into a transaction speeds things up quite a bit: using (var db = new SQLiteConnection(dbPath)) { db.RunInTransaction(() => { …    Notice that the snippet contains both "SQLite" and "RunInTransaction". In looking at the post itself I noticed "SQLite" was in the question title and in my answer as code. I also noticed that "RunInTransaction" is only in my answer in code.  I looked at meta and saw , which says I need to prefix any code with code:, so I tried:  user:me SQLite code:RunInTransaction user:me code:SQLite code:RunInTransaction   None of the above returned any results.  I also found  on meta which says I can search for code like this (without the code: prefix):        So I tried:  SQLite RunInTransaction "SQLite RunInTransaction"   The first did not return my answer. The second did not return any results.  So my question:  How do I properly search for , that has both "SQLite" and "RunInTransaction" in the post?
20284
I'm supposed to test a web application for SQL injections. I'm new to this type of security testing and I'd like to get some tips on the matter. Are there any best practices or do I simply search on the Internet for the most common SQL injections and try them out on my application?  I hope some guidance would be profitable for other newbies like me, so please, help me complete the following lists:   List of "places" in the application to be tested:   username  password(s)  e-mail search field  text fields any other fields that are available to the user  List of tests to be performed:   ...?    Thanks!
13312
while working with webservice quotes are not inserting may i know what i have to do. my code is     for(integer l=0;l&lt;reqquotes;l++){          qu = new Quote();          qu.Name = qName;          //opp.CloseDate =system.today();           qList.add(qu);             insert oppList;          insert qList;     }
41779
I m trying to understand where we use following Database.Methods. I know if we want to insert a record to an object we use DML Statement. What i want to know is why/where we use Database. methods. It might be silly question. Database.saveResults Database.insert Database.query Database.Query Database.error   really appreciate the inputs. Thanks a ton in advance.
61981
Translation: Hello, I have a problem installing version 1.0.8. The following error message appears:  The entry point for the procedure sqlite3_open_v2 cannot be found in the dynamic link library sqlite3.dll  [The next sentence is ungrammatical in the original and therefore its translation is in doubt.] Previously I had version 1.7 Wroclaw, which I uninstalled before installing the new one. Thank you for your help. Original Bonjour, J'ai un problème pour installer la version 1.0.8, le message d'erreur suivant apparait:  Le point d'entrée de procédure sqlite3_open_v2 est introuvable dans la bibliothèque de liens dynamiques sqlite3.dll  J'avais avant d'installer la version 1.7 Wroclaw que j'ai désinstaller pour installer la nouvelle. Merci pour votre aide.
79375
I'm trying to insert data from an external table. INSERT /*+ ignore_row_on_dupkey_index ( consruct ( construct_id ) ) */ INTO construct        (construct_id,       n_term ,       enz_name,       c_term,       cpp,       mutations,       mw_kda) SELECT *     FROM EXTERNAL ((       construct_id NUMBER(10),       n_term VARCHAR2 (50),       enz_name VARCHAR2 (50),       c_term VARCHAR2 (50),       cpp VARCHAR2 (50),       mutations VARCHAR2 (50),       mw_kda NUMBER (7,3))      TYPE ORACLE_LOADER     DEFAULT DIRECTORY data_to_input     ACCESS PARAMETERS (         RECORDS DELIMITED BY NEWLINE         SKIP 1         BADFILE bad_files:'badflie_insert_into_construct_from_construct.bad'         FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '&quot;'         MISSING FIELD VALUES ARE NULL          )      LOCATION ('CONSTRUCT.CSV')     REJECT LIMIT UNLIMITED) ext          WHERE NOT EXISTS (         SELECT * FROM construct c         WHERE c.n_term = ext.n_term         AND c.enz_name = ext.enz_name         AND c.c_term = ext.c_term         AND c.cpp = ext.cpp         AND c.mutations = ext.mutations     );  But now i get this error: Error at Command Line : 171 Column : 7 Error report - SQL Error: ORA-00957: duplicate column name 00957. 00000 -  &quot;duplicate column name&quot;  Line 171 is the last line of this part INSERT /*+ ignore_row_on_dupkey_index ( consruct ( construct_id ) ) */ INTO construct        (construct_id,       n_term ,       enz_name,       c_term,       cpp,       mutations,       mw_kda)  Which is clearly not a duplicate column. If I do: INSERT /*+ ignore_row_on_dupkey_index ( consruct ( construct_id ) ) */ INTO construct      (construct_id,      n_term,      enz_name,      c_term,      cpp,      mutations,      mw_kda) SELECT *     FROM EXTERNAL ((       ext.construct_id NUMBER (10),       ext.n_term VARCHAR2 (50),       ext.enz_name VARCHAR2 (50),       ext.c_term VARCHAR2 (50),       ext.cpp VARCHAR2 (50),       ext.mutations VARCHAR2 (50),       ext.mw_kda NUMBER (7,3))      TYPE ORACLE_LOADER     DEFAULT DIRECTORY data_to_input     ACCESS PARAMETERS (         RECORDS DELIMITED BY NEWLINE         SKIP 1         BADFILE bad_files:'badflie_insert_into_construct_from_construct.bad'         FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '&quot;'         MISSING FIELD VALUES ARE NULL          )      LOCATION ('CONSTRUCT.CSV')     REJECT LIMIT UNLIMITED) ext          WHERE NOT EXISTS (         SELECT * FROM construct c         WHERE c.n_term = ext.n_term         AND c.enz_name = ext.enz_name         AND c.c_term = ext.c_term         AND c.cpp = ext.cpp         AND c.mutations = ext.mutations     );  I get Error at Command Line : 174 Column : 10 Error report - SQL Error: ORA-00902: invalid datatype 00902. 00000 -  &quot;invalid datatype&quot;  Line 171 is ext.construct_id NUMBER (10),
16709
In my sql server 2008, after running the query the data return is very huge say in millions. I tried copying but it gives an exception sql memory error. Can you let us know how can i copy the entire data and paste it into excel.  I don't want to export it to txt file as the data is not getting aligned. So i want to manually copy and paste it into excel. Please let me know the solution for thhis
113404
Very new to any form of code. Attempting to run a script in VBA that will pull data from an access database using SQL and put it into an excel spreadsheet. Code is similar to below. Runs clean but I don't know how to use the data it is pulling. Thanks in advance.   Sub Get_Data() Dim cn As Object Dim rs As Object Dim strFile As String Dim strCon As String Dim strSQL, strInput As String  strFile = "S:\Location.Database.accdb"  strCon = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" &amp; strFile  Set cn = CreateObject("ADODB.Connection") cn.Open strCon  strInput = InputBox("Input Desired Name")  strSQL = "SELECT NAME, Location WHERE NAME =""'strInput'"";"  cn.Execute strSQL  cn.Close Set cn = Nothing  End Sub
59365
Could you recommend a lightweight SQL database which doesn't require installation on a client computer to work and could be accessed easily from .NET application? Only basic SQL capabilities are needed.  Now I am using Access database in simple projects and distribute .MDB and .EXE files together. Looking for any alternatives.
1422
I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program.  These statements need to be separated by GO statements, but SqlCommand.ExecuteNonQuery() does not like GO statements. My solution, which I suppose I'll post for reference, was to split the SQL string on GO lines, and execute each batch separately.  Is there an easier/better way?
39594
I'm trying to find the best way to save the state of a simple application. From a DB point-of-view there are 4/5 tables with date fields and relationships off course.  Because the app is simple, and I want the user to have the option of moving the data around (usb pen, dropbox, etc), I wanted to put all data in a single file.  What is the best way/lib to do this?  XML usually is the best format for this (readability &amp; openness), but I haven't found any great lib for this without doing SAX/DOM.
80631
What do the brackets do in a sql statement?  For example, in the statement:    insert into table1 ([columnname1], columnname2) values (val1, val2)  Also, what does it do if the table name is in brackets?