[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread R.Smith
On 2015-03-07 10:55 PM, Dave wrote: > Ryan, > I have been to the link below but was under the impression that SQL > and SQLite are two different things so I usually just look up SQLite > help. I can do simple queries as I did the Kahn Academy training. :-) > Most of the queries are straight

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread R.Smith
On 2015-03-07 10:32 PM, Dave wrote: > Ryan, > Thanks for your reply. As I mention in my last post: > > I got it sorted out I ended up with this using my SQLite Expert > Professional (if it matters). There are a lot of great tools available for SQLite (possibly moreso than any other DB

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread R.Smith
On 2015-03-07 06:42 PM, Dave wrote: > I am fairly new at this although I have wanted to learn and tried > again and again...But I have a problem. I created a database and > probably did it wrong and I am trying to fix it. I made a database > with 7 tables in it all with a primary key and a

[sqlite] restructuring databases (was Re: Can I copy one column of data to another table?)

2015-03-07 Thread Jim Callahan
The appropriate structure of the database depends on whether you need the tables spread out into multiple tables for consistency ("one fact in one location") -- a process called "normalization or whether you want all the data in one table for ease of querying ("denormalization"). Transactional

[sqlite] error "attempt to write a readonly database"

2015-03-07 Thread Paul Sanderson
Thanks - you pointed me in the right direction. Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit -Forensic Toolkit for SQLite email from a work address for a fully

[sqlite] error "attempt to write a readonly database"

2015-03-07 Thread Simon Slavin
On 7 Mar 2015, at 7:31pm, Paul Sanderson wrote: > I'm an idiot - dev environment was running as admin - so nothing else > could write to DB out side of this as a normal users. A mistake we've all made. Glad you figured it out. Simon.

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Paul Sanderson
Dave I'm not sure exactly what you are trying to do from your description - the schema of the tables you have and those that you want may help. But as a general idea you might be able to use something along the lines of create table newtable as select x, y, z from oldtable More info here:

[sqlite] error "attempt to write a readonly database"

2015-03-07 Thread Paul Sanderson
Thanks Simon I'm an idiot - dev environment was running as admin - so nothing else could write to DB out side of this as a normal users. Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786

[sqlite] Optimization Opportunity?

2015-03-07 Thread Wolfgang Enzinger
Hi dev team, not sure if this is actually a useful hint, but ... CREATE TABLE a(a1 INTEGER PRIMARY KEY); INSERT INTO a VALUES (1),(2),(3); CREATE TABLE b(a1 INTEGER REFERENCES a(a1),b1 INTEGER PRIMARY KEY); INSERT INTO b VALUES (1,11),(2,22),(3,33); CREATE UNIQUE INDEX b_ui ON b(a1,b1); CREATE

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Simon Slavin
On 7 Mar 2015, at 4:42pm, Dave wrote: > I am fairly new at this although I have wanted to learn and tried again and > again...But I have a problem. I created a database and probably did it wrong > and I am trying to fix it. I made a database with 7 tables in it all with a > primary key and a

[sqlite] error "attempt to write a readonly database"

2015-03-07 Thread Simon Slavin
On 7 Mar 2015, at 4:42pm, Paul Sanderson wrote: > I have a database I have created and populated with various tables and data. > > I now want to create a new table and I get the above error. > > command is create table testtab (id int, data blob); If you are not already doing so, try using

[sqlite] restructuring databases (was Re: Can I copy one column of data to another table?)

2015-03-07 Thread Darren Duncan
On 2015-03-07 9:59 AM, Simon Slavin wrote: > On 7 Mar 2015, at 4:42pm, Dave wrote: > >> I am fairly new at this although I have wanted to learn and tried again and >> again...But I have a problem. I created a database and probably did it wrong >> and I am trying to fix it. I made a database

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
Ryan, Thanks for the added info. I will be happy to take this off-list for any further pointers if they may be best suited there . I don't want to be the guy that causes any trouble as a noob. :-) I will touch base with you off -list soon but maybe in a day or so. I appreciate the help.

[sqlite] error "attempt to write a readonly database"

2015-03-07 Thread Paul Sanderson
I have a database I have created and populated with various tables and data. I now want to create a new table and I get the above error. command is create table testtab (id int, data blob); I am using sqlite 3.8.6 command line to try and create the table (although the DB was created using

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
Ryan, I have been to the link below but was under the impression that SQL and SQLite are two different things so I usually just look up SQLite help. I can do simple queries as I did the Kahn Academy training. :-) Most of the queries are straight forward but this one seemed a little tougher.

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
On 3/7/2015 1:42 PM, R.Smith wrote: > > Hi Dave, you did not give us the schemata so I'm going to guess you > have tables like this: > > CEATE TABLE T1("ID" INT PRIMARY KEY, "val1" TEXT); > CEATE TABLE T2("ID" INT PRIMARY KEY, "val2" TEXT); > CEATE TABLE T3("ID" INT PRIMARY KEY, "val3" TEXT);

[sqlite] fts4 support in distributions of SQLite?

2015-03-07 Thread Clemens Ladisch
Darren Spruell wrote: > My few test systems show that support for fts4 is present, but > I'm trying to learn if it's a reasonable assumption that the usual > SQLite build/deployment "out there" includes support for the feature. The recommended way to use SQLite is to compile sqlite3.c directly

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Igor Tandetnik
On 3/7/2015 11:42 AM, Dave wrote: > Now when trying to use the database I see that I should have made 1 > table with all the related data (I think) and am trying to copy one > column of data at a time to the "main" table. Can that be done and if so > how? The data in all the columns has to line

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
Ryan, Thanks for your reply. As I mention in my last post: I got it sorted out I ended up with this using my SQLite Expert Professional (if it matters). update tableB set column2 = (select column2 from tableA where tableA.rowid = tableB.rowid) Of course I did not figure that out myself and

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
Hi Paul, I got it sorted out I ended up with this using my SQLite Expert Professional (if it matters). update tableB set column2 = (select column2 from tableA where tableA.rowid = tableB.rowid) Of course I did not figure that out myself and asked for help on the forum of the software and

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
Thanks Simon. If I can't figure that out I will just type all the data in manually and learn from the school of hard knocks. :-) I googles it and it seems that I am not the only one that has tried to do this and it seems like it should be easy. I think in regular SQL it might be easier. Oh

[sqlite] fts4 support in distributions of SQLite?

2015-03-07 Thread Simon Slavin
On 7 Mar 2015, at 5:42am, Darren Spruell wrote: > It uses SQLite and the records have a > comments field for which I'd like to use a fts4 vtable to enable > search. It sounds like you're using fts4 for just one function and you may be able to do without fts entirely. Here are three questions

[sqlite] Can I copy one column of data to another table?

2015-03-07 Thread Dave
I am fairly new at this although I have wanted to learn and tried again and again...But I have a problem. I created a database and probably did it wrong and I am trying to fix it. I made a database with 7 tables in it all with a primary key and a record ID that matches the primary key. Now