On Wed, Feb 11, 2009 at 2:00 PM, jose isaias cabrera
<cabr...@wrc.xerox.com> wrote:
>
>
> "P Kishor" wrote...
>
>
>> On Wed, Feb 11, 2009 at 1:48 PM, jose isaias cabrera
>> <cabr...@wrc.xerox.com> wrote:
>>>
>>> Greetings and salutations...
>>>
>>> I am having a problem with an specific UPDATE.  One of the functions of
>>> my
>>> program is to capture all of the files in a directory so that one can
>>> search
>>> on a file name and find out where that file is quickly.  This is working
>>> perfectly, until there is a file that has a single quote (') in its name.
>>> Say a directory has these three files:
>>>
>>> 1. filename0.txt
>>> 2. filename1.txt
>>> 3. filename'3.txt
>>> 4. filename4.txt
>>>
>>> my update string is this,
>>>
>>> BEGIN;
>>>
>>> UPDATE LSOpenProjects SET
>>>     Xtra0 = '',
>>> ... some other settings working ok ...
>>>     Xtra3 = '
>>> filename0.txt
>>> filename1.txt
>>> filename''3.txt
>>> filename4.txt
>>> ',
>>>     Xtra4 = '',
>>>     Xtra5 = '',
>>>     Xtra6 = '',
>>>     Xtra7 = '',
>>>     Xtra8 = '0.00',
>>>     Xtra9 = '',
>>>     XtraA = '',
>>>     XtraB = '',
>>>     XtraC = '',
>>>     XtraD = '',
>>>     XtraE = '',
>>>     XtraF = '' WHERE id = 3487;
>>> COMMIT;
>>>
>>> The column in question is Xtra3.  If I rename that file to NOT contain
>>> the
>>> single quote, the UPDATE works.  Also, I add a newline (\n) to the
>>> beginning
>>> of the first filename and a new line after every filename.
>>>
>>
>>
>> works fine for me... see below
>>
>> sqlite> CREATE TABLE foo (a, b);
>> sqlite> INSERT INTO foo VALUES (1, '
>>   ...> filename0.txt
>>   ...> filename1.txt
>>   ...> filename''3.txt
>>   ...> filename4.txt
>>   ...> ');
>> sqlite> SELECT * FROM foo;
>> 1|
>> filename0.txt
>> filename1.txt
>> filename'3.txt
>> filename4.txt
>>
>> sqlite> UPDATE foo SET b = '
>>   ...> blah.txt
>>   ...> gorp.tx
>>   ...> messed''up.txt
>>   ...> whoa.txt
>>   ...> ' WHERE a = 1;
>> sqlite> SELECT * FROM foo;
>> 1|
>> blah.txt
>> gorp.tx
>> messed'up.txt
>> whoa.txt
>>
>
> Yes, I know.  It works for me too when I do it by hand.  The problem is when
> I read the files from the system... Hmmmm... Let me try something...
>


care to elaborate on "read files from the system" bit? You didn't
provide that information first time. How are you "reading" files from
the system?



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

Reply via email to