I am trying to update a table inside a for loop. When the next iteration comes in I am using an If statement to open the same data source under a different name and then update the first table. The problem is Jmp keeps adding a number to the first table's name so rather than getting 8 updates, I get 8 separate tables. NR is my number of records that needs pulled and added to each table. V is the record I want to obtain and add to the existing table.
For( i = 1, i <= NR, i++,
V = Vlo[i];
Vlo_Temp = Open Database(
"DSN=EZ Mes;Description=EZ;UID=;Trusted_Connection=Yes;APP=JMP;WSID=RLEEPER;DATABASE=EZ_DB_LOADER",
"SELECT * FROM dbo.tbl_NVR WHERE NV_VALUETYPE = 'DateTime' AND UID_NOW = '" || V || "'",
"Vlo_Temp"
);
If( i > 1,
V_Temp = Open Database(
"DSN=EZ Mes;Description=EZ;UID=;Trusted_Connection=Yes;APP=JMP;WSID=RLEEPER;DATABASE=EZ_DB_LOADER",
"SELECT * FROM dbo.tbl_NVR WHERE NV_VALUETYPE = 'DateTime' AND UID_NOW = '" || V || "'",
"V_Temp"
);
Vlo_Temp = Vlo_Temp << Update( With( Data Table( "V_Temp" ) ), Output Table Name ("Vlo_Temp") );
V_Temp << Close Window;
);
);
Help?