SB 2-2-96 HOW TO begin using mSQL on hpserver.lnf.infn.it =============================================== 1) logon hpserver from a finuda group account 2) check if you are executing the group_cshrc script: your .cshrc file in your ~ directory should contain the instructions # # Execute GROUP level commands if a group file exists and is readable # set grp = `id | cut -f3 -d"(" | cut -f1 -d")"` if ( -r /u1/${group}/group_cshrc ) source /u1/${group}/group_cshrc # # 3) invoke relshow to see which databases are available hpserver:~> relshow +-----------------+ | Databases | +-----------------+ | test | +-----------------+ hpserver:~> 4) again, to see which tables are in database test hpserver:~> relshow test Database = test +---------------------+ | Table | +---------------------+ | strawtestsign | | strawtesthv | | test | | test2 | +---------------------+ hpserver:~> 5) once again, to see the variables inserted in tables strawtestsign and strawtesthv hpserver:~> relshow test strawtestsign Database = test Table = strawtestsign +-----------------+----------+--------+----------+-----+ | Field | Type | Length | Not Null | Key | +-----------------+----------+--------+----------+-----+ | strawid | int | 4 | N | N | | serial | int | 4 | N | N | | channel | int | 4 | N | N | | valid | int | 4 | N | N | | expiry | int | 4 | N | N | +-----------------+----------+--------+----------+-----+ hpserver:~> relshow test strawtesthv Database = test Table = strawtesthv +-----------------+----------+--------+----------+-----+ | Field | Type | Length | Not Null | Key | +-----------------+----------+--------+----------+-----+ | strawid | int | 4 | N | N | | mainframe | int | 4 | N | N | | channel | int | 4 | N | N | | valid | int | 4 | N | N | | expiry | int | 4 | N | N | +-----------------+----------+--------+----------+-----+ hpserver:~> 6) try to access the test database 'test'. [ If it refuses, fireup the database engine (server) first by entering 'msqld&'] hpserver:~> msql test Welcome to the miniSQL monitor. Type \h for help. mSQL > select strawid,serial,channel,valid,expiry from strawtestsign \g Query OK. 32 rows matched. +----------+----------+----------+----------+----------+ | strawid | serial | channel | valid | expiry | +----------+----------+----------+----------+----------+ | 1000 | 5924 | 1 | 940202 | 960202 | | 1000 | 5999 | 1 | 960202 | 200000000| | 1001 | 5962 | 2 | 960202 | 200000000| | 1002 | 5964 | 3 | 960202 | 200000000| | 1003 | 5966 | 4 | 960202 | 200000000| | 1004 | 5968 | 5 | 960202 | 200000000| | 1005 | 5972 | 6 | 960202 | 200000000| | 1006 | 5974 | 7 | 960202 | 200000000| | 1007 | 5990 | 8 | 960202 | 200000000| | 1008 | 5988 | 9 | 960202 | 200000000| | 1009 | 5986 | 10 | 960202 | 200000000| | 1010 | 5984 | 11 | 960202 | 200000000| | 1011 | 5982 | 12 | 960202 | 200000000| | 1012 | 5991 | 13 | 960202 | 200000000| | 1013 | 5971 | 14 | 960202 | 200000000| | 1014 | 5961 | 15 | 960202 | 200000000| | 1015 | 5951 | 16 | 960202 | 200000000| | 1016 | 5921 | 17 | 960202 | 200000000| | 1017 | 5919 | 18 | 960202 | 200000000| | 1018 | 5915 | 19 | 960202 | 200000000| | 1019 | 5913 | 20 | 960202 | 200000000| | 1020 | 5911 | 21 | 960202 | 200000000| | 1021 | 5909 | 22 | 960202 | 200000000| | 1022 | 5907 | 23 | 960202 | 200000000| | 1023 | 5905 | 24 | 960202 | 200000000| | 1024 | 5903 | 25 | 960202 | 200000000| | 1025 | 5938 | 26 | 960202 | 200000000| | 1026 | 5935 | 27 | 960202 | 200000000| | 1027 | 5933 | 28 | 960202 | 200000000| | 1028 | 5931 | 29 | 960202 | 200000000| | 1029 | 5927 | 30 | 960202 | 200000000| | 1030 | 5925 | 31 | 960202 | 200000000| +----------+----------+----------+----------+----------+ mSQL > 7) experience a more sofisticated relation query joining two tables mSQL > select strawtestsign.strawid,strawtestsign.channel,strawtesthv.channel from strawtestsign,strawtesthv where strawtestsign.strawid=strawtesthv.strawid \g Query OK. 34 rows matched. +----------+----------+----------+ | strawid | channel | channel | +----------+----------+----------+ | 1000 | 1 | 1 | | 1000 | 1 | 1 | | 1000 | 1 | 1 | | 1000 | 1 | 1 | | 1001 | 2 | 2 | | 1002 | 3 | 3 | | 1003 | 4 | 4 | | 1004 | 5 | 5 | | 1005 | 6 | 6 | | 1006 | 7 | 7 | | 1007 | 8 | 8 | | 1008 | 9 | 9 | | 1009 | 10 | 10 | | 1010 | 11 | 11 | | 1011 | 12 | 12 | | 1012 | 13 | 13 | | 1013 | 14 | 14 | | 1014 | 15 | 15 | | 1015 | 16 | 16 | | 1016 | 17 | 17 | | 1017 | 18 | 18 | | 1018 | 19 | 19 | | 1019 | 20 | 20 | | 1020 | 21 | 21 | | 1021 | 22 | 22 | | 1022 | 23 | 23 | | 1023 | 24 | 24 | | 1024 | 25 | 25 | | 1025 | 26 | 26 | | 1026 | 27 | 27 | | 1027 | 28 | 28 | | 1028 | 29 | 29 | | 1029 | 30 | 30 | | 1030 | 31 | 31 | +----------+----------+----------+ mSQL >