Rowan Worth, on Monday, May 20, 2019 03:02 AM, wrote... >On Sat, 18 May 2019 at 00:34, Tony Papadimitriou <to...@acm.org> wrote: > >> It’s quite often (for me, at least) the case I need to do something like >> this from the command line: >> >> >sqlite3.exe my.db “insert into t values(‘simple field’,’multi-line text >> copied from some other app’) >> >> The problem is the multi-line text cannot be copy-pasted directly into the >> command line as the first newline will terminate the command. So, I’ve >> been using readline() like so: >> > >I haven't tested on windows, but FWIW the interactive sqlite3 shell has no >such limitation - statements are free to span multiple lines. ie. you can >type: > > sqlite> INSERT INTO T VALUES('simple field', '«paste- > ...> multi-line- > ...> content»') > ...> ; > >I guess you'd also prefer to not have to type out the full INSERT statement >each time, but this kind of seems like a shell problem more than an sqlite >problem!
The only problem with this, and some of the previous copy and paste ideas is that if there is a single quote (') in that pasted data, it can mess up the data. If you know that there is not going to be a ' in there, you're ok. Otherwise, I have been bitten by this a few times, where I have to do more work than necessary. Just my $US 0.02. Thanks. josé _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users