/* 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.
*/
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
function 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