On Tue, 8 Apr 2008 13:13:02 +0200 (CEST), you wrote:

>How can I to pass parameters in sql string?
>For example, I type:
>
>  sql = "create table modulo(id, nome, classe, istanza);";
>
>now, I'd like to insert a parametrized name for table. Like 
>
>echo 'create table $modulo(id, nome, classe, istanza)'
>
>in shell scripting.

Since you didn't mention the error you get, I just can
guess your problem is shell quoting or a missing
semicolon.

 $ export tbl=test

 $ echo "$tbl"
test

 $ echo "create table $tbl (id, nome, classe,
istanza);" | sqlite3  test.db

 $ sqlite3 test.db
SQLite version 3.5.7
Enter ".help" for instructions
sqlite> .schema
CREATE TABLE test (id, nome, classe, istanza);
sqlite> .q

HTH
-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to