"P Kishor" wrote...


> José,
>
> Please note Igor's very important cautionary note below --
>
> On Mon, Oct 11, 2010 at 7:05 AM, Igor Tandetnik <itandet...@mvps.org> 
> wrote:
>> P Kishor <punk.k...@gmail.com> wrote:
>>> UPDATE OpenJobs
>>> SET notes = 'string to add in front\r\n' || notes
>>> WHERE spid = 32;
>>
>> Note that SQLite doesn't understand C-style escapes. '\r' is a string 
>> consisting of two characters, a backslash and a letter r. If you want to 
>> insert CRLF pair, you'd need something like this:
>>
>> SET notes = 'string to add in front' || cast(x'0d0a' as text) || notes
>>
>
> So, if you are using a programming language, you can do like so
>
>    UPDATE OpenJobs
>    SET notes = ? || notes
>    WHERE spid = ?
>
> and then, in your application (for example, Perl code below; note, use
> of double quotes)
>
>    $sth->execute( "string to add in front\r\n", 32);
>
> Or, in the command line sqlite3 program, you can simply hit "enter" on
> your keyboard and then close-single-quote the string.
>
> sqlite > UPDATE OpenJobs SET notes = 'string to add in front
> sqlite > ' || notes WHERE spid = 32;
>
>
>> Or, you can use a parameter in place of the string literal, and bind a 
>> string to it in your program. Such a string can contain any characters 
>> you want.

Yep.  Already working thanks.

josé 

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

Reply via email to