Re: [sqlite] fill in blank fileds

2010-12-23 Thread Simon Slavin

On 23 Dec 2010, at 12:19am, Mark wrote:

> 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

If that's 2 in the first column then those fields which you think contain 
blanks actually have two characters in them.

So is that a legitimate thing for your cn to have ?  Are their any legitimate 
values for cn which are less than three characters long ?  If not, you can run 
something like

UPDATE Aircraft SET CN = '' where length(cn) < 3

and that will make sure they're all really blank.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] fill in blank fileds

2010-12-23 Thread Mark
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

2010-12-22 Thread CDN Mark
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


Re: [sqlite] fill in blank fileds

2010-12-22 Thread Igor Tandetnik
On 12/22/2010 7:25 PM, CDN Mark wrote:
> Hi Igor,
>
> not checking for, want to fill in/replace blank or null fields with at least 
> one character

So, does the statement I've shown not do this? Here it is again:

UPDATE Aircraft SET CN = '*' where CN = '' or CN is null;

In what way does it fail to meet your expectations?
-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] fill in blank fileds

2010-12-22 Thread CDN Mark
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


Re: [sqlite] fill in blank fileds

2010-12-22 Thread Igor Tandetnik
On 12/22/2010 6:55 PM, CDN Mark wrote:
> 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

I'm not sure I understand the problem. If you are asking how to check 
both for an empty string and null, just do

UPDATE Aircraft SET CN = '*' where CN = '' or CN is null;

-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] fill in blank fileds

2010-12-22 Thread Simon Slavin

On 22 Dec 2010, at 11:55pm, CDN Mark wrote:

> 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

Do a

SELECT length(CN),hex(CN) FROM Aircraft

if that produces too many lines do

SELECT length(CN),hex(CN) FROM Aircraft WHERE length(CN)<3 LIMIT 10

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] fill in blank fileds

2010-12-22 Thread CDN Mark
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