Files
harbour-core/harbour/contrib/hbpgsql/tests/tstpgrdd.prg
Viktor Szakats feb9517ee2 2010-03-08 00:09 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* include/hbapi.h
  * src/common/hbver.c
    + Added hb_iswin2k() low-level function to detect
      if running under Windows 2000 or newer.

  * include/hbextern.ch
  * src/rtl/version.c
    + Added HB_OSISWIN2K() .prg level function.

  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtwvt/gtwvt.c
  * contrib/gtwvg/gtwvg.c
  * contrib/gtwvg/wvggui.c
  * examples/gtwvw/gtwvw.c
  * contrib/hbwin/win_prn2.c
  * contrib/hbwin/win_prn3.c
    % Changed to use hb_iswin*() API instead of implementing
      version detection locally.

  * contrib/hbmysql/mysql.c
  * contrib/hbpgsql/postgres.c
    + Added my partial copyright.

  * contrib/hbpgsql/tests/tstpgrdd.prg
    * Formatting.

  * contrib/hbpgsql/postgres.c
    ! Fixed to define all .prg level functions regardless
      of pgsql lib it's built against. They return
      permanent failure in this case.
    ! Fixed PQCREATETRACE() to return NULL pointer instead
      of NIL for static builds.
    ! PQFREECANCEL() marked with HB_LEGACY_LEVEL3.

  * contrib/hbwin/win_os.prg
    + Using HB_OSISWIN2K() core API.

  * contrib/hbide/ideprojmanager.prg
    * Minor alignment.
2010-03-07 23:11:09 +00:00

96 lines
2.0 KiB
Plaintext

/*
* $Id$
*/
/* The aim of this test is to check the same RDD functions and statements against a dbf file
and the same dbf imported into a PostgreSQL database.
Replace <...> with your data and configuration.
*/
#if 0
PROCEDURE Main()
LOCAL nConn
SET DELETED ON
REQUEST DBFCDX
REQUEST PGRDD
USE <table> INDEX <index> EXCLUSIVE VIA "dbfcdx"
SET ORDER TO 1
test_code( "DBF" )
USE
nConn := dbpgconnection( "<host>;<database>;<user>;<password>;<port>;<scheme>" )
/* if you want to update and insert data you need at least a primary key */
USE "select <fields,...> FROM <table> ORDER BY <same order as dbf>" ALIAS <table> VIA "pgrdd" CONNECTION NCONN
test_code( "SQL" )
USE
dbpgclearconnection( nConn )
RETURN
PROCEDURE test_code( cMode )
LOCAL xTemp
<table>->( dbGoTop() )
? <table>-><field1>, <table>-><field2>, <table>-><field3>
<table>->( dbGoBottom() )
? <table>-><field1>, <table>-><field2>, <table>-><field3>
/* goto 100 has different meaning */
<table>->( dbGoto( 100 ) )
? <table>-><field1>, <table>-><field2>, <table>-><field3>
xTemp := <table>-><field3>
REPLACE <table>-><field3> WITH "*** replaced ***"
? <table>-><field1>, <table>-><field2>, <table>-><field3>
REPLACE <table>-><field3> WITH xTemp
dbCommit() // the real write is made via dbCommit() so it is needed
? <table>-><field1>, <table>-><field2>, <table>-><field3>
? Eof()
dbGoBottom()
dbSkip()
? Eof()
? Bof()
dbGoTop()
dbSkip( -1 )
? Bof()
dbAppend()
REPLACE <table>-><field1> WITH <"9">
REPLACE <table>-><field2> WITH <"999999">
REPLACE <table>-><field3> WITH <"APPENDED">
dbCommit()
// RecNo() has different meaning, in SQL it is the number of the row and change for every select */
? <table>->( RecNo() ), <table>-><field1>, <table>-><field2>, <table>-><field3>
WAIT
CLS
Browse()
dbGoBottom()
REPLACE <table>-><field3> WITH "REPLACED"
dbCommit()
dbGoBottom()
Browse()
DELETE FOR <table>-><field1> = "9"
RETURN
#endif