mkdb 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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=test.gdb
  9. # Choose one of the following:
  10. # ISQL=isql
  11. ISQL=/opt/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. set sql dialect 3;
  19. CREATE DATABASE "$DATABASE";
  20. create table FPDEV (
  21. id INT NOT NULL,
  22. UserName varchar(50),
  23. InstEmail CHAR(50),
  24. PRIMARY KEY (id));
  25. insert into FPdev values ('1','Michael Van Canneyt','[email protected]');
  26. insert into FPdev values ('2','Florian Klaempfl','[email protected]');
  27. insert into FPdev values ('3','Carl-Eric Codere','[email protected]');
  28. insert into FPdev values ('4','Daniel Mantione','[email protected]');
  29. insert into FPdev values ('5','Pierre Muller','[email protected]');
  30. insert into FPdev values ('6','Jonas Maebe','[email protected]');
  31. insert into FPdev values ('7','Peter Vreman','[email protected]');
  32. insert into FPdev values ('8','Gerry Dubois','[email protected]');
  33. create table test (
  34. timestamp_fld timestamp,
  35. smallint_fld smallint,
  36. integer_fld integer,
  37. float_fld float,
  38. double_fld double precision,
  39. char_fld char(10),
  40. varchar_fld varchar(50));
  41. insert into test values ('12.1.2000 00:30',10,70000,12.5,20.5,'testchar','testvarchar');
  42. commit;
  43. EOF
  44. if [ ! $? = 0 ]; then
  45. echo "Failed."
  46. else
  47. echo "Done."
  48. fi
  49. # Ready