Thanks, for the record this works but for some reason the ToolTask only
sends the arguments list to the command-processor if this flag is set.  So,
you need to prepend the tool path and tool name to get it working.

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Jan Hudec
Sent: Monday, July 18, 2011 1:51 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Script-friendly execution of sqlite3.exe for
initializing a DB

On Thu, Jul 14, 2011 at 16:20:56 -0500, Marvin Bellamy wrote:
> I want to run sqlite3 from a script (actually from a ToolTask in the
MSBuild
> environment) and get it to create a database without dropping into
> interactive mode.  It looks like ToolTasks don't like the redirection
> operator (they're interpreted as string literals), so this won't work:
> 
>    Sqlite3  new.db < new.sql

That's the correct way to give input to sqlite3. Your problem is how to
teach
ToolTasks to understand the redirection.

Well, quick look at the documentation suggests setting 'UseCommandProcessor'
to 'true' should do the trick (it will use cmd.exe than and that does
understand redirection).

Oh, you should probably add -batch option like this:

    sqlite3 -batch new.db < new.sql

to suppress the prompts and command echo.

-- 
                                                 Jan 'Bulb' Hudec
<b...@ucw.cz>
_______________________________________________
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

Reply via email to