/* * $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 INDEX EXCLUSIVE VIA "dbfcdx" SET ORDER TO 1 test_code( "DBF" ) USE nConn := dbpgconnection( ";;;;;" ) /* if you want to update and insert data you need at least a primary key */ USE "select FROM
ORDER BY " ALIAS
VIA "pgrdd" CONNECTION NCONN test_code( "SQL" ) USE dbpgclearconnection( nConn ) RETURN PROCEDURE test_code( cMode ) LOCAL xTemp
->( dbGoTop() ) ?
->,
->,
->
->( dbGoBottom() ) ?
->,
->,
-> /* goto 100 has different meaning */
->( dbGoto( 100 ) ) ?
->,
->,
-> xTemp :=
-> REPLACE
-> WITH "*** replaced ***" ?
->,
->,
-> REPLACE
-> WITH xTemp dbCommit() // the real write is made via dbCommit() so it is needed ?
->,
->,
-> ? Eof() dbGoBottom() dbSkip() ? Eof() ? Bof() dbGoTop() dbSkip( -1 ) ? Bof() dbAppend() REPLACE
-> WITH <"9"> REPLACE
-> WITH <"999999"> REPLACE
-> WITH <"APPENDED"> dbCommit() // RecNo() has different meaning, in SQL it is the number of the row and change for every select */ ?
->( RecNo() ),
->,
->,
-> WAIT CLS Browse() dbGoBottom() REPLACE
-> WITH "REPLACED" dbCommit() dbGoBottom() Browse() DELETE FOR
-> = "9" RETURN #endif