test01.pp 1.2 KB

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