1 ----------------------------------README---------------------------------------
2 This contains an example program that demonstates usage of csql tool.
7 It creates table t1 with two fields f1 integer (primary key) and f2 string.
10 Inserts 5 rows into the table t1
13 select value of f2 from table t1 for tuple with f1 value 3
14 select all the tuples from table t1
17 delete all rows from table t1 with f1 value 3
18 delete all rows from table t1;
25 1. Set the CSQL_CONFIG_FILE environment variable to absolute path of csql.conf file.
26 $export CSQL_CONFIG_FILE=/tmp/csql.conf
27 2. Set the LD_LIBRARY_PATH environment variable to csql library path
28 $export LD_LIBRARY_PATH=$CSQL_INSTALL_ROOT/lib:$LD_LIBRARY_PATH
30 3. Run the csql tool with appropriate sql script as input
31 $csql -u root -p manager -s create.sql
36 echo create table t1 (f1 integer, f2 char (20), primary key(f1));
40 Statement Executed: Rows Affected = 1
41 Statement Executed: Rows Affected = 1
42 Statement Executed: Rows Affected = 1
43 Statement Executed: Rows Affected = 1
44 Statement Executed: Rows Affected = 1
47 echo select f2 from t1 where f1 =3;
48 ---------------------------------------------------------
50 ---------------------------------------------------------
53 echo select * from t1;
54 ---------------------------------------------------------
56 ---------------------------------------------------------
64 echo delete from t1 where f1 =3;
65 Statement Executed: Rows Affected = 1
67 Statement Executed: Rows Affected = 4