Strange Results When Writing To SQL Database
Posted: Wed Jan 07, 2009 3:04 am
I am writing line item detail to a SQL database. The problem is the value written to PODLineNumber is always 6. This is strange as I have a total of 3 line items. When I run the code below, I am getting the following values:
gTotalLines = 3
tPOLine = 1,2,3
When I check the database, PODLineNumber is always 6. It doesn't matter how many line items I have, the PODLineNumber is always 6. PODLineNumber is setup as a integer. Any ideas? I am banging my head against the wall staring at this one!
answer gTotalLines
repeat with x = 1 to gTotalLines
put aItem[x] into tItem
put aDescription[x] into tDescription
put aCost[x] into tCost
put aLine[x] into tPOLine
answer tPOLine
revexecutesql gConID, "INSERT INTO podetail (PoDNumber, PODLineNumber, PoDItemNumber, PoDItemDesc, PoDUnitCost) values(:1,:2,:3,:4,:5)", "tPONumber","tPOLine", "tItem", "tDescription" , "tCost"
end repeat
gTotalLines = 3
tPOLine = 1,2,3
When I check the database, PODLineNumber is always 6. It doesn't matter how many line items I have, the PODLineNumber is always 6. PODLineNumber is setup as a integer. Any ideas? I am banging my head against the wall staring at this one!
answer gTotalLines
repeat with x = 1 to gTotalLines
put aItem[x] into tItem
put aDescription[x] into tDescription
put aCost[x] into tCost
put aLine[x] into tPOLine
answer tPOLine
revexecutesql gConID, "INSERT INTO podetail (PoDNumber, PODLineNumber, PoDItemNumber, PoDItemDesc, PoDUnitCost) values(:1,:2,:3,:4,:5)", "tPONumber","tPOLine", "tItem", "tDescription" , "tCost"
end repeat