Hi John,
I don't think that the first command can combine meta-commands with
SQL statements.
But redirect stdin:
C:\> copy con tst.cmd
create table if not exists tst( c1 integer );
insert into tst values( 0 );
insert into tst values( 1 );
insert into tst values( 2 );
.mode line
select c1 from tst where c1 > 0 and c1 < 2;
.mode column
select c1 from tst where c1 > 0 and c1 < 2;
^Z
1 file(s) copied.
C:\> sqlite3 tst.db < tst.cmd
c1 = 1
1
Rgds,
Simon
2008/6/13 John <[EMAIL PROTECTED]>:
> Hi
>
> I am trying to put multiple commands/statements in a command line args
> list to sqlite3 (Win XP command line/batch file).
>
> This works (sq is alias for sqlite3.exe):
> sq data\data1.db3 "DROP TABLE IF EXISTS list; VACUUM; CREATE TABLE IF
> NOT EXISTS list (Assno,Custno);"
>
> These are all statements.
>
> This does not work:
> sq data\data1.db3 ".mode column" "select
> assno,custno,asset,custnum,branch from list,a1 where asset == assno;"
>
> A "." command followed by a statement.
>
> Variations I have tried:
> - quoting the full arg list as a single string
> - using ; / \ \n \r \r\n as separators after column
>
> Can this be made to work? and if so, how?
>
> --
> Regards
> John McMahon
> [EMAIL PROTECTED]
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users