csqlcacheserver reconnect, logger rotate, monitor_server
[csql.git] / examples / isql / README
blob852f90dc33253d324ecf87b576385e2004c8b2d4
1 ----------------------------------README---------------------------------------
2 This contains an example program that demonstates usage of csql tool.
4 What it does?
5 -------------
6 A) create.sql
7 It creates table t1 with two fields f1 integer (primary key) and f2 string.
9 B) insert.sql
10 Inserts 5 rows into the table t1
12 C) select.sql
13 select value of f2 from table t1 for tuple with f1 value 3
14 select all the tuples from table t1
16 D) delete.sql
17 delete all rows from table t1 with f1 value 3
18 delete all rows from table t1;
20 E) Drop the table
21 drop the table object
23 How to run
24 ----------
25 1. Set the necessary enviroment variables using the setup script
26    under the csql root directory
27         $. ./setupenv.ksh
29 2. Run the csql tool with appropriate sql script as input
30         $csql -u root -p manager -s create.sql
32 Output of example:
33 ------------------
34 A) create.sql
35 echo create table t1 (f1 integer, f2 char (20), primary key(f1));
36 Statement Executed
38 B) insert.sql
39 Statement Executed: Rows Affected = 1
40 Statement Executed: Rows Affected = 1
41 Statement Executed: Rows Affected = 1
42 Statement Executed: Rows Affected = 1
43 Statement Executed: Rows Affected = 1
45 C)select.sql
46 echo select f2 from t1 where f1 =3;
47 ---------------------------------------------------------
48         f2
49 ---------------------------------------------------------
50         Baskar
52 echo select * from t1;
53 ---------------------------------------------------------
54         f1      f2
55 ---------------------------------------------------------
56         1       Hari
57         2       Mani
58         3       Baskar
59         4       Babu
60         5       Raghu
62 D)delete.sql
63 echo delete from t1 where f1 =3;
64 Statement Executed: Rows Affected = 1
65 echo delete from t1;
66 Statement Executed: Rows Affected = 4
68 E)drop.sql
69 Statement Executed