test01.pp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. $Id$
  3. Copyright (c) 1999-2000 by Pavel Stingl <[email protected]>
  4. Test program for OraOCI units
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. program test01;
  12. uses
  13. oraclew,
  14. oraoci;
  15. {$H+}
  16. {
  17. Constants user, pass & tnsc you must set by hand to values,
  18. which you prefer.
  19. user = username
  20. pass = password
  21. tnsc = TNS connect string
  22. **********************************************************************}
  23. const
  24. user = 'every';
  25. pass = 'tisova';
  26. tnsc = 'etil.world';
  27. var
  28. x : integer;
  29. p : integer;
  30. begin
  31. OraInit;
  32. OraLogin(user,pass,tnsc);
  33. OraSQLExec('select sysdate from sys.dual');
  34. writeln(OraGetFieldName(1):20);
  35. p := OraGetFieldCount;
  36. for x := 1 to p do
  37. write(OraGetFieldName(x), ';');
  38. WriteLn;
  39. while OraNext do
  40. begin
  41. for x := 1 to p do
  42. write(OraGetFieldAsString(x), ';');
  43. writeln;
  44. end;
  45. OraLogout;
  46. OraFin;
  47. end.