test01.pp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 oraclew, oraoci,linux;
  13. {$H+}
  14. {
  15. Constants user, pass & tnsc you must set by hand to values,
  16. which you prefer.
  17. user = username
  18. pass = password
  19. tnsc = TNS connect string
  20. **********************************************************************}
  21. const
  22. user = 'every';
  23. pass = 'tisova';
  24. tnsc = 'etil.world';
  25. var
  26. x : integer;
  27. p : integer;
  28. begin
  29. OraInit;
  30. OraLogin(user,pass,tnsc);
  31. OraSQLExec('select sysdate from sys.dual');
  32. writeln(OraGetFieldName(1):20);
  33. p := OraGetFieldCount;
  34. for x := 1 to p do
  35. write(OraGetFieldName(x), ';');
  36. WriteLn;
  37. while OraNext do
  38. begin
  39. for x := 1 to p do
  40. write(OraGetFieldAsString(x), ';');
  41. writeln;
  42. end;
  43. OraLogout;
  44. OraFin;
  45. end.