<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>1 Aug 2016 16:19:01 Z</lastBuildDate><pubDate>29 Jul 2016 18:55:04 Z</pubDate><description>Hi everyone. I want to create a program that can connect to a SQLServer database, access a table and create a local copy on HFSQL.&#13;
&#13;
I have already written a code that works but its performance is very low, any suggestions?&#13;
&#13;
My actual code:&#13;
&#13;
&#13;
[code:wl]&#13;
&#13;
PROCEDURE SQLtoHFSQL(cServer, cUser, cPass, cBase, cTableName)&#13;
&#13;
&#13;
ConnectionNum is int&#13;
ConnectionNum = SQLConnect(cServer, cUser, cPass, cBase,"OLEDB",hOledbSQLServer)&#13;
&#13;
IF ConnectionNum &lt;&gt; 0 THEN&#13;
	&#13;
	cQuery is string = "select * from " + cTableName&#13;
	&#13;
	&#13;
	IF SQLExec(cQuery, "oQry") THEN&#13;
		&#13;
		&#13;
		aColumnas 	is array of strings&#13;
		aCol 		is array of strings&#13;
		nCol			is int = 1&#13;
		&#13;
		&#13;
		&#13;
		// Creamos la descripcion del .Fic&#13;
		oFile is File Description&#13;
		&#13;
		oFile..Name = "oData"&#13;
		oFile..Type = hFileNormal&#13;
&#13;
		&#13;
		// Describimos todos los items que contendrá el .Fic&#13;
		oItem is Item Description&#13;
		nTipo is int&#13;
		&#13;
		StringToArray(SQLColumn("oQry", True),aColumnas,CR)&#13;
		&#13;
		nColumnas is int = SQL.NbCol&#13;
		&#13;
		WHILE nCol &lt;= nColumnas&#13;
			&#13;
			StringToArray(aColumnas[nCol],aCol,TAB)&#13;
			&#13;
			&#13;
			IF aCol[2] = "T" THEN&#13;
				nTipo = hItemText&#13;
			ELSE&#13;
				IF aCol[3] = "1" THEN&#13;
					nTipo = hItemBoolean&#13;
				ELSE&#13;
					nTipo = hItemNumeric&#13;
				END&#13;
			END&#13;
			&#13;
			oItem..Name = aCol[1]&#13;
			oItem..Type = nTipo&#13;
			oItem..Size = aCol[4]&#13;
			HDescribeItem(oFile,oItem)&#13;
			&#13;
			nCol++&#13;
		END&#13;
		&#13;
		HDescribeFile(oFile)&#13;
		&#13;
		&#13;
		// Creamos el archivo fisico que contendrá los datos&#13;
		oData is Data Source&#13;
		HChangeName(oData,Replace(cTableName,".","_"))&#13;
		HCreation(oData)&#13;
		&#13;
		StringToArray(SQLColumn("oQry"),aColumnas,CR)&#13;
		&#13;
		WHILE SQLFetch("oQry") = 0&#13;
			&#13;
			nCol = 1&#13;
			&#13;
			WHILE nCol &lt;= nColumnas&#13;
				&#13;
				HToItem(oData, nCol, SQLGetCol("oQry", nCol))&#13;
				&#13;
				nCol++&#13;
			END&#13;
			&#13;
			HAdd(oData)&#13;
		END&#13;
		&#13;
	ELSE&#13;
		SQLInfo("oQry")&#13;
		Info("SQL error: " + SQL.MesError)&#13;
	END&#13;
	&#13;
	SQLDisconnect()&#13;
END&#13;
&#13;
[/code]</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql/read.awp</link><title>SQL to HFSQL</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>HECTOR</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql-58915/read.awp</comments><pubDate>1 Aug 2016 16:19:01 Z</pubDate><description>Hi Fabrice.&#13;
&#13;
1. I don't want to describe any file in the analysis, I want to dynamically build this files and fill them with t…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql-58915/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql-58915/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql/read.awp">SQL to HFSQL</source><title>Re: SQL to HFSQL</title></item><item><author>fromweb</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql-58911/read.awp</comments><pubDate>1 Aug 2016 13:50:42 Z</pubDate><description>Hi&#13;
&#13;
What is "very low" ?&#13;
&#13;
1. YOu can create the file description in the analysis, just by &#13;
conecting to your existing SQL D…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql-58911/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql-58911/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/58902-sql-hfsql/read.awp">SQL to HFSQL</source><title>Re: SQL to HFSQL</title></item></channel></rss>
