mkdb 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. #
  3. # Script to create a table 'FPdev' and to fill it with data.
  4. # The script accepts an optional argument :
  5. # A database to connect to. (default 'testdb')
  6. #
  7. # Collect the database
  8. DATABASE=testdb.gdb
  9. # Choose one of the following:
  10. # ISQL=isql
  11. ISQL=/usr/interbase/bin/isql
  12. #
  13. # Don't edit after this.
  14. #
  15. echo -n "Creating and filling table FPdev in database $DATABASE..."
  16. # >/dev/null 2>&1
  17. ${ISQL} << EOF
  18. CREATE DATABASE "$DATABASE";
  19. create table FPdev (
  20. id INT NOT NULL,
  21. UserName varchar(50),
  22. InstEmail CHAR(50),
  23. PRIMARY KEY (id));
  24. insert into FPdev values ('1','Michael Van Canneyt','[email protected]');
  25. insert into FPdev values ('2','Florian Klaempfl','[email protected]');
  26. insert into FPdev values ('3','Carl-Eric Codere','[email protected]');
  27. insert into FPdev values ('4','Daniel Mantione','[email protected]');
  28. insert into FPdev values ('5','Pierre Muller','[email protected]');
  29. insert into FPdev values ('6','Jonas Maebe','[email protected]');
  30. insert into FPdev values ('7','Peter Vreman','[email protected]');
  31. insert into FPdev values ('8','Gerry Dubois','[email protected]');
  32. create table test (
  33. timestamp_fld timestamp,
  34. smallint_fld smallint,
  35. integer_fld integer,
  36. float_fld float,
  37. double_fld double precision,
  38. char_fld char(10),
  39. varchar_fld varchar(50));
  40. insert into test values ('12.1.2000 00:30',10,70000,12.5,20.5,'testchar','testvarchar');
  41. commit;
  42. EOF
  43. if [ ! $? = 0 ]; then
  44. echo "Failed."
  45. else
  46. echo "Done."
  47. fi
  48. # Ready