Files
harbour-core/harbour/contrib/sddmy/tests/test1.prg
Viktor Szakats 9b737790da 2010-03-24 10:31 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/sddmy/tests/hbmk.hbm
  + contrib/sddfb/tests
  + contrib/sddfb/tests/hbmk.hbm
  + contrib/sddpg/tests
  + contrib/sddpg/tests/hbmk.hbm
  * contrib/sddsqlt3/tests/hbmk.hbm
  * contrib/sddoci/tests/hbmk.hbm
    + Added missing tests dirs. It would be great to add some
      test.prg's otherwise it's pretty hard to test these
      libs.
    ! Sync tests dir .hbm option with rest of contribs.

  * contrib/sddmy/tests/test1.prg
    ! Fixed warning to compile with now std strict make options.
2010-03-24 09:33:58 +00:00

46 lines
1.1 KiB
Plaintext

/*
* $Id$
*/
#include "dbinfo.ch"
#include "error.ch"
#include "hbrddsql.ch"
REQUEST SDDMY, SQLMIX
ANNOUNCE RDDSYS
FIELD RESIDENTS
PROCEDURE main()
RDDSETDEFAULT("SQLMIX")
AEVAL(RDDLIST(), {|X| QOUT(X)})
IF RDDINFO(RDDI_CONNECT, {"MYSQL", "localhost", "test",, "test"}) == 0
? "Unable connect to the server"
RETURN
ENDIF
CreateTable()
? "Let's browse table (press any key)"
INKEY(0)
DBUSEAREA( .T.,, "SELECT * FROM country", "country" )
Browse()
? "Let's browse table ordered by resident count (press any key)"
INKEY(0)
INDEX ON RESIDENTS TAG residents TO country
Browse()
DBCLOSEALL()
RETURN
STATIC PROC CreateTable()
? RDDINFO(RDDI_EXECUTE, "DROP TABLE country")
? RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME char(50), RESIDENTS int(11))")
? RDDINFO(RDDI_EXECUTE, "INSERT INTO country values ('LTU', 'Lithuania', 3369600), ('USA', 'United States of America', 305397000), ('POR', 'Portugal', 10617600), ('POL', 'Poland', 38115967), ('AUS', 'Australia', 21446187), ('FRA', 'France', 64473140), ('RUS', 'Russia', 141900000)")
RETURN