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 >>>>
select myTable1 SCAN sqlexec(hConn, 'insert into SQLTable1 (Field1, Field2,..) values (?myTable1.Field1, ?myTable2.Field2)') EDSCAN select myTable2 SCAN sqlexec(hConn, 'insert into SQLTable2 (Field1, Field2,..) values (?myTable2.Field1, ?myTable2.Field2)') EDSCANSo, this is what we want to get as the output? This is not going to work, so our prg output must be
text to lcInsert insert into mySQLTable1 (field1, field2,...) values (....) endtext select myTable1 SCAN sqlexec(nConn, lcInsert) EDNSCANSo, this is what we should get as our prg output - it's a bit tricky to produce this string based on DataDict table, but it's possible. You just need to know what you need to get as output (case 2) and then go for it.