>>>>>cSqlInsert = "insert into " + ALLTRIM(DICT.TBL_NAME) + " " >>>>>cSqlInsertValues = "" >>>>> >>>>>DO WHILE !EOF() AND DICT.TBL_NAME = cTableName >>>>> >>>>> cSqlInsert = cSqlInsert + IIF( EMPTY(cSqlInsertValues),"( ",", ") + ALLTRIM(DICT.FLD_NAME) >>>>> >>>>> cSqlInsertValues = cSqlInsertValues + IIF( EMPTY(cSqlInsertValues),"( ",", ") + "?" + ALLTRIM(DICT.TBL_NAME) + "." + ALLTRIM(DICT.FLD_NAME) >>>>> >>>>> SKIP IN DICT >>>>> >>>>>ENDDO >>>>> >>>>>cSqlInsert = cSqlInsert + ") VALUES " + cSqlInsertValues + ")" >>>>>>>>>>
>>>>cSqlInsert = "insert into " + ALLTRIM(DICT.TBL_NAME) + "(" >>>>cSqlInsertValues = "" >>>>SCAN WHILE DICT.TBL_NAME = cTableName >>>> cSqlInsert = cSqlInsert + ALLTRIM(DICT.FLD_NAME) + ", " >>>> cSqlInsertValues = cSqlInsertValues + "?" + ALLTRIM(DICT.TBL_NAME) + "." + ALLTRIM(DICT.FLD_NAME) +", " >>>>ENDSCAN >>>>cSqlInsert = LEFT(cSqlInsert, LEN(cSqlInsert)-2)+ ") VALUES (" + LEFT(cSqlInsertValues, LEN(cSqlInsertValues)-2) + ")" >>>>>>>>
>>>TEXT TO m.cFileStr ADDITIVE TEXTMERGE NOSHOW FLAGS 2 >>> >>> SELECT <<cTableName>> >>> >>> cSqlInsert = "<<cSqlInsert>>" >>> >>> DO WHIE !eof() >>> >>> nResult = SQLEXEC(hCon, cSqlInsert) >>> >>> SKIP >>> >>> ENDDO >>> >>>ENDTEXT >>> >>>>>>
cSqlInsert = "<<cSqlInsert>>"
converts the variable cSqlInsert into a long literal. Is this correct?>>select ListOfTables >> >>scan >> select (ListOfTables.TableName) >> lcInsert = GetInsertStatement(ListOfTables.TableName) >> scan >> SQLEXEC(hCon, ) && where cSQLInsert a statement prepared with the code above >> endscan >>endscan >>>>
lcSQL = "some very long line created at once"
That is why I suggest you to put creation of this line in TEXT ENDTEXT.