Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > main-testing > by-pkgid > 2292bb029a6b72bf3992f7f601b8fa3b > files > 2146

fpc-2.2.4-1.1mdv2009.1.x86_64.rpm

{
    Copyright (c) 1999-2000 by Pavel Stingl <stingp1.eti@mail.cez.cz>


    Test program for OraOCI units

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************}
program test01;

uses
  oraclew,
  oci,oratypes;

{$H+}

{
    Constants user, pass & tnsc you must set by hand to values,
    which you prefer.

    user = username
    pass = password
    tnsc = TNS connect string
 **********************************************************************}

const
  user = 'every';
  pass = 'tisova';
  tnsc = 'etil.world';

var
  x : integer;
  p : integer;
begin
  OraInit;
  OraLogin(user,pass,tnsc);
  OraSQLExec('select sysdate from sys.dual');
  writeln(OraGetFieldName(1):20);
  p := OraGetFieldCount;
  for x := 1 to p do
  write(OraGetFieldName(x), ';');
  WriteLn;
  while OraNext do
  begin
    for x := 1 to p do
      write(OraGetFieldAsString(x), ';');
    writeln;
  end;

  OraLogout;
  OraFin;
end.