21 Fev 2015 10:56
Amiguinho Itamar, não sabes o que fala, reveja seus conhecimentos sobre SQLRDD.
21 Fev 2015 11:25
a Hwgui do SVN regrediu de uma forma enorme, nem com Harbour e nem com xHarbour ela funciona mais, só roda o básico do básico, que é uma pena.
21 Fev 2015 12:09
Itamar M. Lins Jr. escreveu:Amiguinho Itamar, não sabes o que fala, reveja seus conhecimentos sobre SQLRDD.
De novo ? O que já escrevi está errado ?
Por acaso o SELECT do SQLRDD é mais rápido do que o SELECT do SQLMIX ?
Quando usamos no SQLMIX dbusearea(...,select...) não é a mesma coisa que vc faz no SQLRDD porque simplesmente o SQLRDD engana o usuário. Na tabela de 100.000 registros na qual se refere quem disse que o SQLRDD traz(abre) os 100.000 registros ? ele traz só um pedaço... vc quer que no SQLMIX traga tudo ? Compara e acha que um é mais rápido do que o outro. Pode olhar que tem lá no SQLRDD o quantidade de registros p/ trabalhar.
Com SQLMIX trabalhamos diretamente via comandos SQL o resultado da QUERY é virtual não acessamos diretamente. Com SQLRDD trabalhamos direto na tabela tem SKIP na tabela, GOTO etc..., porque ? é como expliquei o SQLRDD simula DBF isso para uns é bom para outros, não é bom.
Com o SQLMIX temos SKIP, GOTO, mas na tabela virtual no resultado da QUERY, podemos apaga-la que não afeta nada na tabela MATRIZ, só temos acesso de leitura e gravação via comandos SQL, SELECT, INSERT, DROP...
E continuo não sabendo o que falo... é verdade....
E o pessoal do Harbour continua usando os principais motores SQL sem nenhuma falta de SQLRDD. Enquanto outros criam uma dificuldade porque entrou numa arapuca, e agora não sabe como sair.
Saudações,
Itamar M. Lins Jr.
21 Fev 2015 13:26
o Alexander voltou e jogou tudo fora olhando apenas para lado dele,
Você precisa ampliar e testar o uso da SQLRDD para ver como funciona.
Não estou falando em QUERY. Com QUERY uso pgsql do Rodrigo Moreno ou a SQLIB Open Source que também é muito boa.
Hi,
After transferring all my dbfs to SQL Server and linking applications with SQLRDD i've started to test my applications with SQLRDD in multiuser environment.
1. You can open exclusive tables by different instaneces of application
2. If opened exlusive: you can flock(), rlock() or update in both.
3. If opened shared: dbrlock() works as expected : can't dbrlock() locked record OK
4 If opened shared: you can't flock() if there is another flock() in other app. OK
5. If opened shared: you can flock() even if dbrlock() is done in other application, you can dbrlock() even if flock() is done also.
6. When rlock() is established and you try to update field (with no locking ) in locked record in other app then no error is thrown ( as in DBFCDX ) but infinite loop starts until dbunlock is issued in first app. Maybe this has something common with transactions levels i'm not aware of. ( still SQL newbie )
For me points 3 and especially 6 are the main problem because:
1. I use sometimes flock() which can't be successfull over rlock() (as in DBFCDX)
2. I planned to rewrite common parts of code to move to "try / catch" model with transactions and i've suppoused then inside this block the error will be thrown if a record/file is locked. Now I know this seems wrong assumption and rewriting of all code is needed because YOU CAN'T MIX RLOCK() WITH UPDATE ERROR CATCHING INSIDE TRANSACTION like is adviced. I'have a lot of personalized *.hrb procedures with CDX style coding i hoped to preserve some time after moving to SQL.
If i'm wrong or you can help me with understanding SQLRDD I will be gratefull.
Andrzej Morgiewicz
PS. For test and development:
I'm using SQL Server 2012,
I'm using SQLRDD libs from 2013.08.25 and 2014.08.11 ( i've got from Rafael, but this shows wrong numeric field len ),
I'm using current SVN xHarbour,
I'm also testing with xbscript linked with above libs.
PS. I can't install my current libs from xHarbour.com because after downloading and istalling i'm getting empty lib folder :(
23 Fev 2015 07:26
23 Fev 2015 08:26
23 Fev 2015 10:44
23 Fev 2015 11:31
pelo jeito você nunca usou nenhum deles
23 Fev 2015 11:48
23 Fev 2015 12:20
eu devo mostrar os 100.000 registros no browse num eh? ou não?
; The number of records to read into the cache
; Cache_Records = 10
Com a sua popularização e sucesso, organizações como o Instituto Americano Nacional de Padrões (ANSI) e a Organização Internacional de Padronização (ISO), resolveram padronizar a linguagem SQL. Em 1986 foi criado um padrão ANSI e em 1987 foi criado um padrão ISO. A partir de então, surgiram várias versões do padrão SQL, onde cada versão acrescenta novos comandos ou funcionalidades. Algumas versões do padrão ANSI existentes até a presente data são:
...
2013-01-23 08:56 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/src/vm/classes.c
* updated some comments
* renamed hb_setClsHandle() to __objSetClassHandle()
old function name covered by HB_LEGACY_LEVEL5 macro
* harbour/src/rtl/itemseri.c
+ added support for deserialization xHarbour HB_SERIALIZE() output.
All types except codeblocks are supported. I haven't added support
for xHarbour serialized data with cyclic references. If it's
really necessary then I can implement it.
I also added workaround for bug in xHarbour serialization code so
now Harbour correctly decodes data with LONGLONG numbers though
xHarbour cannot correctly decode its own stream.
Now Harbour can deserialize xHarbour data encoded by HB_SERIALIZE()
and stored somewhere. It can be important in migration process, i.e.
SQLRDD uses HB_SERIALIZE() to encode data in memos so now SQLRDD
port for Harbour should read old tables and decode xHarbour items
correctly. The same is for any other tools which saves HB_SERIALIZE()
output in xHarbour.
23 Fev 2015 13:02
onde encontro material sobre o SQLMIX?
#require "rddsql"
#require "sddodbc"
#include "simpleio.ch"
REQUEST SDDODBC, SQLMIX
PROCEDURE Main()
#if defined( __HBSCRIPT__HBSHELL )
rddRegister( "SQLBASE" )
rddRegister( "SQLMIX" )
hb_SDDODBC_Register()
#endif
Set( _SET_DATEFORMAT, "yyyy-mm-dd" )
rddSetDefault( "SQLMIX" )
? "Connect:", rddInfo( RDDI_CONNECT, { "ODBC", "DBQ=" + hb_DirBase() + "..\..\hbodbc\tests\test.mdb;Driver={Microsoft Access Driver (*.mdb)}" } )
? "Use:", dbUseArea( .T., , "select * from test", "test" )
? "Alias:", Alias()
? "DB struct:", hb_ValToExp( dbStruct() )
Inkey( 0 )
Browse()
INDEX ON FIELD->SALARY TO salary
dbGoTop()
Browse()
dbCloseArea()
RETURN
#require "rddsql"
#require "sddmy"
#include "dbinfo.ch"
#include "error.ch"
REQUEST SDDMY
REQUEST SQLMIX
ANNOUNCE RDDSYS
FIELD RESIDENTS
PROCEDURE Main()
#if defined( __HBSCRIPT__HBSHELL )
rddRegister( "SQLBASE" )
rddRegister( "SQLMIX" )
hb_SDDMY_Register()
#endif
rddSetDefault( "SQLMIX" )
? "RDDs:"; AEval( rddList(), {| x | QQOut( "", 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 field->RESIDENTS TAG residents TO country
Browse()
dbCloseAll()
RETURN
STATIC PROCEDURE 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
#require "rddsql"
#require "sddpg"
#include "dbinfo.ch"
#include "error.ch"
REQUEST SDDPG
REQUEST SQLMIX
ANNOUNCE RDDSYS
FIELD RESIDENTS, CODE, NAME
PROCEDURE Main()
LOCAL tmp
#if defined( __HBSCRIPT__HBSHELL )
rddRegister( "SQLBASE" )
rddRegister( "SQLMIX" )
hb_SDDPG_Register()
#endif
rddSetDefault( "SQLMIX" )
? "RDDs:"; AEval( rddList(), {| x | QQOut( "", x ) } )
IF rddInfo( RDDI_CONNECT, { "POSTGRESQL", "postgresql://localhost/postgres" } ) == 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 field->RESIDENTS TAG residents TO country
Browse()
dbCloseArea()
/* append and goto tests */
dbUseArea( .T., "SQLMIX" , "SELECT * FROM country", "country" )
FOR tmp := 500 TO 600
dbAppend()
field->CODE := StrZero( tmp, 3 )
field->NAME := "Test append " + hb_ntos( tmp )
NEXT
dbGoto( 101 )
INDEX ON field->RESIDENTS TAG residents TO country
dbCloseAll()
RETURN
STATIC PROCEDURE CreateTable()
LOCAL tmp
? rddInfo( RDDI_EXECUTE, "DROP TABLE country" )
? rddInfo( RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME char(50), RESIDENTS int)" )
? 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)" )
FOR tmp := 1 TO 100
rddInfo( RDDI_EXECUTE, "INSERT INTO country VALUES ('" + StrZero( tmp, 3 ) + "', 'TestSQL " + hb_ntos( tmp ) + "', 3369600)")
NEXT
RETURN
cRdd := RDDSETDEFAULT( "SQLMIX" )
cAttributes:="Server=;Database=127.0.0.1:c:\dados\datafb.fdb;User=SYSDBA;Password=masterkey;Driver={Firebird/InterBase(r) driver};"
nConn := RDDINFO( RDDI_CONNECT,{"ODBC",cAttributes} )
IF nConn == 0
hwg_Msginfo( "Não conectado ao servidor: " + str(RDDINFO( RDDI_ERRORNO )) + hb_eol() + RDDINFO( RDDI_ERROR ) )
RDDSETDEFAULT( cRdd )
RETURN
ENDIF
DBUSEAREA( .T.,"SQLMIX", "select * from PRODUTO", "xx" )
index on refere TO temp1
DBUSEAREA( .T.,"SQLMIX", "select * from TAB_PRECO", "xZ" )
index on StrZero(CODIGO,15) TO temp2
DBUSEAREA( .T.,"SQLMIX", "select * from TAB_PROD", "xy" )
index on StrZero(INPRODUTO,15) TO temp3
cRdd := RDDSETDEFAULT( "SQLMIX" )
nConn := RDDINFO( RDDI_CONNECT, { "ODBC", "Driver={SQL Server Native Client 10.0};Server=localhost;database=DATA_Z;Uid=MATRIZ;Pwd=zzzz" })
IF nConn == 0
hwg_Msginfo( "Não conectado ao servidor: " + str(RDDINFO( RDDI_ERRORNO )) + HB_EOL() + RDDINFO( RDDI_ERROR ) )
RDDSETDEFAULT( cRdd )
RETURN
ENDIF
DBUSEAREA( .T.,"SQLMIX", "select * from dbo.TB_PRODUTOS_", "tp" )
index on id_produto tag 01 to yy_temp
DBUSEAREA( .T.,"SQLMIX", "select * from dbo.VW_DADOS_", "xx" )
index on codigo tag 01 to xhwg_temp
index on idproduto tag 02 to xhwg_temp
23 Fev 2015 13:32
23 Fev 2015 13:37
23 Fev 2015 14:54
SQLRDD não precisa de um motor além do próprio SGBD, no lado cliente ele resolve todas as migração XBASE para SQL, já o MEDIATOR e DBACESS(TOTVS) resolve isso no lado servidor , por isso precisa instalar o aplicativo deles para para rodar no servidor.
SQLMIX por sua vez interpreta parte dos comando XBASE, ou seja, o SQLRDD consegue interpretar tudo, por sua vez posso usar um mesmo comando para rodar com POSTGRESQL, MYSQL, ORACLE e etc.... sem precisar colocar ou testar um IF para cada coisa.
Se você abrir usando o comando abaixo no SQLRDD ele vai abrindo conforme conforme vai navegando na tabela os registros.
use agenda alias agenda shared
browse()
Conexión con múltiples bases de datos: Nativo SQLITE y MYSQL, ADO y como Web Service
SQLMIX o programador já teria que programar uma paginação e etc...
23 Fev 2015 15:09
tem milhares de pessoas/empresa usando, acho difícil enganar tanta gente assim,