So, I’ve searched high and low for the right code to complete this task…I’ve got a feeling I’m close, but I’m still missing something. Still a fresh fish when it comes to scripting. Here’s the situation…I’m gathering information from one dataset ‘ClassRoster’ and using one it to generate another dataset for the SQL insert statement. The second dataset gets created correctly from the code included, but what does the SQL Insert code look like to finish the job? I’m trying to insert the 2nd dataset ‘oneRow’ into a SQL table. Thanks for any help!
I have to do something similar… I needed to get all the data from a foxpro database and insert all of the records into a SQL table This is how I did it.
[code]
DATA INITIALIZATION
Run once to initially populate the data in the SQL Database
first we get all of the LIMS data with a query to the LIMS database to return all records into a client dataset tag
LIMSData = system.tag.read(“MOS1B Fractionator/Raw Test Data From LIMS”).value
pdsLIMSData = system.dataset.toPyDataSet(LIMSData)
iterate through the entire dataset and pull out each individual row of data. Write the row data to the MS SQL Database
for index in range(len(pdsLIMSData)):
LIMSrowData = list(pdsLIMSData[index])
I want to use the data in my table and then insert the rows but trigger based on time. I can use a gateway time based script to call my script. My table is populated from a dataSet tag, should i use that as my source for pa.db.insertRows ?