Re: [Harbour-users] Re: DBF Fast text search / SQLite
Hello Massimo, Thanks for testing. This is what I was expecting. I am studing SQLite a bit and plan to use it because of it's easy instalation and "simple" use. I mean "simple" compared to other SQL solutions but for me it is a new thing yet and I will have much to learn. When I have SQLite under control I will try PostgreSQL because it is the most recomended robust opensource DBMS I have notice. Regards, Qatan - Original Message - From: "Massimo Belgrano" To: "Users of the Harbour compiler" Sent: Thursday, 13 de May de 2010 10:47 Subject: Re: [Harbour-users] Re: DBF Fast text search / SQLite I have tried sample and works with cvs version of habour (you must set root as password for user root) follow sample create all stucture so will be used after installing In my sample i found in dbedit one row for argentina added from follow row .. APPEND BLANK REPLACE CODE WITH 'ARG' REPLACE NAME WITH 'Argentina' REPLACE RESIDENTS WITH 3874 GO TOP ..and found other country If ! 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', 14190)") Wich database you plan use? 2010/5/13 Qatan : Hello Massimo, Good example, but I don't have MySQL installed and can't test it. Does anyone has MySQL installed and harbour from SVN built with HB_WITH_MYSQL set? Could you please test the example? What I am trying to see is the REPLACE command working. According to what I could understand it will not save the records on the server side, only on cached query result but SQL database is not changed. "The programmer must call SQL command explicitly to modify SQL tables. SSI provides a method to detect which cached rows was changed or appended." I would like to see it in a example, please. Thanks -- Massimo Belgrano ___ Harbour-users mailing list (attachment size limit: 40KB) Harbour-users@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour-users ___ Harbour-users mailing list (attachment size limit: 40KB) Harbour-users@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour-users
[Harbour-users] Field dbf auto increment.
Hi! How to work with field auto increment ? For example: aStru := {{'codcli','+',04,0},; {'nome' ,'c',40,0}} create file cliente.dbf bStru := {{'codcli','n',10,0},; ... create file sum.dbf To the case create relation into aStru and bStru ? Best regards, Itamar M. Lins Jr. ___ Harbour-users mailing list (attachment size limit: 40KB) Harbour-users@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour-users
Re: [Harbour-users] Re: DBF Fast text search / SQLite
I have tried sample and works with cvs version of habour (you must set root as password for user root) follow sample create all stucture so will be used after installing In my sample i found in dbedit one row for argentina added from follow row .. APPEND BLANK REPLACE CODE WITH 'ARG' REPLACE NAME WITH 'Argentina' REPLACE RESIDENTS WITH 3874 GO TOP ..and found other country If ! 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', 14190)") Wich database you plan use? 2010/5/13 Qatan : > Hello Massimo, > > Good example, but I don't have MySQL installed and can't test it. > Does anyone has MySQL installed and harbour from SVN built with > HB_WITH_MYSQL set? Could you please test the example? > What I am trying to see is the REPLACE command working. According to what > I could understand it will not save the records on the server side, only on > cached query result but SQL database is not changed. > > "The programmer must call SQL command explicitly to modify SQL tables. > SSI provides a method to detect which cached rows was changed or appended." > > I would like to see it in a example, please. > > Thanks -- Massimo Belgrano ___ Harbour-users mailing list (attachment size limit: 40KB) Harbour-users@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour-users
Re: [Harbour-users] Re: DBF Fast text search / SQLite
Hello Massimo, Good example, but I don't have MySQL installed and can't test it. Does anyone has MySQL installed and harbour from SVN built with HB_WITH_MYSQL set? Could you please test the example? What I am trying to see is the REPLACE command working. According to what I could understand it will not save the records on the server side, only on cached query result but SQL database is not changed. "The programmer must call SQL command explicitly to modify SQL tables. SSI provides a method to detect which cached rows was changed or appended." I would like to see it in a example, please. Thanks Qatan - Original Message - From: "Massimo Belgrano" To: "Users of the Harbour compiler" Sent: Wednesday, 12 de May de 2010 18:02 Subject: Re: [Harbour-users] Re: DBF Fast text search / SQLite follow is my untested sample *#RUN hbmk2 sqltest.prg c:\harbour\contrib\sddmy\sddmy.hbc /* * RDDSQL - Harbour * Copyright 2008 Grigory Filatov * Copyright 2008 Belgrano Massimo * Based on RDDSQL sample included in Harbour distribution * based on Slight Modifications By Roberto Lopez (2009.04.01) * */ #include "dbinfo.ch" #include "error.ch" #define DBI_QUERY 1001 #define RDDI_CONNECT 1001 #define RDDI_DISCONNECT 1002 #define RDDI_EXECUTE 1003 #define RDDI_ERROR 1004 #define RDDI_ERRORNO 1005 #define RDDI_NEWID 1006 #define RDDI_AFFECTEDROWS 1007 #define RDDI_QUERY 1008 ANNOUNCE RDDSYS REQUEST SDDMY, SQLMIX ** Function Main() ** RDDSETDEFAULT( "SQLMIX" ) IF RDDINFO( RDDI_CONNECT, {"MYSQL", "localhost", "root","root", "test"} ) == 0 ? "Unable connect to the server!" Return nil ENDIF OpenTable() AddRecord() dbedit() CloseTable() Return nil ** Procedure OpenTable ** If CreateTable() DBUSEAREA( .T.,, "SELECT * FROM country", "country" ) INDEX ON FIELD->RESIDENTS TAG residents TO country GO TOP endIf Return ** Procedure CloseTable ** DBCLOSEALL() Return ** Procedure AddRecord ** APPEND BLANK REPLACE CODE WITH 'ARG' REPLACE NAME WITH 'Argentina' REPLACE RESIDENTS WITH 3874 GO TOP Return ** Function CreateTable ** Local ret := .T. RDDINFO(RDDI_EXECUTE, "DROP TABLE country") If RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME char(50), RESIDENTS int(11))") If ! 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', 14190)") ? "Can't fill table Country!" ret := .F. EndIf Else ? "Can't create table Country!" ret := .F. EndIf Return ret 2010/5/12 Qatan : Hello Massimo, Thanks for helping. Do you have experience using RDDSQL? Seems very good but I am afraid I didn't understand part 3, maybe a good example would be the answer for that. How can I save the modifications? Regards, Qatan - Original Message - From: "Massimo Belgrano" To: "Users of the Harbour compiler" Sent: Wednesday, 12 de May de 2010 15:38 Subject: Re: [Harbour-users] Re: DBF Fast text search / SQLite afaik last version of rddado is not working in harbour (after ole modification) rddsql is best choice AFAIK RDDSQL talk directly with the sql language this is message post by Mindaugas Kavaliauskas on this list 3. Modifying database SSI presents a query result via RDD interface and generates no hidden SQL queries. So, how database can be changed? Does DBAPPEND() and FIELDPUT() works, or is it readonly SQL interface? DBAPPEND(), FIELDPUT() and other similiar functions work on cached query result, i.e. query can be appended by new rows and field values can be changed, but SQL database is not changed. DBCREATE() function can also be used to create an "empty query result" but no table is created on SQL server. So, SSI can also be used as implementation of "array RDD". The programmer must call SQL command explicitly to modify SQL tables. SSI provides a method to detect which cached rows was changed or appended. ___ Harbour-users mailing list (attachment size limit: 40KB) Harbour-users@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/