[sqlite] fill blank fields
using this exampleUPDATE Aircraft SET CN = '*' where (CN = '' or CN is null) and MyPrimaryKey='xyz';can you substitute another column name iso MyPrimaryKey if the column you wantedto reference to wasn't the primary key, for example the field in a column named AT,as in:UPDATE Aircraft SET CN = '*' where (CN = '' or CN is null) and AT='xyz';mtia Mark CDN Mark wrote: > what I need to do is replace blank fields in a specific row, sort of > a double where where statement as in: > > UPDATE Aircraft SET CN = '*' where CN = '' or CN is null where (primary key) > is xyz UPDATE Aircraft SET CN = '*' where (CN = '' or CN is null) and MyPrimaryKey='xyz'; -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] fill blank fields
hi there, thanks Simon and Igor for your help on this a few weeks ago, but I need an addition to UPDATE Aircraft SET CN = '*' where CN = '' or CN is null; what I need to do is replace blank fields in a specific row, sort of a double where where statement as in: UPDATE Aircraft SET CN = '*' where CN = '' or CN is null where (primary key) is xyz What I'm trying to do is update a database, but the users also have an automated update system that apparently if it finds any blank fields in the row, updates the whole row, thereby overwriting what I've replaced. I thought if I could at least replace the blank fields with something, it should prevent the overwriting. I don't know which fields are blank, every user will be different, so the plan was to update the fields I want to, insert text/symbol into the blank fields and leave the others alone. I realize that because I don't know which fields are empty/blank I'm going to have to create a statement for every column I'm not updating to, there are only 10 columns altogether and I'll typically be updating to at least 5 of them. hope this is clear and mtia Mark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] fill in blank fileds
Hi Igor, worked using SQLite Database browser/execute SQL but didn't work using an .sql file which is the way I would be doing it. Tried it again and it did work using sql file, thanks for your help ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] fill in blank fileds
Hi Simon, ran the first example, came back with lots of lines, second test with the just the 10 returned 9 lines as 0: the second line as 2:3832, don't understand the purpose/meaning of this Hi Igor, not checking for, want to fill in/replace blank or null fields with at least one character ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] fill in blank fileds
Hi, looking for help please. Database is a db3, fields are varchar. The problem is that a necessary updating service for this database looks for 'blank' fields, of which there are many, and if there are any, updates ALL the info for that record. The problem is that I want to update with correct info and don't want it overwrittten. I thought if I could at least insert a sinlge character it would stop the auto update. I tried using a statement UPDATE Aircraft SET CN = "*" where CN = ""; as a test which worked, but not for all records. I don't know if the blank fields are empty or null mtia Mark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] database question
Hi, newbie question, what I'd like to do is improve/add columns for a sadly lacking database for a commercial proramme. What I'd like to know is it possible to add columns to an existing database without causing problems, add extra info into these columns, and then somehow create a viewer of the database.. It woud have to only be a straight viewer, no editing features needed. I did add a column, I think successfuly, but it went before the primary key column, does this matter? Well, you can always ask mtia Mark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] append sql file
thanks Igor, that works, but without the period at the end, as in */ Mark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] append sql file
Hi, was wondering if there was a way to have extra text on the end of an sql file, after the COMMIT; ? I'd like to combine two functions onto the one file, the text would be read by another programme, but how can I tell SQLite to ignore what's after the COMMIT mtia Mark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] output problem
thanks Michael, my typing 2 forward slashes wasn't intentional, I realized after I posted what I'd done, but it's good to know I can a forward slash instead, so as long it it just goes to the C drive and no further, it should be OK for all users? Mark - Original Message - From: "Black, Michael (IS)" <michael.bla...@ngc.com> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>; "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Wednesday, June 02, 2010 1:04 PM Subject: Re: [sqlite] output problem > Inside code you can use forward slash for path seperators (dang Microsoft > for ever introducing this backslash stuff). > > so this works on ALL windows operating systems that I know of > .output c:/done.txt > > Note though that if your user doesn't have admin priveledges they may not > be able to write to the root of C: drive. > > Michael D. Black > Senior Scientist > Northrop Grumman Mission Systems > > > ____ > > From: sqlite-users-boun...@sqlite.org on behalf of CDN Mark > Sent: Wed 6/2/2010 6:48 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] output problem > > > > thanks Simon, that worked, why is this? and if I wanted to send this to > someone else and it had the // would it NOT work for them? > > Mark > - Original Message - > From: "Simon Davies" <simon.james.dav...@googlemail.com> > To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> > Sent: Wednesday, June 02, 2010 11:55 AM > Subject: Re: [sqlite] output problem > > > On 1 June 2010 12:52, Mark <m.co...@virgin.net> wrote: >> Hi, >> >> trying to use .output to write a small text file, and send it to the C >> drive. It looks like this: >> >> .read UnPop.sql >> .output C:\done.txt >> .dump dbinfo >> .quit >> >> works fine if I send it to the E drive, but as soon as I try anywhere on >> the C, whether to the drive itself, or a folder on C, it just doesn't >> work >> at all, >> nothing is created. I do need it it to go to at least the C drive, and >> preferably a folder on C > > looks like Windoze - double up your '\' chars, > > i.e. > > .output C:\\done.txt > >> >> mtia, >> Mark > > Regards, > Simon > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] output problem
thanks Simon, that worked, why is this? and if I wanted to send this to someone else and it had the // would it NOT work for them? Mark - Original Message - From: "Simon Davies"To: "General Discussion of SQLite Database" Sent: Wednesday, June 02, 2010 11:55 AM Subject: Re: [sqlite] output problem On 1 June 2010 12:52, Mark wrote: > Hi, > > trying to use .output to write a small text file, and send it to the C > drive. It looks like this: > > .read UnPop.sql > .output C:\done.txt > .dump dbinfo > .quit > > works fine if I send it to the E drive, but as soon as I try anywhere on > the C, whether to the drive itself, or a folder on C, it just doesn't work > at all, > nothing is created. I do need it it to go to at least the C drive, and > preferably a folder on C looks like Windoze - double up your '\' chars, i.e. .output C:\\done.txt > > mtia, > Mark Regards, Simon ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] not all delete commands completed
Hi there, am trying to run an sql file of DELETE commands, but not totally successful. Of the 43, only 30 deleted from the database on the first try, second time 10 more, third time 2 more, one wouldn't delete. Was wondering if the format mattered in that the commands were in 43 continous rows, but everywhere I've seen about the DELETE command it quotes it as DELETE on one line, with the WHERE on the next line. I thought there might be a locking issue but seem to recall reading that SQLite does this automatically. I would actually be running a combination of DELETE/UPDATE/INSERT commands (will this work?) and wondered if alternating the commands might help mtia Mark ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users